Page 3 of 4

Re: Most Recent Alerts Report Issue

Posted: Wed Jul 10, 2013 4:43 pm
by EchoKev
abrist wrote:Run the check from the cli and post the output. The html output in pm may be truncated.
What check would you like me to run?
The HTML that I sent is exactly as it shows in the web browser.

Re: Most Recent Alerts Report Issue

Posted: Wed Jul 10, 2013 4:49 pm
by abrist
EchoKev wrote: What check would you like me to run?
I would like to see what the html check returns before it is set to the browser. I would like to see the raw html returned from just the check itself so I can attempt to reproduce the problem. The closing title tags are in a very weird place in the PM.

Re: Most Recent Alerts Report Issue

Posted: Thu Jul 11, 2013 9:06 am
by EchoKev
abrist wrote:
EchoKev wrote: What check would you like me to run?
I would like to see what the html check returns before it is set to the browser. I would like to see the raw html returned from just the check itself so I can attempt to reproduce the problem. The closing title tags are in a very weird place in the PM.

Code: Select all

root@monitor:/usr/local/nagios/libexec# ./check_https <URL REMOVED> login.htm
<title>Gateway
root@monitor:/usr/local/nagios/libexec#

Re: Most Recent Alerts Report Issue

Posted: Thu Jul 11, 2013 10:51 am
by abrist
Is "check_hhtps" a custom plugin/script? I can only reproduce your issue by setting "escape_html_tags=0", and when attempted with a custom test script or check_http, it works fine when "escape_html_tags=1".

Re: Most Recent Alerts Report Issue

Posted: Thu Jul 11, 2013 11:28 am
by EchoKev
abrist wrote:Is "check_hhtps" a custom plugin/script? I can only reproduce your issue by setting "escape_html_tags=0", and when attempted with a custom test script or check_http, it works fine when "escape_html_tags=1".
Yes, check_https is custom script that looks for specific words in a wget of a page. It then cats the output of the line that it finds the word on to the response of the check. Otherwise it returns a string "Connection refused by host"

Re: Most Recent Alerts Report Issue

Posted: Thu Jul 11, 2013 1:57 pm
by lmiltchev
Is there any possibility for you to try using "check_http" with the "-S" flag instead of "check_https" (for testing purposes) and see if you are going to experience the same issue?

Re: Most Recent Alerts Report Issue

Posted: Thu Jul 11, 2013 3:31 pm
by EchoKev
lmiltchev wrote:Is there any possibility for you to try using "check_http" with the "-S" flag instead of "check_https" (for testing purposes) and see if you are going to experience the same issue?
This check does not seem to work, as it is unable to read the page (HTTPS)

Re: Most Recent Alerts Report Issue

Posted: Fri Jul 12, 2013 9:29 am
by abrist
Could you by chance post the script in code wraps?

Re: Most Recent Alerts Report Issue

Posted: Fri Jul 12, 2013 3:19 pm
by EchoKev
abrist wrote:Could you by chance post the script in code wraps?
It's a very simple wget bash script, due to it being used for multiple different pages there are multiple greps for items that should appear on the page to verify that it is loading the correct page (I believe), otherwise return critical unreachable:

Code: Select all

#!/bin/bash
wget='/usr/bin/wget  --no-check-certificate --output-document=/tmp/tmp_html -S'
add_uri='https://'
end_uri='/'

if ($wget $add_uri$1$end_uri$2 2> /tmp/tmp_rep) then
 cat /tmp/tmp_html | grep '<title>'
 cat /tmp/tmp_html | grep 'OK'
 cat /tmp/tmp_rep | grep " 1 "

 exit 0
else
  cat /tmp/tmp_rep | grep " 1 "|| echo 'Connection refused by host'

 exit 2
fi;

Re: Most Recent Alerts Report Issue

Posted: Mon Jul 15, 2013 12:51 pm
by abrist
Well, I am at a loss. I can reproduce your issue only with escape_html_tags=0 directive. I even created a check for your script (with a few minor alterations for my environment, and it works just fine in core and XI.