{"id":153,"date":"2011-11-24T20:20:00","date_gmt":"2011-11-24T20:20:00","guid":{"rendered":"http:\/\/pheonixsolutions.com\/?p=153"},"modified":"2026-05-07T23:07:56","modified_gmt":"2026-05-07T17:37:56","slug":"working-of-nagios-basic","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/working-of-nagios-basic\/","title":{"rendered":"Working of Nagios &#8211; Basic"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Nagios is a monitoring tool used to track server services, processes, disk usage, users, and system health. It helps administrators identify warnings and critical issues before they impact services or customers.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SSH access to the server<\/li>\n\n\n\n<li>Nagios installed<\/li>\n\n\n\n<li>Basic knowledge of Linux commands and configuration files<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Nagios gives detailed information about the services running on the server. For example:<br>1. Number of processes<br>2. Number of users<br>3. Disk capacity<br>4. Other configured services<\/li>\n\n\n\n<li>We can configure Nagios to display the following:<br>1. Unknown alerts<br>2. Warning alerts<br>3. Critical alerts<\/li>\n\n\n\n<li>These alerts are generated based on the configuration defined in the Nagios setup file.<\/li>\n\n\n\n<li>In the event of a service failure, Nagios can alert administrators immediately, allowing remediation before outages affect users or business operations.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">To Check the Nagios Configuration File<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:<\/strong><br>SSH into the server.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2:<\/strong><br>The Nagios configuration file is located at:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/usr\/local\/nagios\/etc\/nrpe.cfg<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the file using:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">vi \/usr\/local\/nagios\/etc\/nrpe.cfg<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3:<\/strong><br>The <code>nrpe.cfg<\/code> file contains all configured Nagios service checks and the locations of their scripts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example configuration:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">================================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">command[check_users]=\/usr\/local\/nagios\/libexec\/check_users -w 5 -c 10<br>command[check_load]=\/usr\/local\/nagios\/libexec\/check_load -w 2,4,8 -c 4,6,8<br>command[check_disk]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/sda<br>command[check_zombie_procs]=\/usr\/local\/nagios\/libexec\/check_procs -w 5 -c 10 -s Z<br>command[check_total_procs]=\/usr\/local\/nagios\/libexec\/check_procs -w 380 -c 430<br>command[check_smart_sda]=\/usr\/local\/nagios\/libexec\/check_ide_smart -d \/dev\/sda -n<br>command[check_smart_sdb]=\/usr\/local\/nagios\/libexec\/check_ide_smart -d \/dev\/sdb -n<br>command[check_var]=\/usr\/local\/nagios\/libexec\/check_disk -w 10% -c 5% -p \/dev\/sda2<br>command[check_tmp]=\/usr\/local\/nagios\/libexec\/check_disk -w 10% -c 5% -p \/dev\/sda5<br>command[check_root]=\/usr\/local\/nagios\/libexec\/check_disk -w 10% -c 5% -p \/dev\/sda1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">================================================<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These are example services configured on the server. The location of the script for each command is also specified.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Note<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>-w \u2192 Indicates warning level<\/li>\n\n\n\n<li>-c \u2192 Indicates critical level<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Example Explanation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">command[check_users]=\/usr\/local\/nagios\/libexec\/check_users -w 5 -c 10<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This command tells Nagios to monitor the number of users on the server.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If the number of users reaches 5, Nagios shows a warning.<\/li>\n\n\n\n<li>If the number of users reaches 10, Nagios shows a critical alert.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The check_users comand works based on the script located at<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/usr\/local\/nagios\/libexec\/check_users<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The script can be modified according to requirements.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Nagios helps administrators monitor server health, detect issues early, and configure warning and critical thresholds for various services using the nrpe.cfg configuration file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Nagios is a monitoring tool used to track server services, processes, disk usage, users, and system health. It helps [&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_feature_clip_id":0,"_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":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-2t","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/153","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=153"}],"version-history":[{"count":4,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":10136,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions\/10136"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}