check_nagios command not picking up nagios process

Jason Lixfeld jason+lists.nagios at lixfeld.ca
Thu Mar 4 17:20:39 CET 2004


On Mar 4, 2004, at 8:57 AM, C. Bensend wrote:

>
>> Pulled the command out of the cgi.cfg and ran it manually after the 
>> web
>> interface wasn't seeing the nagios process as running:
>>
>> su-2.05b# /usr/local/libexec/nagios/check_nagios -F
>> /var/spool/nagios/status.log -e 5 -C '/usr/local/bin/nagios -d
>> /usr/local/etc/nagios/nagios.cfg'
>> Could not locate a running Nagios process!
>> su-2.05b# ps xa|grep "/usr/local/bin/nagios -d
>> /usr/local/etc/nagios/nagios.cfg"
>>   8519  ??  Ss     0:00.10 /usr/local/bin/nagios -d
>> /usr/local/etc/nagios/nagios.cfg
>>   8950  p0  S+     0:00.00 grep /usr/local/bin/nagios -d
>> /usr/local/etc/nagios/nagios.cfg
>> su-2.05b# file /var/spool/nagios/status.log
>> /var/spool/nagios/status.log: ASCII text
>> su-2.05b#
>
> This is something I've had to fiddle with on just about every Nagios 
> server
> I've built so far.
>
> Try using a check command of:
>
> /usr/local/libexec/nagios/check_nagios -F /var/spool/nagios/status.log 
> -e
> 5 -C 'nagios'
>
> That has worked for me before.

That didn't work for me.  It would appear that check_nagios 
(check_procs) is very picky about what it will match.  It will match 
some commands, but it will  not match the same command with a varied 
command line execution.  Dumb.  How can I fix this?

su-2.05b# ps xa|grep nagios
  8519  ??  Ss     0:02.62 /usr/local/bin/nagios -d 
/usr/local/etc/nagios/nagios.cfg
17485  p0  R+     0:00.00 grep nagios
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "/usr/local/bin/nagios"
Could not locate a running Nagios process!

su-2.05b# ps xa|grep "/bin/sh"
17492  p0  S+     0:00.00 grep /bin/sh
   456 con- S      0:00.01 /bin/sh /usr/local/bin/mysqld_safe 
--user=mysql --datadir=/var/db/mysql 
--pid-file=/var/db/mysql/eshara.pid
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "/bin/sh"
Nagios ok: located 1 process, status log updated 5 seconds ago

su-2.05b# ps xa|grep "bash"
  7853  p0  Ss     0:00.02 -bash (bash)
  7878  p0  S      0:00.63 su (bash)
17539  p0  S+     0:00.00 grep bash
  7862  p1  Ss+    0:00.04 -bash (bash)
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C bash
Nagios ok: located 1 process, status log updated 11 seconds ago
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "-bash"
Could not locate a running Nagios process!
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "(bash)"
Nagios ok: located 1 process, status log updated 5 seconds ago
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "su (bash)"
Nagios ok: located 1 process, status log updated 12 seconds ago
su-2.05b#

su-2.05b# ps xa|grep "ntpd"
   391  ??  Ss     0:06.73 /usr/sbin/ntpd -p /var/run/ntpd.pid -f 
/var/db/ntpd.drift
   405  ??  S      0:01.39 /usr/sbin/ntpd -p /var/run/ntpd.pid -f 
/var/db/ntpd.drift
17566  p0  R+     0:00.00 grep ntpd
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "/usr/local/bin/ntpd"
Could not locate a running Nagios process!
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "/usr/sbin/ntpd"
Could not locate a running Nagios process!

su-2.05b# ps xa|grep "cron"
   434  ??  Ss     0:01.55 /usr/sbin/cron
17571  p0  S+     0:00.00 grep cron
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "/usr/sbin/cron"
Could not locate a running Nagios process!

su-2.05b# ps xa|grep smtp
17581  ??  S      0:00.01 smtpd -n smtp -t inet -u
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "smtpd"
Could not locate a running Nagios process!

su-2.05b# ps xa|grep pickup
16887  ??  S      0:00.01 pickup -l -t fifo -u
17608  p0  R+     0:00.00 grep pickup
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "pickup"
Could not locate a running Nagios process!
su-2.05b# /usr/local/libexec/nagios/check_nagios -F 
/var/spool/nagios/status.log -e 5 -C "pickup -l -t fifo -u"
Could not locate a running Nagios process!
su-2.05b#

> Benny
>
>
> -- 
> "Have you ever tried simply turning off the TV, sitting down with your
> children, and hitting them?"                   -- Bender, "Futurama"
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when 
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list