aswen / nagios-plugins

Scripts and plugins for Nagios
32 stars 50 forks source link

Checking if puppet is running... Not working. #2

Open ghost opened 12 years ago

ghost commented 12 years ago

[ "$(ps axf|egrep "/usr/bin/ruby /usr/sbin/puppetd|/usr/bin/ruby1.8 /usr/bin/puppet agent")" ] || result 4

Hello aswen, this above line does not work (at least not on my centos systems) I've been running this check for a long time but I just noticed that this doesnt work or I would of let you know sooner. anyways, the egrep line is always matched in the ps axf output. you could easily add egrep -v egrep but Im not a fan of multiple grep's.

I think this line, below, will cover most cases on all linux os's. If you are running puppet master on the same box you could get a false positive. I dont think unixs come with this command, but I dont think that matters since egrep probably doesnt come with them either.

anyways... the above can be changed with:

[ "$(pgrep puppet")" ] || result 4

after which checking if puppet is running should work as expected.

Once again, thanks for this plugin. It is appreciated.

aswen commented 8 years ago

@ghost Stil a problem with this line: https://github.com/aswen/nagios-plugins/blob/master/check_puppet_agent#L162 ?