Help - check_http plugin

Sara Gangale <[email protected]>
Newsgroups gmane.network.nagios.devel,gmane.network.monitoring.plugins.devel
Organization TWT
Message-ID <[email protected]>
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@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@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@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: [email protected] - Web: http://www.twt.it
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.