Page 1 of 1

how to configure nrpe.cfg

Posted: Tue May 20, 2014 2:44 am
by Sanjeet
Hello,
i have installed the Nagios Monitoring system on RHEL 6.4. the remote host where i have insalled the NRPE plugin and addon,

now i want to add services Like ping,ssh,http,disk space in "/usr/local/nagios/etc/nrpe.cfg" please guide with exmple.
below mention current content of "/usr/local/nagios/etc/nrpe.cfg" file.

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_users]=/usr/local/nagios/libexec/check_ssh -w $ARG1$ -c $ARG2$

Please help me.

Re: how to configure nrpe.cfg

Posted: Tue May 20, 2014 9:31 am
by slansing
If you are looking to add custom plugins to your remote NRPE.cfg you can follow the command definitions that you just linked. Take one as an example and customize it for your new plugin. By the way, I just want to clarify that you only installed the NRPE agent on this host correct? You didn't install Nagios Core here? You only need an agent on a remote host to actively monitor it via NRPE, you do not need to install Core on it.

Re: how to configure nrpe.cfg

Posted: Tue May 20, 2014 11:02 pm
by Sanjeet
yes only i have installed the NRPE agent on remote host and im looking to add custom plugins to NRPE.cfg. If i want to add ping command definitions the file content like
" command[check_users]=/usr/local/nagios/libexec/check_ssh -w $ARG1$ -c $ARG2$" Please let me know what should be the $ARG1$ & $ARG2$.

I mean
$ARG1$ = ?????
$ARG2$ = ????

Re: how to configure nrpe.cfg

Posted: Wed May 21, 2014 4:36 am
by falken
Hi,

There ARG's you should set in your host.cfg at nagios server.
Here is my example:

In /etc/nagios/hosts/server.cfg I defined a service:

Code: Select all

define service{
        use                     generic-service
        host_name               server
        service_description     LOAD
        check_command           check_nrpe!check_local_load!5,6,7!8,9,10
}
In /etc/nagios/objects/commands.cfg I defined the command check_nrpe:

Code: Select all

define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
In /etc/nagios/objects/commands.cfg I defined the command check_local_load:

Code: Select all

define command{
        command_name    check_load
        command_line    $USER1$/check_load -w $ARG1$ -c $ARG2$
}
On the remote host..
In /etc/nagios/nrpe.cfg I configured the check_load command:

Code: Select all

command[check_load]=/usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
Cheers.

Re: how to configure nrpe.cfg

Posted: Wed May 21, 2014 11:34 am
by abrist
My suggestions:

Code: Select all

define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}

Code: Select all

define service{
        use                     generic-service
        host_name               server
        service_description     LOAD
        check_command           check_nrpe!check_local_load!-w 5,6,7 -c 8,9,10
}

Code: Select all

command[check_load]=/usr/lib/nagios/plugins/check_load $ARG1$
You can ignore the check_load service check config as that would only apply to local checks, *not* checks through nrpe.