NRPE Arguments

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

NRPE Arguments

Post by BanditBBS »

I've been googling and testing for the last hour and not having much luck. It has been quite a while since I used NRPE and am having some trouble passing command line arguments to it. its accepting the arguments(was compile properly), its just passing them that I am having issues.

for example, the disk check is configured as so: command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ $ARG3$

So why does this work:

Code: Select all

[root@iss-chi-nag05 ~]# /usr/local/nagios/libexec/check_nrpe -H tlc-365-dap01.tlc.itciss.com -c check_disk -a "5%" "2% -A -I /root/.gvfs -x /software_stage -t 240 -e"
DISK OK| /=838MB;1883;1943;0;1983 /tmp=1103MB;9423;9720;0;9919 /usr=3539MB;14134;14580;0;14878 /var=1356MB;14134;14580;0;14878 /boot=40MB;93;96;0;98 /dev/shm=0MB;7782;8028;0;8192 /ua3001=56733MB;97280;100352;0;102400 /us3001=8041MB;48640;50176;0;51200 /uu3001=26517MB;48640;50176;0;51200 /up3001=1585MB;48640;50176;0;51200 /interface=18MB;19456;20070;0;20480 /ua3002=172MB;19150;19754;0;20158
But this doesn't:(get all kinds of nrpe errors

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H tlc-365-dap01.tlc.itciss.com -c check_disk -a "5%" "2%" "-A -I /root/.gvfs -x /software_stage -t 240 -e"

EDIT #1:
Wow, adding a space resolved it:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H tlc-365-dap01.tlc.itciss.com -c check_disk -a "5%" "2%" " -A -I /root/.gvfs -x /software_stage -t 240 -e"
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: NRPE Arguments

Post by jdalrymple »

Generally speaking I (and I think most people) wrap all of the arguments in ''

So in your case

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H tlc-365-dap01.tlc.itciss.com -c check_disk -a '5% 2% -A -I /root/.gvfs -x /software_stage -t 240 -e'
Does that look and/or work proper?
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: NRPE Arguments

Post by BanditBBS »

nrpe would either treat that as all $ARG1$ or as $ARG1$ through $ARG10$ due to all the spaces, not sure which it'd see. I need to supply separate arguments because of how I had it set with check_by_ssh and converting without having to make any changes to the 16000 service configs :)

I'm using mysql and making updates, replacing the check command check# with the new one for specific batches of customers, verifying it works and will then move on. Have completed one customer so far and I got all the issues resolved. You can close this, I just needed to refresh my memory of all the NRPE nuances.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked