Page 1 of 1

check_procs plugin

Posted: Mon Jul 16, 2012 2:49 pm
by noodle48
I want to use the check_procs plugin to look for a certain process on a remote server but only one under my hostgroups needs to have this happen. Do I need to create a servicegroup and add the host or can I just use the services.cfg file.

Thanks

Re: check_procs plugin

Posted: Mon Jul 16, 2012 4:15 pm
by agriffin
I'm not that clear on what you're asking, but you can create a new service and assign it to a single host without including the rest of the hostgroup.

Re: check_procs plugin

Posted: Wed Jul 18, 2012 11:13 am
by noodle48
Maybe this will help:

Nagios server /usr/local/nagios/etc/objects/commands.cfg:

# 'check_local_procs' command definition
define command{
command_name check_local_sendmail
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -C $ARG3$
}
/usr/local/nagios/etc/hosts.cfg
define service{
use generic-service ; Name of service template to use
host_name **********************
service_description Sendmail Check
check_command check_local_sendmail!10!1024!sendmail
}

On the client /usr/local/nagios/etc/nrpe.cfg
command[check_sendmail]=/usr/local/nagios/libexec/check_procs -w 10 -c 1024 -C sendmail

On Nagios Dashboard I get this:


Sendmail Check

UNKNOWN 07-18-2012 11:12:09 0d 0h 1m 21s 1/3 Usage:

Where am I messing up??

Re: check_procs plugin

Posted: Wed Jul 18, 2012 12:47 pm
by noodle48
I figured it out. I need to add the following line to /usr/local/nagios/etc/nrpe.cfg on client:

command[check_sendmail]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -C $ARG3$

Otherwise my command won't know how to handle the command I mentioned above.

Thanks!

Re: check_procs plugin

Posted: Wed Jul 18, 2012 2:12 pm
by agriffin
Glad you got it figured out and working!