{"action":"opened","issue":{"url":"https://api.github.com/repos/aswen/nagios-plugins/issues/23","repository_url":"https://api.github.com/repos/aswen/nagios-plugins","labels_url":"https://api.github.com/repos/aswen/nagios-plugins/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/aswen/nagios-plugins/issues/23/comments","events_url":"https://api.github.com/repos/aswen/nagios-plugins/issues/23/events","html_url":"https://github.com/aswen/nagios-plugins/issues/23","id":152889493,"number":23,"title":"Strict checks for either agent or master","user":{"login":"digitalprecision","id":234718,"avatar_url":"https://avatars.githubusercontent.com/u/234718?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalprecision","html_url":"https://github.com/digitalprecision","followers_url":"https://api.github.com/users/digitalprecision/followers","following_url":"https://api.github.com/users/digitalprecision/following{/other_user}","gists_url":"https://api.github.com/users/digitalprecision/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalprecision/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalprecision/subscriptions","organizations_url":"https://api.github.com/users/digitalprecision/orgs","repos_url":"https://api.github.com/users/digitalprecision/repos","events_url":"https://api.github.com/users/digitalprecision/events{/privacy}","received_events_url":"https://api.github.com/users/digitalprecision/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-03T22:32:02Z","updated_at":"2016-05-03T22:32:02Z","closed_at":null,"body":"An edge case was discovered which was causing check_puppet_agent to hang. If a node was running puppetmasterd but not puppetd, then the check_puppet_agent script would hang indefinitely when run through nrpe. The quick fix would be to tighten the regex in line 233:\r\n\r\n`ps axfww|egrep \"/usr(/local)?/bin/ruby[^ ]* /usr(/local)?/s?bin/puppet(d)?$\"|grep -v egrep`\r\n\r\nI would suggest a more elegant approach, to allow us to pass -r Role. agent (default) or master. This way we can conditionally change the regex accordingly, yet still use the same script. The only difference would be to add a 2nd line to nrpe.cfg, something like:\r\n\r\n```\r\ncommand[check_local_puppet_agent]=/usr/local/nagios/libexec/j1n_check_puppet -w 1800 -c 3600\r\ncommand[check_local_puppet_agent]=/usr/local/nagios/libexec/j1n_check_puppet -r master\r\n```"}}