Help - check_http plugin

Sara Gangale s.gangale at twt.it
Mon Jan 26 16:57:55 CET 2015


Good Morning,

I’m currently implementing a Centreon server to monitor all our infrastructure (virtual and physical servers both windows and linux, host esx, network equipment and so on).

I’m trying to use the check_http plugin to monitor a web page and I’d like the plugin to behave as follows:

-          Opens an URL

-          Sends username and password when asked

-          On the returned page check for content (a string contained in the HTTP answer)

 

Everything works fine if I don’t follow redirects, so I’m able to grep a string in the first HTTPS response using the following command (sensitive data are hidden for obvious reasons):

 

[root at centreon plugins]# ./check_http -H “hostname” -u “uri” -s "string1" -f follow

HTTP OK: HTTP/1.1 200 OK - 38209 bytes in 0.022 second response time |time=0.021580s;;;0.000000 size=38209B;;;0

 

If I authenticate and set –f follow in order to follow the redirect, something goes wrong: I’m able to grep strings in the login page, and not in what is shown AFTER the authentication:

 

[root at centreon plugins]# ./check_http -H “hostname” -u “uri” -s "string2" -f follow -a username:password

HTTP OK: HTTP/1.1 200 OK - 38209 bytes in 0.030 second response time |time=0.029502s;;;0.000000 size=38209B;;;0

 

[root at centreon plugins]# ./check_http -H “hostname” -u “uri” -s "string2" -f follow -a username:password

HTTP CRITICAL: HTTP/1.1 200 OK - string ‘string2’ not found on 'http://hostname:port/uri' - 38209 bytes in 0.028 second response time |time=0.027837s;;;0.000000 size=38209B;;;0

 

Of course string1 is something that you can find in login page, string 2 is something you can find after the login.

 

I don’t know if I’m not authenticating (but username and password are working and there’s no LDAP involved) or if I’m not following the redirect, because in the error I can see that the uri is always the same (HTTP CRITICAL: HTTP/1.1 200 OK - string ‘string2’ not found on 'http://hostname:port/uri').

 

How can I proceed? Is there a way to debug this?

Thanks 

 

Sara Gangale

System Analyst

 

TWT S.p.A.

Viale Jenner, 33 - 20159 Milano - Italy

Tel +39-02-89089.288 - Fax +39-02-89089.211

Mobile +39-3371158367

E-mail: s.gangale at twt.it - Web: http://www.twt.it

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20150126/aee94193/attachment.html>


More information about the Devel mailing list