{"id":1617,"date":"2015-11-20T20:47:00","date_gmt":"2015-11-21T02:47:00","guid":{"rendered":"http:\/\/www.supportpro.com\/blog\/?p=1617"},"modified":"2026-03-27T00:52:51","modified_gmt":"2026-03-27T06:52:51","slug":"url-monitoring-with-nagios","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/url-monitoring-with-nagios\/","title":{"rendered":"How to Monitor Website URLs Using Nagios check_http Command ?"},"content":{"rendered":"\n<p>Monitoring a web server alone does not always guarantee that a website is functioning correctly. A service like Apache may appear online while the website itself displays errors, malicious content, or broken pages.<\/p>\n\n\n\n<p><strong>Nagios URL monitoring<\/strong> solves this issue by checking the actual webpage content instead of simply verifying whether the web service is running.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Nagios URL Monitoring Capabilities<\/strong><\/h2>\n\n\n\n<p>Nagios provides advanced monitoring features for web services, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Complete monitoring of <strong>HTTP and HTTPS URLs<\/strong><\/li>\n\n\n\n<li>Full web transaction monitoring<\/li>\n\n\n\n<li>Keyword-based webpage validation<\/li>\n\n\n\n<li>Performance and availability tracking<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Benefits of URL Monitoring with Nagios<\/strong><\/h2>\n\n\n\n<p>Implementing URL monitoring helps administrators:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Improve server and application availability<\/li>\n\n\n\n<li>Detect network outages quickly<\/li>\n\n\n\n<li>Identify protocol or service failures<\/li>\n\n\n\n<li>Monitor real user website experience<\/li>\n\n\n\n<li>Track web server performance<\/li>\n\n\n\n<li>Detect hacked or modified webpages<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Monitoring a Website URL Using check_http<\/strong><\/h2>\n\n\n\n<p>Nagios includes the <strong><code>check_http<\/code><\/strong> plugin, which allows monitoring of a specific webpage instead of just checking whether Apache is running.<\/p>\n\n\n\n<p>This method is useful when:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A website is hacked or injected with malicious code<\/li>\n\n\n\n<li>PHP or application errors occur<\/li>\n\n\n\n<li>Pages return unexpected content<\/li>\n<\/ul>\n\n\n\n<p>You can configure Nagios to verify whether a specific keyword exists on a webpage. If the keyword is missing, Nagios reports the service as failed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example Configuration<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>define service{<br>    use                     urlmonitoring-service<br>    host_name               server.supportpro.com<br>    service_description     url_check<br>    check_command           check_http!-H supportpro.com -t 30 -R \"Cpanel and WHM\" -f follow<br>}<\/code><\/pre>\n\n\n\n<p>This configuration checks whether the phrase <strong>\u201cCpanel and WHM\u201d<\/strong> exists on the webpage.<br>If the page fails to load or the keyword is missing, Nagios triggers an alert.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Monitoring HTTPS (SSL\/TLS) URLs<\/strong><\/h2>\n\n\n\n<p>For websites using SSL certificates, include the <code>--ssl<\/code> option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define service{<br>    use                     urlmonitoring-service<br>    host_name               server.supportpro.com<br>    service_description     url_check<br>    check_command           check_http!-H supportpro.com -t 30 -R \"Cpanel and WHM\" -f follow --ssl<br>}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Monitoring Password-Protected Pages<\/strong><\/h2>\n\n\n\n<p>If a webpage is protected using <strong>HTTP authentication<\/strong>, credentials must be provided.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define service{<br>    use                     urlmonitoring-service<br>    host_name               server.supportpro.com<br>    service_description     url_check_protected<br>    check_command           check_http!-H supportpro.com -a user:password -t 30 -R \"Cpanel and WHM\" -f follow --ssl<br>}<\/code><\/pre>\n\n\n\n<p>Replace <code>user:password<\/code> with valid authentication credentials.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Creating a Service Template<\/strong><\/h2>\n\n\n\n<p>Ensure the monitoring template exists in your Nagios configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define service{<br>        name                    urlmonitoring-service<br>        max_check_attempts      5<br>        check_interval          15<br>        retry_interval          2<br>        check_period            24x7<br>        notification_interval   30<br>        notification_period     24x7<br>        register                0<br>}<\/code><\/pre>\n\n\n\n<p>This template defines monitoring intervals, retry attempts, and notification settings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Nagios URL monitoring provides deeper insight into website health by validating actual page content rather than only service availability. Using the <code>check_http<\/code> plugin helps quickly detect downtime, application errors, security issues, and performance problems.<\/p>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<p class=\"has-text-align-center\"><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><\/a><\/span><\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Partner with <strong>SupportPRO<\/strong> for 24\/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.<\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Monitoring a web server alone does not always guarantee that a website is functioning correctly. A service like Apache may appear online while the website itself displays errors, malicious content,&hellip;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-1617","post","type-post","status-publish","format-standard","hentry","category-general-topics"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=1617"}],"version-history":[{"count":5,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1617\/revisions"}],"predecessor-version":[{"id":16757,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1617\/revisions\/16757"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=1617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=1617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=1617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}