Page 1 of 1

How to login to https website and check web pages?

Posted: Tue Aug 25, 2015 11:25 am
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.

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

Posted: Tue Aug 25, 2015 12:13 pm
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.

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

Posted: Tue Aug 25, 2015 2:24 pm
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.

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

Posted: Tue Aug 25, 2015 7:01 pm
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?

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

Posted: Fri Aug 28, 2015 2:19 pm
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.