Most Recent Alerts Report Issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Most Recent Alerts Report Issue

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Most Recent Alerts Report Issue

Post 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".
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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"
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Most Recent Alerts Report Issue

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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)
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Most Recent Alerts Report Issue

Post by abrist »

Could you by chance post the script in code wraps?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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;
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Most Recent Alerts Report Issue

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked