OK - realized I didn't have the development files for tcp wrappers installed, installed those and now get a celan response from NRPE (see below).
NetMon2:~ # /usr/local/nagios/bin/nrpe --h
NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.13
Last Modified: 11-11-2011
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
TCP Wrappers Available
***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
** Read the NRPE SECURITY file for more information **
***************************************************************
Usage: nrpe [-n] -c <config_file> <mode>
Options:
-n = Do not use SSL
<config_file> = Name of config file to use
<mode> = One of the following two operating modes:
-i = Run as a service under inetd or xinetd
-d = Run as a standalone daemon
Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios. It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.
NetMon2:~ #
So, it's still not working, or at least I don't seem to understand what's going on. I decided to take the "check_ping" plugin and adapt it to have NRPE call it from the Nagios server but have the plugin run from the server that's runing the daemon nrpe.
So on the remote server running the nrpe daemon, I have this in the nrpe.cfg file:
command[check_arg_ping]=/usr/local/nagios/libexec/check_ping -H $ARG1$ -w $ARG2$ -c $ARG3$
In the commands.cfg file on the that NAGIOS is running on, I have this entry:
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
On the NAGIOS server In the config file for the switch that I want to ping, I have this entered:
define service{
use generic-service ; Inherit values from a template
host_name Server-Switch ; The name of the host the service is associated with
service_description PING Local ; The service description
check_command check_nrpe!-H 10.1.4.82 -c check_arg_ping -a 10.1.4.15 200.0,20% 600.0,60%
normal_check_interval 2 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}
For reference 10.1.4.82 is the MRTG/NRPE daemon server and 10.1.4.15 is the switch I'm trying to ping to. The basic ping option in Nagios for switches does work, but calling it using nrpe to a copy running on another system is failing.
Once everything i saved and restarted, I still get the "Unknown" as a status in Nagios. The above commands do work from the command prompt.
I have been able to isolate the macro process in the error logs. Below is the output portion of the error logs when it tries to process this service. For some reason, It's getting hostnames mixed up which I believe is why it's failing. .
1341943638.210667] [2048.1] [pid=12424] **** BEGIN MACRO PROCESSING ***********
[1341943638.210671] [2048.1] [pid=12424] Processing: '-H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%"'
[1341943638.210678] [2048.2] [pid=12424] Processing part: '-H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%"'
[1341943638.210684] [2048.2] [pid=12424] Not currently in macro. Running output (65): '-H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%"'
[1341943638.210689] [2048.1] [pid=12424] Done. Final output: '-H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%"'
[1341943638.210693] [2048.1] [pid=12424] **** END MACRO PROCESSING *************
[1341943638.210698] [2320.2] [pid=12424] Expanded Command Output: $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
[1341943638.210702] [001.0] [pid=12424] process_macros_r()
[1341943638.210707] [2048.1] [pid=12424] **** BEGIN MACRO PROCESSING ***********
[1341943638.210711] [2048.1] [pid=12424] Processing: '$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$'
[1341943638.210716] [2048.2] [pid=12424] Processing part: ''
[1341943638.210720] [2048.2] [pid=12424] Not currently in macro. Running output (0): ''
[1341943638.210725] [2048.2] [pid=12424] Processing part: 'USER1'
[1341943638.210732] [2048.2] [pid=12424] Processed 'USER1', Clean Options: 0, Free: 0
[1341943638.210738] [2048.2] [pid=12424] Processed 'USER1', Clean Options: 0, Free: 0
[1341943638.210742] [2048.2] [pid=12424] Cleaning options: global=0, local=0, effective=0
[1341943638.210747] [2048.2] [pid=12424] Uncleaned macro. Running output (25): '/usr/local/nagios/libexec'
[1341943638.210752] [2048.2] [pid=12424] Just finished macro. Running output (25): '/usr/local/nagios/libexec'
[1341943638.210757] [2048.2] [pid=12424] Processing part: '/check_nrpe -H '
[1341943638.210762] [2048.2] [pid=12424] Not currently in macro. Running output (40): '/usr/local/nagios/libexec/check_nrpe -H '
[1341943638.210766] [2048.2] [pid=12424] Processing part: 'HOSTADDRESS'
[1341943638.210771] [2048.2] [pid=12424] macros[2] (HOSTADDRESS) match.
[1341943638.210776] [2048.2] [pid=12424] Processed 'HOSTADDRESS', Clean Options: 0, Free: 1
[1341943638.210781] [2048.2] [pid=12424] Processed 'HOSTADDRESS', Clean Options: 0, Free: 1
[1341943638.210786] [2048.2] [pid=12424] Cleaning options: global=0, local=0, effective=0
[1341943638.210791] [2048.2] [pid=12424] Uncleaned macro. Running output (49): '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15'
[1341943638.210796] [2048.2] [pid=12424] Just finished macro. Running output (49): '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15'
[1341943638.210801] [2048.2] [pid=12424] Processing part: ' -c '
[1341943638.210805] [2048.2] [pid=12424] Not currently in macro. Running output (53): '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15 -c '
[1341943638.210810] [2048.2] [pid=12424] Processing part: 'ARG1'
[1341943638.210817] [2048.2] [pid=12424] Processed 'ARG1', Clean Options: 0, Free: 0
[1341943638.210822] [2048.2] [pid=12424] Processed 'ARG1', Clean Options: 0, Free: 0
[1341943638.210826] [2048.2] [pid=12424] Cleaning options: global=0, local=0, effective=0
[1341943638.210832] [2048.2] [pid=12424] Uncleaned macro. Running output (118): '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15 -c -H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%"'
[1341943638.210837] [2048.2] [pid=12424] Just finished macro. Running output (118): '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15 -c -H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%"'
[1341943638.210846] [2048.2] [pid=12424] Processing part: ' -a '
[1341943638.210851] [2048.2] [pid=12424] Not currently in macro. Running output (122): '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15 -c -H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%" -a '
[1341943638.210856] [2048.2] [pid=12424] Processing part: 'ARG2'
[1341943638.210863] [2048.2] [pid=12424] Processed 'ARG2', Clean Options: 0, Free: 0
[1341943638.210868] [2048.2] [pid=12424] Processing part: ''
[1341943638.210872] [2048.2] [pid=12424] Not currently in macro. Running output (122): '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15 -c -H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%" -a '
[1341943638.210877] [2048.1] [pid=12424] Done. Final output: '/usr/local/nagios/libexec/check_nrpe -H 10.1.4.15 -c -H 10.1.4.82 -c check_arg_ping -a "10.1.4.15 200.0,20% 600.0,60%" -a '
[1341943638.210882] [2048.1] [pid=12424] **** END MACRO PROCESSING *************
Can't get nrpe to run rrdtraf
Re: Can't get nrpe to run rrdtraf
Okay, this looks like a problem with your definitions now. Your service definition should look like this:
The other IP address in the command line is derived from the address field in Server-Switch's host definition.
Code: Select all
define service{
use generic-service ; Inherit values from a template
host_name Server-Switch ; The name of the host the service is associated with
service_description PING Local ; The service description
check_command check_nrpe!check_arg_ping!10.1.4.15 200.0,20% 600.0,60%
normal_check_interval 2 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until its final/hard state is determined
}Re: Can't get nrpe to run rrdtraf
Sorry for the delay with no response - that pesky thing called work, which pays the bills, got in the way for a couple weeks!
Anyway - I can now report success!
I took your last suggestion and applied it to the configuration settings I had posted on Jul 6th and NRPE & Nagios started behaving with each other. Once I saw that was working, I tried the same suggestion with nrpe and rrd_traf on a switch port and it too worked as it should!
I now have a little better understanding on how arguments are passed back and forth between Nagios and NRPE and configuring the rest of the switch ports shouldn’t’ be too much an issue.
So now I have the fun task of doing all the ports (1600+) on my two MRTG servers.
Thanks again for all your help and patience in guiding this noob with Nagios through this learning process.
Anyway - I can now report success!
I took your last suggestion and applied it to the configuration settings I had posted on Jul 6th and NRPE & Nagios started behaving with each other. Once I saw that was working, I tried the same suggestion with nrpe and rrd_traf on a switch port and it too worked as it should!
I now have a little better understanding on how arguments are passed back and forth between Nagios and NRPE and configuring the rest of the switch ports shouldn’t’ be too much an issue.
So now I have the fun task of doing all the ports (1600+) on my two MRTG servers.
Thanks again for all your help and patience in guiding this noob with Nagios through this learning process.