Greetings!
New to this forum, but I've been using Nagios for some time.
Question about configuring NRPE to monitor remote IP's through a NRPE Remote Server.
Is there a way to specify the remote IP that I'd like to monitor on the Nagios Server?
Currently, the Nagios server has a .cfg file Service Definition that looks like:
define service {
use generic-service
host_name <hostname>
service_description <hostname_Prod_Ping>
check_command check_nrpe!check_ping_<hostname>
The <hostname> is the actual hostname that I'm monitoring it's "production" IP.
The check_ping_<hostname> is the entry in the nrpe.cfg on the NRPE Remote Host.
The check_ping_<hostname> on the NRPE Remote Server contains the hardcoded IP that I'd like to check and it looks like:
command[check_ping_<hostname>]=/usr/local/nagios/libexec/check_ping -H <IP> -w 3000.0,80% -c 5000.0,100% -p 5
check_ping_<hostname> where <hostname> is the actual server name
<IP> is the actual IP that I am checking on
What I'm trying to determine is whether I'll need to enter every <hostname> and <IP> on the NRPE Remote Host, or if I can
pass those variables from the Nagios Server? I have a few hundred hosts, so I'm trying to make it a little more efficient!
From the Nagios Server itself, I can monitor what we call the Management IP's which can be ping'd from the network the Nagios
Server is on, however the Production IP's are on a private network not visible to the Server, but visible to the NRPE Remote Host.
Thank you.
Steve
NAgios Core - NRPE Remote IP Monitoring
Re: NAgios Core - NRPE Remote IP Monitoring
Passing the IP address from the Nagios server as an argument is possible to do as long as the NRPE agent on the remote system is setup to receive Arguments.
To enable it, you would edit the nrpe.cfg file and enable this option.
to
This will make it a generic command as the <hostname> cannot be passed.
Save and restart the NRPE agent.
This will allow the command to accept an argument.
Then on the Nagios server the check_command would look like the following, replace xxx.xxx.xxx.xxx with the IP address you want to test.
And the check_nrpe command will have to be defined like this to accept the extra arguments.
Try that out and let us know if you have any further questions.
To enable it, you would edit the nrpe.cfg file and enable this option.
Code: Select all
dont_blame_nrpe=1
Then edit the command on the remote server and change it from# Values: 0=do not allow arguments, 1=allow command arguments
Code: Select all
command[check_ping_<hostname>]=/usr/local/nagios/libexec/check_ping -H <IP> -w 3000.0,80% -c 5000.0,100% -p 5
Code: Select all
command[check_ping]=/usr/local/nagios/libexec/check_ping -H $ARG1$ -w 3000.0,80% -c 5000.0,100% -p 5
Save and restart the NRPE agent.
This will allow the command to accept an argument.
Then on the Nagios server the check_command would look like the following, replace xxx.xxx.xxx.xxx with the IP address you want to test.
Code: Select all
check_command check_nrpe!check_ping!-a xxx.xxx.xxx.xxx
Code: Select all
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NAgios Core - NRPE Remote IP Monitoring
Will do.
Thank you!
Steve
Thank you!
Steve
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NAgios Core - NRPE Remote IP Monitoring
Let us know if you have any further questions.