====== Background ====== HttpMonitor utilizes the HTTP protocol to test the connection and timing between a webserver (Device) and client (HttpMonitor). ====== Options ====== {{technology:zenoss:about:httpmonitor.png?424×506}} The following list items explain the various fields in the httpmonitor datasource * Name * Arbitrary title given to data source * Source Type * This is not an option. In our case, it is the HttpMonitor Type. This field defines what category of data is being worked on. You may see others like "SNMP", or "DNSMonitor" * Enabled * You can use this to turn on/off this data source. This may be useful if you want to turn off the functionality of the data source, but don't want to delete it. This makes for an easy process to turn the data source back on, in the future. * Component * Events that happen will get this component (like eth0, httpd, etc) * Event Class * Which Event Class any events will belong to, if they happen. Different from Device Classes * Event Key * If a component needs further deduplication specification this field may be used. Deduplication is when an event is determined if it is the same as another event, and therefore classified as the same or separate event. * Severity * Original severity of events that this source cause * Timeout (seconds) * Amount of time that can go by, before the transaction is labeled as not happening (timed out) * Cycle Time (seconds) * Time between re-runs of HttpMonitor, defaults to 300 seconds * Host Name * This is the domain of the website that you want to check. Enter a Fully Qualified Domain Name (FQDN), ex: host.zenoss.com; This field defaults to ${dev/id}, which references the current devices ID. If you reference the current devices ID, and it is not a domain name, HttpMonitor will not work properly. * IP Address * IP to use if needed, eg: 124.12.56.123; defaults to use zope object ${dev/manageIp}, which references the current devices IP address * Port * If you have web server running on non-standard port (ex: Zenoss runs 8080 by default) * Use SSL * HTTPS for secure, encrypted webpages * Url * Usually the directory and file names after the host name * Ex: You have already defined http://host.zenoss.com above * inserting a / is just the root * inserting /vm1/insert.php will interpret as http://host.zenoss.com/vm1/insert.php * Regular Expression * Uses PCRE regular expression syntax to find the regex on the page loaded * If not found, throws error of level 'Severity' set above * See http://nickyeates.com/technology/zenoss/about/regex * Case Sensitive * Does regex care about upper and lower case when searching for string? * Invert Expression * Negates Regex logic. * If regex found, throws error * Basic Auth User * If webpage requires basic login authentication * Basic Auth Password * See above * Redirect Behavior * If page visited, trys to redirect, what is done? ====== check_http documentation ====== $ZENHOME/libexec/check_http --help check_http (nagios-plugins 1.4.5) 1.96 Copyright (c) 1999 Ethan Galstad Copyright (c) 1999-2006 Nagios Plugin Development Team This plugin tests the HTTP service on the specified host. It can test normal (http) and secure (https) servers, follow redirects, search for strings and regular expressions, check connection times, and report on certificate expiration times. Usage: check_http -H | -I [-u ] [-p ] [-w ] [-c ] [-t ] [-L] [-a auth] [-f ] [-e ] [-s string] [-l] [-r | -R ] [-P string] [-m :] [-4|-6] [-N] [-M ] [-A string] [-k string] NOTE: One or both of -H and -I must be specified Options: -h, --help Print detailed help screen -V, --version Print version information -H, --hostname=ADDRESS Host name argument for servers using host headers (virtual host) Append a port to include it in the header (eg: example.com:5000) -I, --IP-address=ADDRESS IP address or name (use numeric address if possible to bypass DNS lookup). -p, --port=INTEGER Port number (default: 80) -4, --use-ipv4 Use IPv4 connection -6, --use-ipv6 Use IPv6 connection -S, --ssl Connect via SSL -C, --certificate=INTEGER Minimum number of days a certificate has to be valid. (when this option is used the url is not checked.) -e, --expect=STRING String to expect in first (status) line of server response (default: HTTP/1. If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing) -s, --string=STRING String to expect in the content -u, --url=PATH URL to GET or POST (default: /) URL to GET or POST (default: /) ,-P, --post=STRING URL encoded http POST data -N, --no-body Don't wait for document body: stop reading after headers. (Note that this still does an HTTP GET or POST, not a HEAD.) -M, --max-age=SECONDS Warn if document is more than SECONDS old. the number can also be of the form "10m" for minutes, "10h" for hours, or "10d" for days. -T, --content-type=STRING specify Content-Type header media type when POSTing -l, --linespan Allow regex to span newlines (must precede -r or -R) -r, --regex, --ereg=STRING Search page for regex STRING -R, --eregi=STRING Search page for case-insensitive regex STRING --invert-regex Return CRITICAL if found, OK if not -a, --authorization=AUTH_PAIR Username:password on sites with basic authentication -A, --useragent=STRING String to be sent in http header as "User Agent" -k, --header=STRING Any other tags to be sent in http header. Use multiple times for additional headers -L, --link=URL Wrap output in HTML link (obsoleted by urlize) -f, --onredirect= How to handle redirected pages -m, --pagesize=INTEGER<:INTEGER> Minimum page size required (bytes) : Maximum page size required (bytes) -w, --warning=DOUBLE Response time to result in warning status (seconds) -c, --critical=DOUBLE Response time to result in critical status (seconds) -t, --timeout=INTEGER Seconds before connection times out (default: 10) -v, --verbose Show details for command-line debugging (Nagios may truncate output) Notes: This plugin will attempt to open an HTTP connection with the host. Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL other errors return STATE_UNKNOWN. Successful connects, but incorrect reponse messages from the host result in STATE_WARNING return values. If you are checking a virtual server that uses 'host headers' you must supply the FQDN (fully qualified domain name) as the [host_name] argument. This plugin can also check whether an SSL enabled web server is able to serve content (optionally within a specified time) or whether the X509 certificate is still valid for the specified number of days. Examples: CHECK CONTENT: check_http -w 5 -c 10 --ssl www.verisign.com When the 'www.verisign.com' server returns its content within 5 seconds, a STATE_OK will be returned. When the server returns its content but exceeds the 5-second threshold, a STATE_WARNING will be returned. When an error occurs, a STATE_CRITICAL will be returned. CHECK CERTIFICATE: check_http www.verisign.com -C 14 When the certificate of 'www.verisign.com' is valid for more than 14 days, a STATE_OK is returned. When the certificate is still valid, but for less than 14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when the certificate is expired. Send email to nagios-users@lists.sourceforge.net if you have questions regarding use of this software. To submit patches or suggest improvements, send email to nagiosplug-devel@lists.sourceforge.net