check works testing and from CLI but not in XI

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:

check works testing and from CLI but not in XI

Post by BanditBBS »

Ok, so here is the check results in XI:
Capture.PNG
Capture1.PNG
As you can see it is showing warning due to 10 percent free on /ulnrepo. The problem with that is this:
Capture2.PNG
If I use the "Run check Command" or test the command from commandline, it results in an OK as it should with the override of the thresholds for ulnrepo.

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/negate -t 600 -u OK -s /usr/local/nagios/libexec/check_nrpe -H 10.160.0.94 -t 600 -c check_disk -a "10%" "8% -A -I /OVS/Repositories -I /backup -I /software -I /poolfsmnt -I /root/.gvfs -I /us.* -I /$ -I /home -I /usr -I /var -I /boot -I /ud.* -I /ut.* -I /un.* -I /ur.* -I /ua.* -I /uu.* -I /up.* -e -C -w 4% -c 3% -r /ulnrepo"
DISK OK| /dev/shm=0MB;7220;7381;0;8023 /tmp=23MB;8955;9154;0;9951 /ulnrepo=1382720MB;1485569;1501043;0;1547468
NRPE Check Disk is:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ $ARG3$
You do not have the required permissions to view the files attached to this post.
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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check works testing and from CLI but not in XI

Post by tgriep »

Can you enable debugging on the NRPE agent by editing the nrpe.cfg file, change the following from
debug=0
to
debug=1
Save the file and restart the NRPE Agent.

Then force the check in the XI GUI to run, then check the syslog files in the /var/log folder to see what the NRPE Agent ran for that check?
Post the output here.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check works testing and from CLI but not in XI

Post by lmiltchev »

BanditBBS, do you get the same output when you run these two commands from the command line?

Code: Select all

/usr/local/nagios/libexec/negate -t 600 -u OK -s /usr/local/nagios/libexec/check_nrpe -H 10.160.0.94 -t 600 -c check_disk -a "10%" "8% -A -I /OVS/Repositories -I /backup -I /software -I /poolfsmnt -I /root/.gvfs -I /us.* -I /$ -I /home -I /usr -I /var -I /boot -I /ud.* -I /ut.* -I /un.* -I /ur.* -I /ua.* -I /uu.* -I /up.* -e -C -w 4% -c 3% -r /ulnrepo"

Code: Select all

/usr/local/nagios/libexec/negate -t 600 -u OK -s /usr/local/nagios/libexec/check_nrpe -H 10.160.0.94 -t 600 -c check_disk -a "10%" "8%" -A -I /OVS/Repositories -I /backup -I /software -I /poolfsmnt -I /root/.gvfs -I /us.* -I /$ -I /home -I /usr -I /var -I /boot -I /ud.* -I /ut.* -I /un.* -I /ur.* -I /ua.* -I /uu.* -I /up.* -e "-C -w 4% -c 3% -r /ulnrepo"
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: check works testing and from CLI but not in XI

Post by BanditBBS »

@tgriep

I did that and see nothing being written other that the daemon starting and listening on the port and allowing connections from specific IPs. After that there is nothing written

@lmiltchev

Umm, did you miss a quote in the second line? You wanted to know if I got the same reply regardless if i sent as 2 arguments or 3, right? Yes, same reply from CLI and test. XI replies with the wrong stuff still as well.
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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check works testing and from CLI but not in XI

Post by lmiltchev »

I asked you to run these two commands as the command that you used to test from the CLI seemed wrong to me. You are using two args in it:

1st - "10%"
2nd - "8% -A ... all this other stuff between the double quotes..."
If I use the "Run check Command" or test the command from commandline, it results in an OK as it should with the override of the thresholds for ulnrepo.

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/negate -t 600 -u OK -s /usr/local/nagios/libexec/check_nrpe -H 10.160.0.94 -t 600 -c check_disk -a "10%" "8% -A -I /OVS/Repositories -I /backup -I /software -I /poolfsmnt -I /root/.gvfs -I /us.* -I /$ -I /home -I /usr -I /var -I /boot -I /ud.* -I /ut.* -I /un.* -I /ur.* -I /ua.* -I /uu.* -I /up.* -e -C -w 4% -c 3% -r /ulnrepo"
You command is defined as such:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ $ARG3$
So, you don't need to pass the "-w" or "-c" flags (in $ARG1$ and $ARG2$) in your check, as they are already defined in the command. The 1st arg you are passing ("10%") is OK, but in the second one, you are passing "-w" and "-c" (-w 4% -c 3% -r /ulnrepo)...

I may be wrong, but it seems this way, the "-c" is passed twice. Other words, you should be using 3 args, not two. In $ARG1$ and $ARG2$, you should be passing percentages only (no flags). In the $ARG3$, you should be passing the flags ("-w" and "-c") plus the percentages.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: check works testing and from CLI but not in XI

Post by BanditBBS »

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/negate -t 600 -u OK -s /usr/local/nagios/libexec/check_nrpe -H 10.160.0.94 -t 600 -c check_disk -a "10%" "8% -A -I /OVS/Repositories -I /backup -I /software -I /poolfsmnt -I /root/.gvfs -I /us.* -I /$ -I /home -I /usr -I /var -I /boot -I /ud.* -I /ut.* -I /un.* -I /ur.* -I /ua.* -I /uu.* -I /up.* -e -C -w 4% -c 3% -r /ulnrepo"
DISK OK| /dev/shm=0MB;7220;7381;0;8023 /tmp=23MB;8955;9154;0;9951 /ulnrepo=1382917MB;1485569;1501043;0;1547468
The above is the test results from CCM. The default thresholds are 10% and 8%. I'm then using -C to clear thresholds and then resetting them for the specified path /ulnrepo. Regardless if I use it as 2 or 3 arguments its all doing the same results. If don't this on other servers and the overrides are working fine, I just can't figure this one out.
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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check works testing and from CLI but not in XI

Post by tgriep »

I was hoping that enabling debugging in the Agent would show if the arguments are getting passed from XI to the remote server.
You said that other servers working doing this, is that correct?
If so, check the version of the NRPE agent that is running on both systems as well as the version of the check_disk plugin.
Maybe there is a bug in the check_disk plugin that doesn't process the -C option.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: check works testing and from CLI but not in XI

Post by BanditBBS »

tgriep wrote:I was hoping that enabling debugging in the Agent would show if the arguments are getting passed from XI to the remote server.
You said that other servers working doing this, is that correct?
If so, check the version of the NRPE agent that is running on both systems as well as the version of the check_disk plugin.
Maybe there is a bug in the check_disk plugin that doesn't process the -C option.
All NRPE is 2.15 and check_disk are the same too, 2.0.3.

It can't be the check_disk, when run from commandline from XI it comes back correct and from the test button in CCM it comes back correct. it is only not coming back correct in XI
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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check works testing and from CLI but not in XI

Post by tgriep »

I would check the command and the service check and verify that the escaping is correct and that the quotes are correct as well.
Compare them between a working config and the non working one.
When using the Test Check Button, it adds in extra escaping and double quotes if needed and maybe the command is missing them.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked