I wonder if my problem has similar reasons...
I have two (virtual) machines: a Nagios server, and a Nagios-client.
On the command line on the server:
Code: Select all
# /usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% 10%
DISK OK - free space: / 8144 MB (85% inode=92%);| /=1368MB;9951;;0;9951
produces these logs in the client:
Code: Select all
Jul 25 01:04:29 elukancompute nrpe[4276]: Host is asking for command 'check_all_disks' to be run...
Jul 25 01:04:29 elukancompute nrpe[4276]: Running command: /usr/lib64/nagios/plugins/check_disk -w -c -p
Jul 25 01:04:29 elukancompute nrpe[4276]: Command completed with return code 0 and output: DISK OK - free
Jul 25 01:04:29 elukancompute nrpe[4276]: Return Code: 0, Output: DISK OK - free space: / 8144 MB (85% ino
Jul 25 01:04:29 elukancompute nrpe[4276]: [30B blob data]
but these configurations on the server:
Code: Select all
define service{
use generic-service
contact_groups wheels
hostgroup_name computes
service_description Disk usage
check_command check_nrpe2!check_all_disks!20%!10%
}
define command{
command_name check_nrpe2
command_line '/usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$'
}
doesn't cause anything to be sent to the client (no logs about that at all), but the logs on the server:
Code: Select all
[1406711548.059932] [016.0] [pid=19617] Attempting to run scheduled check of service 'Disk usage' on host '10.27.128.81': check options=0, latency=0.059000
[1406711548.059980] [016.0] [pid=19617] Checking service 'Disk usage' on host '10.27.128.81'...
[1406711548.059995] [2320.2] [pid=19617] Raw Command Input: '/usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$'
[1406711548.060023] [2048.1] [pid=19617] **** BEGIN MACRO PROCESSING ***********
[1406711548.060028] [2048.1] [pid=19617] Processing: 'check_all_disks'
[1406711548.060034] [2048.2] [pid=19617] Processing part: 'check_all_disks'
[1406711548.060040] [2048.2] [pid=19617] Not currently in macro. Running output (15): 'check_all_disks'
[1406711548.060044] [2048.1] [pid=19617] Done. Final output: 'check_all_disks'
[1406711548.060047] [2048.1] [pid=19617] **** END MACRO PROCESSING *************
[1406711548.060051] [2048.1] [pid=19617] **** BEGIN MACRO PROCESSING ***********
[1406711548.060055] [2048.1] [pid=19617] Processing: '20%'
[1406711548.060059] [2048.2] [pid=19617] Processing part: '20%'
[1406711548.060063] [2048.2] [pid=19617] Not currently in macro. Running output (3): '20%'
[1406711548.060066] [2048.1] [pid=19617] Done. Final output: '20%'
[1406711548.060070] [2048.1] [pid=19617] **** END MACRO PROCESSING *************
[1406711548.060073] [2048.1] [pid=19617] **** BEGIN MACRO PROCESSING ***********
[1406711548.060077] [2048.1] [pid=19617] Processing: '10%'
[1406711548.060081] [2048.2] [pid=19617] Processing part: '10%'
[1406711548.060084] [2048.2] [pid=19617] Not currently in macro. Running output (3): '10%'
[1406711548.060088] [2048.1] [pid=19617] Done. Final output: '10%'
[1406711548.060092] [2048.1] [pid=19617] **** END MACRO PROCESSING *************
[1406711548.060095] [2320.2] [pid=19617] Expanded Command Output: '/usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$'
[1406711548.060099] [2048.1] [pid=19617] **** BEGIN MACRO PROCESSING ***********
[1406711548.060102] [2048.1] [pid=19617] Processing: ''/usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$''
[1406711548.060123] [2048.2] [pid=19617] Processing part: ''/usr/lib64/nagios/plugins/check_nrpe -H '
[1406711548.060128] [2048.2] [pid=19617] Not currently in macro. Running output (41): ''/usr/lib64/nagios/plugins/check_nrpe -H '
[1406711548.060132] [2048.2] [pid=19617] Processing part: 'HOSTADDRESS'
[1406711548.060139] [2048.2] [pid=19617] Processed 'HOSTADDRESS', Clean Options: 0, Free: 0
[1406711548.060143] [2048.2] [pid=19617] Processed 'HOSTADDRESS', Clean Options: 0, Free: 0
[1406711548.060146] [2048.2] [pid=19617] Cleaning options: global=0, local=0, effective=0
[1406711548.060151] [2048.2] [pid=19617] Uncleaned macro. Running output (53): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81'
[1406711548.060155] [2048.2] [pid=19617] Just finished macro. Running output (53): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81'
[1406711548.060159] [2048.2] [pid=19617] Processing part: ' -c '
[1406711548.060163] [2048.2] [pid=19617] Not currently in macro. Running output (57): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c '
[1406711548.060167] [2048.2] [pid=19617] Processing part: 'ARG1'
[1406711548.060173] [2048.2] [pid=19617] Processed 'ARG1', Clean Options: 0, Free: 0
[1406711548.060177] [2048.2] [pid=19617] Processed 'ARG1', Clean Options: 0, Free: 0
[1406711548.060180] [2048.2] [pid=19617] Cleaning options: global=0, local=0, effective=0
[1406711548.060184] [2048.2] [pid=19617] Uncleaned macro. Running output (72): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks'
[1406711548.060188] [2048.2] [pid=19617] Just finished macro. Running output (72): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks'
[1406711548.060192] [2048.2] [pid=19617] Processing part: ' '
[1406711548.060196] [2048.2] [pid=19617] Not currently in macro. Running output (73): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks '
[1406711548.060200] [2048.2] [pid=19617] Processing part: 'ARG2'
[1406711548.060204] [2048.2] [pid=19617] Processed 'ARG2', Clean Options: 0, Free: 0
[1406711548.060207] [2048.2] [pid=19617] Processed 'ARG2', Clean Options: 0, Free: 0
[1406711548.060211] [2048.2] [pid=19617] Cleaning options: global=0, local=0, effective=0
[1406711548.060215] [2048.2] [pid=19617] Uncleaned macro. Running output (76): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20%'
[1406711548.060228] [2048.2] [pid=19617] Just finished macro. Running output (76): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20%'
[1406711548.060232] [2048.2] [pid=19617] Processing part: ' '
[1406711548.060236] [2048.2] [pid=19617] Not currently in macro. Running output (77): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% '
[1406711548.060240] [2048.2] [pid=19617] Processing part: 'ARG3'
[1406711548.060244] [2048.2] [pid=19617] Processed 'ARG3', Clean Options: 0, Free: 0
[1406711548.060248] [2048.2] [pid=19617] Processed 'ARG3', Clean Options: 0, Free: 0
[1406711548.060251] [2048.2] [pid=19617] Cleaning options: global=0, local=0, effective=0
[1406711548.060255] [2048.2] [pid=19617] Uncleaned macro. Running output (80): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% 10%'
[1406711548.060259] [2048.2] [pid=19617] Just finished macro. Running output (80): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% 10%'
[1406711548.060263] [2048.2] [pid=19617] Processing part: '''
[1406711548.060267] [2048.2] [pid=19617] Not currently in macro. Running output (81): ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% 10%''
[1406711548.060271] [2048.1] [pid=19617] Done. Final output: ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% 10%''
[1406711548.060274] [2048.1] [pid=19617] **** END MACRO PROCESSING *************
[1406711548.060334] [016.1] [pid=19617] Check result output will be written to '/var/log/nagios/spool/checkresults/check4hg74H' (fd=7)
[1406711548.060553] [016.2] [pid=19617] Service check is executing in child process (pid=19625)
[1406711548.063824] [016.2] [pid=19625] Moving temp check result file '/var/log/nagios/spool/checkresults/check4hg74H' to queue file '/var/log/nagios/spool/checkresults/cH1U8a2'...
[1406711550.061597] [016.0] [pid=19617] Starting to reap check results.
[1406711550.061628] [016.1] [pid=19617] Starting to read check result queue '/var/log/nagios/spool/checkresults'...
[1406711550.061652] [016.1] [pid=19617] Processing check result file: '/var/log/nagios/spool/checkresults/cH1U8a2'
[1406711550.061738] [016.2] [pid=19617] Found a check result (#1) to handle...
[1406711550.061747] [016.1] [pid=19617] Handling check result for service 'Disk usage' on host '10.27.128.81'...
[1406711550.061752] [016.0] [pid=19617] ** Handling check result for service 'Disk usage' on host '10.27.128.81'...
[1406711550.061756] [016.1] [pid=19617] HOST: 10.27.128.81, SERVICE: Disk usage, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 127, OUTPUT: (null)
[1406711550.061841] [016.2] [pid=19617] ST: HARD CA: 3 MA: 3 CS: 2 LS: 2 LHS: 2
[1406711550.061847] [016.1] [pid=19617] Service is in a non-OK state!
[1406711550.061852] [016.1] [pid=19617] Host is currently UP, so we'll recheck its state to make sure...
[1406711550.061856] [016.1] [pid=19617] * Using last known host state: 0
[1406711550.061860] [016.1] [pid=19617] Current/Max Attempt(s): 3/3
[1406711550.061864] [016.1] [pid=19617] Service has reached max number of rechecks, so we'll handle the error...
That is:
Code: Select all
[1406711548.060271] [2048.1] [pid=19617] Done. Final output: ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% 10%''
doesn't get to be sent to the client.
[edit]
Also, the server command ends with: " (Return code of 127 is out of bounds - plugin may be missing) "