[Nagiosplug-help] check_nrpe CheckWMIValue help
Louis Carreiro
carreirolt at gmail.com
Sat Sep 25 05:21:56 CEST 2010
Hey everyone! I've got a problem that I've been banging my head against the
wall about. I'm trying to pull in performance data using "check_nrpe
CheckWMIValue" and I'm getting no where.
I've got a pretty standard Nagios install. Ubuntu 10.04, Nagios 3.2.2,
Plugins 1.4.15, NRPE 2.12, MRTG, NSClient++ 0.3.8, and NagiosGraph.
My command.cfg looks like this:
[code]
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
[/code]
My service definition looks like this:
[code]
define service{
use generic-service;
host_name 172.28.200.7
service_description C Drive Read IO;
check_command check_nrpe!CheckWMIValue -a "Query=Select Name,
DiskReadsPersec from Win32_PerfFormattedData_PerfDisk_PhysicalDisk WHERE
Name like \'%C:%\'" Check:DiskReads=DiskReadsPersec MaxWarn=0 MaxCrit=100
AliasCol=Name;
action_url
/nagios/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$'
onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()'
rel='/nagios$;
}
[/code]
WIth that, all I get in Nagios is:
[code]
Status Information: OK: Everything seems fine.
Performance Data:
[/code]
The performance data is blank. If run check_nrpe from the command line with
the arguments listed above, I get:
[code]OK: Everything seems fine.|'DiskReads'=0;0;100; [/code]
When Nagios builds the macro, it looks like it processes fine. Below is the
Nagios.debug:
[code]
1285383893.989261] [2320.2] [pid=756] Raw Command Input: $USER1$/check_nrpe
-H $HOSTADDRESS$ -c $ARG1$
[1285383894.205646] [2320.2] [pid=756] Expanded Command Output:
$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
[1285383894.205665] [2048.1] [pid=756] Processing: '$USER1$/check_nrpe -H
$HOSTADDRESS$ -c $ARG1$'
[1285383894.205830] [2048.2] [pid=756] Processing part: '/check_nrpe -H '
[1285383894.205839] [2048.2] [pid=756] Not currently in macro. Running
output (40): '/usr/local/nagios/libexec/check_nrpe -H '
[1285383894.205917] [2048.2] [pid=756] Uncleaned macro. Running output
(52): '/usr/local/nagios/libexec/check_nrpe -H 172.28.200.7'
[1285383894.205926] [2048.2] [pid=756] Just finished macro. Running
output (52): '/usr/local/nagios/libexec/check_nrpe -H 172.28.200.7'
[1285383894.205943] [2048.2] [pid=756] Not currently in macro. Running
output (56): '/usr/local/nagios/libexec/check_nrpe -H 172.28.200.7 -c '
[1285383894.205986] [2048.2] [pid=756] Uncleaned macro. Running output
(251): '/usr/local/nagios/libexec/check_nrpe -H 172.28.200.7 -c
CheckWMIValue -a "Query=Select Name, DiskReadsPersec from
Win32_PerfFormattedData_PerfDisk_PhysicalDisk WHERE Name like '%C:%'"
Check:DiskReads=DiskReadsPersec MaxWarn=0 MaxCrit=100 AliasCol=Name'
[1285383894.205995] [2048.2] [pid=756] Just finished macro. Running
output (251): '/usr/local/nagios/libexec/check_nrpe -H 172.28.200.7 -c
CheckWMIValue -a "Query=Select Name, DiskReadsPersec from
Win32_PerfFormattedData_PerfDisk_PhysicalDisk WHERE Name like '%C:%'"
Check:DiskReads=DiskReadsPersec MaxWarn=0 MaxCrit=100 AliasCol=Name'
[1285383894.206012] [2048.2] [pid=756] Not currently in macro. Running
output (251): '/usr/local/nagios/libexec/check_nrpe -H 172.28.200.7 -c
CheckWMIValue -a "Query=Select Name, DiskReadsPersec from
Win32_PerfFormattedData_PerfDisk_PhysicalDisk WHERE Name like '%C:%'"
Check:DiskReads=DiskReadsPersec MaxWarn=0 MaxCrit=100 AliasCol=Name'
[1285383894.206021] [2048.1] [pid=756] Done. Final output:
'/usr/local/nagios/libexec/check_nrpe -H 172.28.200.7 -c CheckWMIValue -a
"Query=Select Name, DiskReadsPersec from
Win32_PerfFormattedData_PerfDisk_PhysicalDisk WHERE Name like '%C:%'"
Check:DiskReads=DiskReadsPersec MaxWarn=0 MaxCrit=100 AliasCol=Name'
[/code]
The Service Check Debug looks like this:
[code]
[1285383976.395533] [016.0] [pid=756] Scheduling a forced, active check of
service 'C Drive Read IO' on host '172.28.200.7' @ Fri Sep 24 23:06:14 2010
[1285383976.646106] [016.0] [pid=756] Attempting to run scheduled check of
service 'C Drive Read IO' on host '172.28.200.7': check options=1,
latency=2.646000
[1285383976.646188] [016.0] [pid=756] Checking service 'C Drive Read IO' on
host '172.28.200.7'...
[1285383982.108064] [016.1] [pid=756] Handling check result for service 'C
Drive Read IO' on host '172.28.200.7'...
[1285383982.108073] [016.0] [pid=756] ** Handling check result for service
'C Drive Read IO' on host '172.28.200.7'...
[1285383982.108081] [016.1] [pid=756] HOST: 172.28.200.7, SERVICE: C Drive
Read IO, CHECK TYPE: Active, OPTIONS: 1, SCHEDULED: Yes, RESCHEDULE: Yes,
EXITED OK: Yes, RETURN CODE: 0, OUTPUT: OK: Everything seems fine.\n
[1285383982.108191] [016.0] [pid=756] Scheduling a non-forced, active check
of service 'C Drive Read IO' on host '172.28.200.7' @ Fri Sep 24 23:16:16
2010
[1285383982.108227] [016.1] [pid=756] Checking service 'C Drive Read IO' on
host '172.28.200.7' for flapping...
[1285383982.108255] [016.1] [pid=756] Checking host '172.28.200.7' for
flapping...
[1285383982.108348] [016.2] [pid=756] Processed service performance data
file output: 1285383976||172.28.200.7||C Drive Read IO||OK: Everything seems
fine.||
[/code]
I'm completely lost!!!! It looks like it's processing the macros correctly.
If I run check_nrpe with the arguments in the command line it works
correctly. It's just when Nagios processes the command it doesn't receive
the performance data. It's like it's dropping the end of completely. I know
if you omit the MinCrit and MaxCrit it won't display the performance data
but I have those in there. The macro processing even keeps it. It just seems
like when Nagios executes the command, it drops them or something. Does
anyone have any thoughts?
Thanks in advance everyone!
Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20100924/c5392627/attachment.html>
More information about the Help
mailing list