{"id":996,"date":"2011-05-01T18:20:31","date_gmt":"2011-05-01T10:20:31","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=996"},"modified":"2023-06-24T16:27:26","modified_gmt":"2023-06-24T16:27:26","slug":"how-to-install-and-configure-nagios-nrpe","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-and-configure-nagios-nrpe\/","title":{"rendered":"How to Install and Configure Nagios NRPE"},"content":{"rendered":"<p>In network and services monitoring, Nagios Core stands as a prominent tool. However, to further enhance its capabilities, we introduce Nagios Remote Plugin Executor (NRPE). NRPE is an agent that allows Nagios plugins to be executed remotely on other Linux\/Unix machines. It can also communicate with Windows agent addons like NSClient++, enabling monitoring of resources such as disk usage, CPU load, and more.<\/p>\n<p>This guide will walk you through the process of installing and configuring Nagios NRPE on your Nagios server.<\/p>\n<h2>Installation Steps<\/h2>\n<h3>Step 1: Install Nagios NRPE and Nagios-devel<\/h3>\n<p>Nagios-devel comprises header files, libraries, and development documentation for Nagios. To install Nagios NRPE and Nagios-devel, use the following command:<\/p>\n<pre>\r\n[root@server ~]# yum --enablerepo=rpmforge install nagios-nrpe nagios-devel\r\n<\/pre>\n<p>This command will resolve dependencies and install the necessary packages.<\/p>\n<p>Example:<\/p>\n<pre>[root@server ~]# yum --enablerepo=rpmforge install nagios-nrpe nagios-devel\r\nLoaded plugins: fastestmirror\r\nLoading mirror speeds from cached hostfile\r\n * addons: ossm.utm.my\r\n * base: ossm.utm.my\r\n * epel: ftp.cuhk.edu.hk\r\n * extras: ossm.utm.my\r\n * rpmforge: fr2.rpmfind.net\r\n * updates: ossm.utm.my\r\nSetting up Install Process\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package nagios-devel.i386 0:3.2.3-3.el5.rf set to be updated\r\n---&gt; Package nagios-nrpe.i386 0:2.12-1.el5.rf set to be updated\r\n--&gt; Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n=====================================================================================\r\n Package               Arch          Version                 Repository         Size\r\n=====================================================================================\r\nInstalling:\r\n nagios-devel          i386          3.2.3-3.el5.rf          rpmforge           42 k\r\n nagios-nrpe           i386          2.12-1.el5.rf           rpmforge           35 k\r\n\r\nTransaction Summary\r\n=====================================================================================\r\nInstall       2 Package(s)\r\nUpgrade       0 Package(s)\r\n\r\nTotal download size: 76 k\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\n(1\/2): nagios-nrpe-2.12-1.el5.rf.i386.rpm                     |  35 kB     00:00\r\n(2\/2): nagios-devel-3.2.3-3.el5.rf.i386.rpm                   |  42 kB     00:00\r\n-------------------------------------------------------------------------------------\r\nTotal                                                 23 kB\/s |  76 kB     00:03\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Installing     : nagios-nrpe                                                   1\/2\r\n  Installing     : nagios-devel                                                  2\/2\r\n\r\nInstalled:\r\n  nagios-devel.i386 0:3.2.3-3.el5.rf         nagios-nrpe.i386 0:2.12-1.el5.rf\r\n\r\nComplete!\r\n<\/pre>\n<h3>Step 2: Set NRPE to Start at Boot and Start NRPE<\/h3>\n<p>To ensure NRPE starts automatically at boot, use the following command:<\/p>\n<pre>\r\n[root@server ~]# chkconfig nrpe on\r\n<\/pre>\n<p>To start NRPE, use the following command:<\/p>\n<pre>\r\n[root@server ~]# \/etc\/init.d\/nrpe start\r\n\r\n...\r\n\r\nStarting Nagios NRPE daemon (nrpe):                        [  OK  ]\r\n<\/pre>\n<h3>Step 3: Update \/etc\/services<\/h3>\n<p>Add the following line at the bottom of the \/etc\/services file:<\/p>\n<pre>\r\n[root@server ~]# vi \/etc\/services\r\nnrpe 5666\/tcp # NRPE\r\n<\/pre>\n<h3>Step 4: Test NRPE Daemon Install<\/h3>\n<p>To verify that the NRPE daemon has been installed correctly, use the following command:<\/p>\n<pre>\r\n[root@server ~]# netstat -at |grep nrpe\r\n<\/pre>\n<p>If the installation was successful, you should see output similar to the following:<\/p>\n<pre>\r\ntcp        0      0 server.intranet.local:nrpe  *:*                         LISTEN\r\n<\/pre>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">yum &#8211;enablerepo=rpmforge install nagios-nrpe nagios-devel<\/span> \u2013 Installs Nagios NRPE and Nagios-devel<\/li>\n<li><span class=\"fw-bold\">chkconfig nrpe on<\/span> \u2013 Sets NRPE to start at boot<\/li>\n<li><span class=\"fw-bold\">\/etc\/init.d\/nrpe start<\/span> \u2013 Starts NRPE<\/li>\n<li><span class=\"fw-bold\">vi \/etc\/services<\/span> \u2013 Opens the \/etc\/services file for editing<\/li>\n<li><span class=\"fw-bold\">netstat -at |grep nrpe<\/span> \u2013 Checks if NRPE daemon is installed and running<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Nagios NRPE is a powerful tool that enhances the capabilities of Nagios Core by allowing remote execution of Nagios plugins on other Linux\/Unix machines.<\/p>\n<p>This tutorial has provided you with step-by-step instructions on how to install and configure Nagios NRPE on your Nagios server. By following these steps, you can effectively monitor resources such as disk usage, CPU load, and more on your network. For more in-depth information on various web servers, you can explore our articles on <a href=\"https:\/\/webhostinggeeks.com\/best\/web-server\/\">best web servers<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/apache-http-server-explained\/\">Apache<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/nginx-server-explained\/\">Nginx<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/litespeed-web-server-explained\/\">LiteSpeed<\/a>. If you&#8217;re interested in different hosting options, we also have articles on <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-dedicated-server-hosting\/\">dedicated server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-vps-hosting\/\">VPS server<\/a>, <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-cloud-hosting\/\">cloud hosting<\/a>, and <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-shared-hosting\/\">shared hosting<\/a>.<\/p>\n<p>Remember, the key to effective network and services monitoring lies in the proper installation and configuration of your tools. <\/p>\n<h2>FAQ<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is Nagios NRPE?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Nagios NRPE, or Nagios Remote Plugin Executor, is an agent that allows Nagios plugins to be executed remotely on other Linux\/Unix machines. It can also communicate with Windows agent addons like NSClient++, enabling monitoring of resources such as disk usage, CPU load, and more.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is Nagios-devel?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Nagios-devel comprises header files, libraries, and development documentation for Nagios. It is necessary for the installation and functioning of Nagios NRPE.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I start NRPE?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can start NRPE by using the command &#8220;\/etc\/init.d\/nrpe start&#8221;. This command initiates the Nagios NRPE daemon.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I set NRPE to start at boot?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can set NRPE to start at boot by using the command &#8220;chkconfig nrpe on&#8221;. This ensures that NRPE automatically starts whenever your server boots up.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">How do I verify that NRPE is installed and running?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can verify that NRPE is installed and running by using the command &#8220;netstat -at |grep nrpe&#8221;. If NRPE is running, this command will return output indicating that the NRPE daemon is listening.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In network and services monitoring, Nagios Core stands as a prominent tool. However, to further enhance its capabilities, we introduce Nagios Remote Plugin Executor (NRPE). NRPE is an agent that&#8230;<\/p>\n","protected":false},"author":6,"featured_media":961,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1010,1065],"tags":[1246,1536,1591],"class_list":["post-996","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nagios","category-system-administration","tag-centos-5-5","tag-linux","tag-nagios"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=996"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/996\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/961"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}