How to login to https website and check web pages?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

How to login to https website and check web pages?

Post by PhilG »

Hello:
We are using Nagios XI 2014R2.7.
There is a server and website that is crucial to our organization that we access but do not host (hosted by another University).
The Up.Time monitoring service we have (but needs to be decommissioned) authenticates to the website and then checks some pages to verify that the web pages are valid and up and running fine. This worked up until a couple of weeks ago when the host removed SSL2 and SSL3 access, and our version of Up.Time doesn't accommodate TLS.
Is there some Nagios XI documentation which provides how to do that kind of check?
The following is some information on how our Up.Time was checking things:

page0
POST https://<website>:443/psp/<edited>/<edited>/<edited>/?cmd=login&languageCd=ENG
POST-DATA timezoneOffset=360&userid=<edited>&pwd=<edited>
GET https://<website>:443/psp/<edited>/<edited>/<edited>/h/?tab=DEFAULT
GET https://<website>:443/psp/<edited>/<edited>/<edited>/h/?cmd=getCachedPglt&pageletname=MENU&tab=DEFAULT&PORTALPARAM_COMPWIDTH=Narrow&ptlayout=N
CHK login attempted
page1
GET https://<website>:443/psp/<edited>/<edited>/<edited>/?cmd=logout
GET https://<website>:443/<edited>/signin.css
GET https://<website>:443/<edited>/images/<edited>.gif
GET https://<website>:443/<edited>/images/<edited>.gif
GET https://<website>:443/<edited>/images/<edited>.gif
CHK logout attempted


Thank you in advance for your assistance.
Newbie '14
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to login to https website and check web pages?

Post by hsmith »

PhilG wrote:Hello:
We are using Nagios XI 2014R2.7.
There is a server and website that is crucial to our organization that we access but do not host (hosted by another University).
The Up.Time monitoring service we have (but needs to be decommissioned) authenticates to the website and then checks some pages to verify that the web pages are valid and up and running fine. This worked up until a couple of weeks ago when the host removed SSL2 and SSL3 access, and our version of Up.Time doesn't accommodate TLS.
Is there some Nagios XI documentation which provides how to do that kind of check?
The following is some information on how our Up.Time was checking things:

page0
POST https://<website>:443/psp/<edited>/<edited>/<edited>/?cmd=login&languageCd=ENG
POST-DATA timezoneOffset=360&userid=<edited>&pwd=<edited>
GET https://<website>:443/psp/<edited>/<edited>/<edited>/h/?tab=DEFAULT
GET https://<website>:443/psp/<edited>/<edited>/<edited>/h/?cmd=getCachedPglt&pageletname=MENU&tab=DEFAULT&PORTALPARAM_COMPWIDTH=Narrow&ptlayout=N
CHK login attempted
page1
GET https://<website>:443/psp/<edited>/<edited>/<edited>/?cmd=logout
GET https://<website>:443/<edited>/signin.css
GET https://<website>:443/<edited>/images/<edited>.gif
GET https://<website>:443/<edited>/images/<edited>.gif
GET https://<website>:443/<edited>/images/<edited>.gif
CHK logout attempted


Thank you in advance for your assistance.
If you issue a /usr/local/nagios/libexec/check_http -h it will give you the "manual" for this command. I believe you can do what you are looking for with the -e flag.

Take a look at this and let us know.
Former Nagios Employee.
me.
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: How to login to https website and check web pages?

Post by PhilG »

I have found the Nagios XI "Website URL" monitoring wizard and created the following:
check_xi_service_http! -f ok -I <SERVER IP> -u "/psp/<EDITED Path1>/EDITED2 Path2>/<EDITED3 Path3>/" -S -p 443 -a "<USERNAME>:<PASSWD>"

That appeared to work.

Now, the question comes from my group is that they want to string some additional checks, ex. first check for a .GIF on the page, then logout and check logout page.

Can this be accomplished, and if so, how? I do not have any Perl scripting background.

Thank you.
Newbie '14
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to login to https website and check web pages?

Post by Box293 »

You could check for the specific file perhaps?

Code: Select all

./check_http -H mashable.com -u /wp-content/uploads/2008/06/building-your-first-web-page.png
HTTP OK: HTTP/1.1 200 OK - 36864 bytes in 0.194 second response time |time=0.193566s;;;0.000000 size=36864B;;;0
As for your other request, have a read through this document, specifically the stuff about web transactions:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: How to login to https website and check web pages?

Post by PhilG »

Box293 wrote:You could check for the specific file perhaps?

Code: Select all

./check_http -H mashable.com -u /wp-content/uploads/2008/06/building-your-first-web-page.png
HTTP OK: HTTP/1.1 200 OK - 36864 bytes in 0.194 second response time |time=0.193566s;;;0.000000 size=36864B;;;0
As for your other request, have a read through this document, specifically the stuff about web transactions:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Does this help?
Thanks for the response.

Since the check requires secure authentication, check_http wouldn't work, and since there are some web pages that need to be verified and logout, the web transactions wizard/configuration would be ideal. Now comes the part where I will need to learn that process.

You may freeze this post.
Newbie '14
Locked