check works until it is scheduled and then it fails

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check works until it is scheduled and then it fails

Post by tgriep »

Go and edit that service and add single quotes around the data in the $ARG5$ field. Save it out and see if that helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check works until it is scheduled and then it fails

Post by ssax »

Please edit your service and try putting single quotes around this:

Code: Select all

/_layouts/15/Sp.Login.Custom/Login.aspx\?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F
So it looks like this:

Code: Select all

'/_layouts/15/Sp.Login.Custom/Login.aspx\?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F'
Apply config and let us know the results.
Bionic___
Posts: 54
Joined: Wed Oct 23, 2013 7:49 am

Re: check works until it is scheduled and then it fails

Post by Bionic___ »

OK, From the command line it works:

Code: Select all

nagios@dira4avbaza /usr/local/nagios/libexec> /usr/local/nagios/libexec/check_website -w 1500 -c 4000 -t 6000 -s -u '/_layouts/15/Sp.Login.Custom/Login.aspx\?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F' portal.dir.texas.gov
HTTPS OK: 55ms - https://portal.dir.texas.gov/_layouts/15/Sp.Login.Custom/Login.aspx\?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F|time=55ms;1500;4000;0;
From the Test Check Command button it fails:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_website -w 1500 -c 4000 -t 6000 -s  -u \'/_layouts/15/Sp.Login.Custom/Login.aspx\?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F portal.dir.texas.gov 
OUTPUT: HTTPS UNKNOWN: N/A - https://portal.dir.texas.gov'/_layouts/15/Sp.Login.Custom/Login.aspx?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F
From the scheduled initiation:

Code: Select all

HTTPS OK: 288ms - https://portal.dir.texas.gov/_layouts/15/Sp.Login.Custom/Login.aspx?ReturnUrl=%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252F&Source=%2F
IT WORKS! :D :D :D

I did not know that there was a difference in the way the test button and schedule parsed the information. Chalk that up to a new learning.
I think we can call this one resolved.
Thanks for all the help!
Locked