Monitor webpage with embedded dynamic content on a webpage

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

Monitor webpage with embedded dynamic content on a webpage

Postby sguederian » Fri Feb 14, 2020 12:45 pm

Hello,

We have a webpage that displays embedded dynamic charts that we need to monitor to make sure they are always up.

I am able to use the check_form_plugin and check for a specific word on the webpage but Nagios is only able to find words on the "main" webpage, which is good to make sure the main page is up (which we are doing) but not the embedded chart (which also does have words that are selectable so therefore should be searchable).

Is there a way (maybe another plugin) I can use to monitor and make sure those charts are up ?

My developers said if I am able to check to see if the "http class" is loaded, then we know the chart is loaded.

Thank you,
Serge
sguederian
 
Posts: 2
Joined: Fri Feb 14, 2020 12:32 pm

Re: Monitor webpage with embedded dynamic content on a webpa

Postby mcapra » Fri Feb 14, 2020 1:22 pm

sguederian wrote:My developers said if I am able to check to see if the "http class" is loaded, then we know the chart is loaded.


Not 100% sure what they mean by this.

If you just want to see if the content of an HTTP page contains an object with class="http", check_http can do that:
Code: Select all
# /usr/local/nagios/libexec/check_http -H www.basicwebsiteexample.com -s 'class="js-webfont"'
HTTP OK: HTTP/1.1 200 OK - 93221 bytes in 0.574 second response time |time=0.574059s;;;0.000000 size=93221B;;;0
# /usr/local/nagios/libexec/check_http -H www.basicwebsiteexample.com -s 'class="some-other-class"'
HTTP CRITICAL: HTTP/1.1 200 OK - string 'class="some-other-class"' not found on 'http://www.basicwebsiteexample.com:80/' - 93221 bytes in 0.573 second response time |time=0.572554s;;;0.000000 size=93221B;;;0


Your Nagios XI installation should have the check_http plugin available, and some configuration wizards if what I've shared above looks like Greek to you:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

If you're following the Website URL configuration wizard, you can provide a string or regex to match on the page that you're checking.
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3599
Joined: Thu May 05, 2016 3:54 pm

Re: Monitor webpage with embedded dynamic content on a webpa

Postby mbellerue » Fri Feb 14, 2020 1:47 pm

Hi sguederian, welcome to the forum!

In this case, it may be helpful to see the source code of the page from your browser's perspective. If you can load the page, right click, view source, dump the code into a text file, and send it to me, that would be great. Also if you could include a screenshot of what the page looks like. That way I will be able to line up the code and the screenshot.

If you don't want to post it publicly, you can PM it to me.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mbellerue
 
Posts: 1274
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor webpage with embedded dynamic content on a webpa

Postby sguederian » Fri Feb 14, 2020 2:41 pm

Thanks mbellerue,

The page I am trying to monitor requires a login first. It is https://analytics.bcaresearch.com/chart ... 9_05_13_c1

I don't think I can use check_http in this case because it is expecting a hostname only.

I can't seem to PM you to give you more details... if you let me know how I can PM you, I can send you a dump of the code.

Thanks.
sguederian
 
Posts: 2
Joined: Fri Feb 14, 2020 12:32 pm

Re: Monitor webpage with embedded dynamic content on a webpa

Postby benjaminsmith » Fri Feb 14, 2020 3:08 pm

Hello @squederian,
I can't seem to PM you to give you more details... if you let me know how I can PM you, I can send you a dump of the code.

Try sending this once more, I believe you need at least 2 posts to be able to send a PM.

Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benjaminsmith
 
Posts: 2226
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul


Return to Nagios XI

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 26 guests