Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_http_curl.sh
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
If the string is not found it throws out an error and Nagios exit is set to 'critical'.
Save plugin in $USER1$ dir, in my case (Ubuntu 12.04) it is:
/usr/lib/nagios/plugins
and make it executable.
Command definition:
/etc/nagios3/commands.cfg:
...
# Check HTTP
define command{
command_name check_http_curl
command_line $USER1$/check_http_curl.sh $HOSTNAME$ $HOSTNOTES$
}
Hosts definition:
$HOSTNOTES$ is the string that the plugin will search in the web page source.
/etc/nagios3/conf.d/generic-host_nagios2.cfg
...
define host{
host_name www.site1.org
checks_enabled 0
use generic-host
notes https://www.facebook.com/site1
}
define host{
host_name www.site2.org
checks_enabled 0
use generic-host
notes info@site2.org
}
Group definition:
/etc/nagios3/conf.d/hostgroups_nagios2.cfg
...
# Web Sites
define hostgroup {
hostgroup_name web-sites
alias Web Sites
members www.site1.org,www.site2.org
}
Service definition:
/etc/nagios3/conf.d/services_nagios2.cfg
...
define service {
hostgroup_name web-sites
service_description WWW
check_command check_http_curl
use generic-service
notes Check if site is really down.
}
/usr/lib/nagios/plugins
and make it executable.
Command definition:
/etc/nagios3/commands.cfg:
...
# Check HTTP
define command{
command_name check_http_curl
command_line $USER1$/check_http_curl.sh $HOSTNAME$ $HOSTNOTES$
}
Hosts definition:
$HOSTNOTES$ is the string that the plugin will search in the web page source.
/etc/nagios3/conf.d/generic-host_nagios2.cfg
...
define host{
host_name www.site1.org
checks_enabled 0
use generic-host
notes https://www.facebook.com/site1
}
define host{
host_name www.site2.org
checks_enabled 0
use generic-host
notes info@site2.org
}
Group definition:
/etc/nagios3/conf.d/hostgroups_nagios2.cfg
...
# Web Sites
define hostgroup {
hostgroup_name web-sites
alias Web Sites
members www.site1.org,www.site2.org
}
Service definition:
/etc/nagios3/conf.d/services_nagios2.cfg
...
define service {
hostgroup_name web-sites
service_description WWW
check_command check_http_curl
use generic-service
notes Check if site is really down.
}
Reviews (0)
Be the first to review this listing!