Page 1 of 1

Iam I dong this correctly for check_http

Posted: Wed Feb 09, 2022 8:02 am
by btayl
When I run this
./check_http -H lvl2xxxxxedu -s "Email" -f ok -I 1xxxxx4 -u '/profile' -S --sni -p 443 -a username:pass -v

I get this as the output

https://xxxxxxxx4:443/profile is 508 characters
STATUS: HTTP/1.1 302 Found
**** HEADER ****
Date: Wed, 09 Feb 2022 12:53:12 GMT
Server: Apache
Strict-Transport-Security: max-age=31536000;includeSubDomains
Via: 1.1 xxxxxxxx (Access Gateway-agxxxxx-117x7)
Location: https://lvl2.med.umich.edu/profile/
Content-Length: 164
Connection: close
Content-Type: text/html; charset=iso-8859-1
**** CONTENT ****
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved.</p>
</body></html>

HTTP CRITICAL: HTTP/1.1 302 Found - string 'Email' not found on 'https://lvxxxxxxxdu:443/profile' - 508 bytes in 0.010 second response time |time=0.009587s;;;0.000000 size=508B;;;0


When I run this
./check_http -L -H lvl2.med.umich.edu -s "Email" -f ok -I X.X.X.X -u '/profile' -S --sni -p 443 -a username:pass -v

I get this

<A HREF="https://lvlxxxxxxx:443/profile" target="_blank">SSL initialized
GET /profile HTTP/1.1
User-Agent: check_http/v2.3.3 (nagios-plugins 2.3.3)
Connection: close
Host: lvl2xxxxxxxxdu
Accept: */*
Authorization: Basic xxxxxxxxxxxxxx


https://xxxxxxxx4:443/profile is 508 characters
STATUS: HTTP/1.1 302 Found
**** HEADER ****
Date: Wed, 09 Feb 2022 12:58:08 GMT
Server: Apache
Strict-Transport-Security: max-age=31536000;includeSubDomains
Via: 1.1 lvl2xxxxedu (Access Gateway-ag-x-x)
Location: https://lvxxxxxdu/profile/
Content-Length: 164
Connection: close
Content-Type: text/html; charset=iso-8859-1
**** CONTENT ****
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved.</p>
</body></html>

HTTP CRITICAL: HTTP/1.1 302 Found - string 'Email' not found on 'https://lvl2xxxxxxxu:443/profile' - 508 bytes in 0.010 second response time </A>|time=0.009998s;;;0.000000 size=508B;;;0

I do know when I login to the page the header changes to this
https://lvlxxxxxxxdu/profile/#!/ after I login

Re: Iam I dong this correctly for check_http

Posted: Wed Feb 09, 2022 6:33 pm
by ssax
You'll always want to use -f follow so that it follows the redirects to the final page, you would only want -f ok if you are checking the redirect.

Try this one and let us know the results:

Code: Select all

./check_http -H lvl2.XXXXXXXXXedu -s "Email" -f follow -I 1X.X.X.X4 -u '/profile' -S --sni -p 443 -a username:pass -v

Re: Iam I dong this correctly for check_http

Posted: Thu Feb 10, 2022 5:50 am
by btayl
./check_http -H lvxxxxxxxdu -s "Email" -f follow -I 1xxxxxx4 -u '/profile' -S --sni -p 443 -a username:pass -v
bash: ./check_http: Permission denied

Re: Iam I dong this correctly for check_http

Posted: Thu Feb 10, 2022 5:28 pm
by gsmith
As the root user please try:

Code: Select all

/usr/local/nagios/libexec/check_http -H lvlxxxxdu -s "Email" -f follow -I 14x.x.x.x4 -u '/profile' -S --sni -p 443 -a username:pass -v
Thanks

Re: Iam I dong this correctly for check_http

Posted: Fri Feb 11, 2022 7:28 am
by btayl
Now I get this

Code: Select all

/usr/local/nagios/libexec/check_http -H lvlXXXXXX.edu -s "Email" -f follow -I 14XXXXXX54 -u '/profile' -S --sni -p 443 -a xxx:xxxx -v

- Removed identifying information but it just shows it connecting and saying ti requires javascript to display which is why the Email string is not found -

HTTP CRITICAL: HTTP/1.1 200 200 - string 'Email' not found on
when I look at in chrome and click inspect I see it
<b>Email Addresses</b>

Re: Iam I dong this correctly for check_http

Posted: Fri Feb 11, 2022 5:55 pm
by ssax
It looks like the remote site uses javascript to display the app, check_http won't process the javascript but it is connecting properly.

Re: Iam I dong this correctly for check_http

Posted: Sat Feb 12, 2022 5:09 pm
by btayl
Is their any plugin to do javascript ?

Re: Iam I dong this correctly for check_http

Posted: Mon Feb 14, 2022 1:46 pm
by ssax
I apologize, there isn't currently an official plugin that processes javascript but I did find this 3rd party one (I haven't personally tried it) that uses Selenium that you can try:
- Please note that if you try this it is not meant to be installed on the XI server, the Selenium/Docker software should be installed on it's own separate server


https://exchange.nagios.org/directory/P ... er/details