{"id":6019,"date":"2020-12-23T18:11:26","date_gmt":"2020-12-23T12:41:26","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6019"},"modified":"2020-12-23T18:11:54","modified_gmt":"2020-12-23T12:41:54","slug":"monitoring-website-using-status-codes-on-nagios","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/monitoring-website-using-status-codes-on-nagios\/","title":{"rendered":"Monitoring website using status codes on Nagios"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Please find the below steps to monitor the website using status codes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nagios supports monitoring the website using status coodes and there is a command in \/etc\/nagios-plugins\/config\/http.cfg . <br><strong>Example:-<\/strong> We can use a command like below to monitor a URL like https:\/\/domain1.com.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">define command{\n   command_name    check_https_url\n   command_line    \/usr\/local\/nagios\/libexec\/check_http -H domain1.com -e 200,301,302\n}<\/span>\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To add the comnmand to Nagios create a file named https_url.cfg in \/etc\/nagios-plugins\/config\/ with the above code (and reload nagios server).<br><br>To use the check_https_url add the code below to the host configuration file. For example (in \/etc\/nagios3\/conf.d\/server.cfg)<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"has-inline-color has-vivid-cyan-blue-color\">define service {\n    host_name           domain1.com\n    service_description WEB SERVICE\n    check_command       check_https_url!8243!\/services\/echo%3Fwsdl2\n    use                 generic-service\n}<\/span>\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Please find the below steps to monitor the website using status codes. Nagios supports monitoring the website using status coodes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[347,346,795,796],"class_list":["post-6019","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-monitoring","tag-nagios","tag-status-codes","tag-website","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1z5","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6019"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6019\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}