how to configure nrpe.cfg

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Sanjeet
Posts: 6
Joined: Tue May 13, 2014 6:23 am

how to configure nrpe.cfg

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: how to configure nrpe.cfg

Post 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.
Sanjeet
Posts: 6
Joined: Tue May 13, 2014 6:23 am

Re: how to configure nrpe.cfg

Post 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$ = ????
falken
Posts: 6
Joined: Thu May 15, 2014 5:56 am

Re: how to configure nrpe.cfg

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: how to configure nrpe.cfg

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked