Nagios check_http text in page

This is how you can check a word in a webpage with nagios. The nagios server is a CentOS 6.5 64bit.

To test if everything is installed properly check this command on the server:

/usr/lib64/nagios/plugins/check_http -H 10.0.0.200 -p 80 -f follow -u "/login" -s "Forgotten"

“-p” – port

“-u” – custom url address

“-s” – word to check in page

“-S” – to check a https page add -S after the port number (…-p 80 -S …)

The configuration looks like:

define host{
 use linux-server
 host_name amazon-web1
 alias amazon-web1
 address 10.0.0.200
 max_check_attempts 5
 check_period 24x7
 notification_interval 30
 notification_period 24x7
         }
define service {
 use local-service         ; Name of service template to use
 host_name amazon-web1
 service_description HTTP
 check_command check_http!-H10.0.0.200 -f follow -s "Forgotten"
 notifications_enabled 1
        }
Because of the .htaccess file configuration nagios might detect the problem as intermittent and will not send the notification. To help nagios to send the notification, disable flap detection for this service on the nagios web interface
 

Don't forget to restart nagios service after the update.

 

Leave a Reply

Time limit is exhausted. Please reload the CAPTCHA.