I'm trying to use check_procs from NRPE to find out whether Passenger is running on my server. It loads from httpd but appears separately.

32135 ?        Sl     0:09 Passenger RackApp: /usr/share/puppet/rack/puppetmasterd  
32589 ?        Sl     0:01 Passenger AppPreloader: /usr/share/puppet/rack/puppetmasterd  
32629 ?        Sl     0:05 Passenger RackApp: /usr/share/puppet/rack/puppetmasterd  
32751 ?        Sl     0:05 Passenger RackApp: /usr/share/puppet/rack/puppetmasterd  

When I try to test it like so:

 check_procs -w 2: -c 3: -C Passenger

It tells me there are 0 processes found. I see them - how do I get NRPE to count them?


It's likely that the process name is not what you think it is. To find out how check_process is looking for your job try this: check_procs -vv -C Passenger. You'll see something like this:

/usr/lib64/nagios/plugins/check_procs -vv -C Passenger   
CMD: /bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'  
PROCS OK: 0 processes with command name 'Passenger'  

Now take the ps command and try it yourself like this:

/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args' | grep Passenger

Notice that there are lots of jobs matching your description... just not named like you thought they would be...

S+       0   841 26063 103244   852  0.0 grep            grep Passenger  
Ssl      0 30160  2134 216524  1972  0.0 PassengerWatchd PassengerWatchdog  
Sl       0 30164 30160 1108096 4980  0.2 PassengerHelper PassengerHelperAgent  
Sl      99 30170 30160 219616  4292  0.0 PassengerLoggin PassengerLoggingAgent  
Sl      52 32135     1 217972 113944 1.1 ruby            Passenger RackApp:   /usr/share/puppet/rack/puppetmasterd                
Sl      52 32629     1 235484 131480 1.9 ruby            Passenger RackApp:   /usr/share/puppet/rack/puppetmasterd                
Sl      52 32751     1 218672 114568 1.7 ruby            Passenger RackApp: /usr/share/puppet/rack/puppetmasterd     

Now change your check_procs command to match:

/usr/lib64/nagios/plugins/check_procs  -C ruby -a Passenger  
PROCS OK: 3 processes with command name 'ruby', args 'Passenger'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.