Monitoring a website and expected content

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Monitoring a website and expected content

Post by emartine »

I am trying to monitor the Nagios XI main web page content.
I can log in as the nagios test user I created and I am expecting it to read the content "Nagios XI" as it shows up on the main page. See attached.

My understanding from the check that is running via the wizards is that the check runs as follows:

/usr/local/nagios/libexec/check_http -H servername -s "Nagios XI" -f ok -I <serverIP> -u "/nagiosxi/" -S -p 443 -a "<username>:<password>"

Unfortunately the response I get back is:

/usr/local/nagios/libexec/check_http -H servername -s "Nagios XI" -f ok -I <serverIP> -u "/nagiosxi/" -S -p 443 -a "<username>:<password>"
HTTP CRITICAL: HTTP/1.1 302 Found - string 'Nagios XI' not found on 'https://servername:443/nagiosxi/' - 629 bytes in 0.175 second response time |time=0.174792s;;;0.000000 size=629B;;;0

Am I doing this right? Perhaps this isn't the best way to monitor website content?

The reason for doing this is to ensure that the main page shows what is expected and not just availability.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring a website and expected content

Post by scottwilkerson »

302 is a redirection

change -f ok to -f follow
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Monitoring a website and expected content

Post by emartine »

Awesome the follow works. This commands logs in as the test account I created but does it log out? If it doesn't... how can I make it log out?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring a website and expected content

Post by scottwilkerson »

It's only "logged in" in the sense that XI would remember the user if you sent the cookie back, since you aren't storing the cookie, you are essentially logged out, nothing else to do.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Monitoring a website and expected content

Post by emartine »

Thank you for that info. How would I monitor a web page that is flash based? Is that possible?
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Monitoring a website and expected content

Post by emartine »

Scott. I sent you a PM.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring a website and expected content

Post by scottwilkerson »

send response in PM, but the gist was the page being monitored didn't use Basic Authentication so the command as being used would not work. May have to build a complex check using the Web Transaction Wizards, or something more complicated
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Monitoring a website and expected content

Post by emartine »

I used the web transaction wizard and ensured that the stanzas were closed. But there still appears to be an issue.
There is a line that says could not find ParserDetails.ini in /usr/lib64/perl5/XML/SAX

./webinject.pl -c filename_config.xml

Starting WebInject Engine...

-------------------------------------------------------
could not find ParserDetails.ini in /usr/lib64/perl5/XML/SAX
Test: filename_test.xml - 1
Login page
Passed HTTP Response Code Verification (not in error range)
TEST CASE PASSED
Response Time = 0.907 sec
-------------------------------------------------------
Test: filename_test.xml - 2
Sign in
Passed HTTP Response Code Verification (not in error range)
TEST CASE PASSED
Response Time = 0.853 sec
-------------------------------------------------------

Start Time: Thu Apr 5 10:36:56 2018
Total Run Time: 1.816 seconds

Test Cases Run: 2
Test Cases Passed: 2
Test Cases Failed: 0
Verifications Passed: 2
Verifications Failed: 0


Is there a way to verify that the check is working correctly?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring a website and expected content

Post by scottwilkerson »

This looks correct.
emartine wrote:There is a line that says could not find ParserDetails.ini in /usr/lib64/perl5/XML/SAX
you may just need to re-install the package

Code: Select all

yum install perl-XML-SAX -y
emartine wrote: Is there a way to verify that the check is working correctly?
Best way I can think of is have it test for something that shouldn't exist and see if it fails one of the steps, or give it bad credentials and it should fail the login
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Monitoring a website and expected content

Post by emartine »

Even with credentials reworded all tests pass.
Locked