Page 3 of 4
Re: New Nagios Build - unable to get NRPE working
Posted: Tue Mar 04, 2014 3:35 pm
by thetechguy
I have now tried following this that you posted earlier.. and now I am getting a different error.
check_disk: Could not parse arguments
Usage:
check_disk -w limit -c limit [-W limit] [-K limit] {-p path
lmiltchev wrote:I would change the command definition on the client from this:
Code: Select all
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/VolGroup00-LogVol00
to this:
Code: Select all
command[check_hda1]=/usr/local/nagios/libexec/check_disk $ARG1$
Restart nrpe.
On the nagios site of things, I would change the service definition from this:
Code: Select all
define service{
use generic-service
host_name gamma
service_description Drive Space
check_command check_nrpe!check_disk!-w 20% !-c 10% !-p /dev/mapper/VolGroup00-LogVol00
}
to this:
Code: Select all
define service{
use generic-service
host_name gamma
service_description Drive Space
check_command check_nrpe!check_hda1!-a '-w 20% -c 10% -p /dev/mapper/VolGroup00-LogVol00'
}
Hope this helps.
Re: New Nagios Build - unable to get NRPE working
Posted: Tue Mar 04, 2014 5:14 pm
by sreinhardt
Are you building from source or using the rpm provided via yum? If you are building from source, you need to be sure to use --enable-command-args with ./configure or else don't blame nrpe will not have the logic needed to actually accept command args. Here is a pretty excellent guide to installing from source, just in case you are going that route.
http://www.thegeekstuff.com/2010/12/ena ... arguments/
Re: New Nagios Build - unable to get NRPE working
Posted: Tue Mar 04, 2014 6:05 pm
by thetechguy
sreinhardt - thank you for your reply.. I listed the guide I used in the thread.. It is from code.. That being the case I check my command history and I did not use the switch to enable arguments when I ran ./configure. - so what to do from here? Run ./configure again with the switch ----enable-command-args then run all of the make commands again as well? Do I need to remove my package first?
Thank you again for you help
Jon
Re: New Nagios Build - unable to get NRPE working
Posted: Wed Mar 05, 2014 11:02 am
by tmcdonald
You should be able to do what you stated - reconfigure it, remake it. The config files might be overwritten though, so if you made any changes to those you will want to back them up first.
Someone feel free to correct me if I am wrong, but this is how I have always upgraded NRPE so I would imagine this would work the same for "reinstalling" it.
Re: New Nagios Build - unable to get NRPE working
Posted: Wed Mar 05, 2014 11:51 am
by thetechguy
Thanks again all for your help.. still having problems.. here is my recent history on the remote client
./configure --enable-ssl --enable-command-args
1005 make all
1006 make install-plugin
1007 make install-daemon
1008 make install-deamon-config
1009 make install-xinetd
1010 cd /usr/local/nagios/etc/
1011 vi nrpe.cfg - (here I had to change the nrpe.cfg file to allow connection from my nagios server)
1012 service xinetd restart
1013 chkconfig xinetd on
1014 cd/etc/xinetd.d/
1015 vi nrpe.cfg - (here I checked the nrpe.cfg file and it was not over written so no changes were made)
1016 service xinetd restart
1017 chkconfig xinetd on
After this I initiated a check on the hard drive service and I am seeing the same error.
Current Status: UNKNOWN (for 0d 0h 8m 59s)
Status Information: check_disk: Could not parse arguments
Usage:
check_disk -w limit -c limit [-W limit] [-K limit] {-p path
Not sure what to do at this point.. seems like I have tried everything all of you have suggested to no avail.
Thank you
Jon
Re: New Nagios Build - unable to get NRPE working
Posted: Wed Mar 05, 2014 12:11 pm
by tmcdonald
Did you also edit /usr/local/nagios/etc/nrpe.cfg to set "dont_blame_nrpe = 1" to allow arguments?
Re: New Nagios Build - unable to get NRPE working
Posted: Wed Mar 05, 2014 12:44 pm
by thetechguy
tmcdonald , Yes it was not over written so that setting was still set correctly dont_blame_nrpe=1
Okay so I tried a hard code command on my remote client and now it is working.. So is it clear that my remote client is not accepting arguments.
I added this line to my client side file /usr/local/nagios/etc/nrpe.cfg
command[check_hda2]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/VolGroup00-LogVol00
Then added this service definition to my Nagios server
Code: Select all
define service{
use generic-service
host_name gamma
service_description Drive Space 2
check_command check_nrpe!check_hda2
}
Now my Nagios host server can see the drive size space correctly. I hope that adding my other servers will not be this difficult and I would like to have them able to use arguments so that all installations are standard. Well for now I got it working.. If anyone can provide or link me to a clear installation method that seems to work for multiple OS versions that will also create a daemon for nrpe that would be very helpful.
Thanks again.
Jon
Re: New Nagios Build - unable to get NRPE working
Posted: Wed Mar 05, 2014 12:48 pm
by abrist
Each platform will have a slightly different method to install. I do not know of any unified install docs for multiple platforms. You most likely need to make sure you are compiling nrpe with command args.
Re: New Nagios Build - unable to get NRPE working
Posted: Wed Jul 30, 2014 6:54 am
by turboscrew
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) "
Re: New Nagios Build - unable to get NRPE working
Posted: Thu Jul 31, 2014 1:55 pm
by lmiltchev
When you are monitoring a remote box via NRPE, you usually run on the server:
Code: Select all
./check_nrpe -H <client ip> -c <command> -c <args>
for example:
Code: Select all
check_nrpe -H 10.27.128.81 -c check_all_disks -a '-w 20 -c 10'
and your command may be defined on the client as such:
Code: Select all
command[check_all_disks]=/usr/lib64/nagios/plugins/check_disk $ARG1$