{"id":960,"date":"2011-04-24T19:36:00","date_gmt":"2011-04-24T11:36:00","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=960"},"modified":"2023-04-28T09:50:27","modified_gmt":"2023-04-28T09:50:27","slug":"how-to-install-nagios-on-centos-5-5","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-install-nagios-on-centos-5-5\/","title":{"rendered":"How to Install Nagios on CentOS 5.5"},"content":{"rendered":"<p><a href=\"https:\/\/www.nagios.org\/\" rel=\"nofollow noopener\" target=\"_blank\">Nagios<\/a> is a popular open source system and network monitoring software application. It monitor hosts and services and then alerting users when something wrong has been triggered. It is the powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes. Below is the steps to install Nagios on CentOS 5.5 server. This tutorial assume that you already installed LAMP (Linux CentOS, Apache, Mysql and PHP) server.<\/p>\n<p><strong>Prerequisites<\/strong><br \/>\n<a href=\"https:\/\/webhostinggeeks.com\/howto\/how-to-install-apache-httpd-web-server-on-linux\/\" rel=\"nofollow noopener\" target=\"_blank\">How to Install Apache Httpd Web Server on Linux<\/a><br \/>\nInstall or updates the prerequisites. Make sure that all of these packages already installed and properly configured.<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# yum -y --enablerepo=rpmforge install httpd php gcc glibc glibc-common gd gd-devel\n<\/pre>\n<\/ol>\n<p><strong>Steps :<\/strong><br \/>\n1. Download and install the rpmforge repository.<\/p>\n<p>For x86 (32-bit) systems<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# rpm -Uhv http:\/\/apt.sw.be\/redhat\/el5\/en\/i386\/rpmforge\/RPMS\/rpmforge-release-0.5.2-2.el5.rf.i386.rpm\n<\/pre>\n<\/ol>\n<p>For x64 (64-bit) systems<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# rpm -Uhv http:\/\/apt.sw.be\/redhat\/el5\/en\/x86_64\/rpmforge\/RPMS\/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm\n<\/pre>\n<\/ol>\n<p>2. Install Nagios and Plugins using yum command<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# yum -y --enablerepo=rpmforge install nagios nagios-plugins nagios-plugins-setuid\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n* addons: centos.maulvi.net\n* base: centos.maulvi.net\n* epel: ftp.cuhk.edu.hk\n* extras: centos.maulvi.net\n* rpmforge: fr2.rpmfind.net\n* updates: mirror.yourconnect.com\nSetting up Install Process\nResolving Dependencies\n--&gt; Running transaction check\n---&gt; Package nagios.i386 0:3.2.3-3.el5.rf set to be updated\n---&gt; Package nagios-plugins.i386 0:1.4.15-2.el5.rf set to be updated\n--&gt; Processing Dependency: fping for package: nagios-plugins\n--&gt; Processing Dependency: perl(Net::SNMP) for package: nagios-plugins\n---&gt; Package nagios-plugins-setuid.i386 0:1.4.15-2.el5.rf set to be updated\n--&gt; Running transaction check\n---&gt; Package fping.i386 0:2.4b2-7.el5 set to be updated\n---&gt; Package perl-Net-SNMP.noarch 0:5.2.0-1.2.el5.rf set to be updated\n--&gt; Processing Dependency: perl(Crypt::DES) for package: perl-Net-SNMP\n--&gt; Running transaction check\n---&gt; Package perl-Crypt-DES.i386 0:2.05-3.2.el5.rf set to be updated\n--&gt; Finished Dependency Resolution\n\nDependencies Resolved\n\n=====================================================================================\nPackage                    Arch        Version                  Repository     Size\n=====================================================================================\nInstalling:\nnagios                     i386        3.2.3-3.el5.rf           rpmforge      3.7 M\nnagios-plugins             i386        1.4.15-2.el5.rf          rpmforge      1.6 M\nnagios-plugins-setuid      i386        1.4.15-2.el5.rf          rpmforge      122 k\nInstalling for dependencies:\nfping                      i386        2.4b2-7.el5              epel           30 k\nperl-Crypt-DES             i386        2.05-3.2.el5.rf          rpmforge       37 k\nperl-Net-SNMP              noarch      5.2.0-1.2.el5.rf         rpmforge       96 k\n\nTransaction Summary\n=====================================================================================\nInstall       6 Package(s)\nUpgrade       0 Package(s)\n\nTotal download size: 5.6 M\nDownloading Packages:\n(1\/6): fping-2.4b2-7.el5.i386.rpm                             |  30 kB     00:02\n(2\/6): perl-Crypt-DES-2.05-3.2.el5.rf.i386.rpm                |  37 kB     00:00\n(3\/6): perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch.rpm              |  96 kB     00:02\n(4\/6): nagios-plugins-setuid-1.4.15-2.el5.rf.i386.rpm         | 122 kB     00:03\n(5\/6): nagios-plugins-1.4.15-2.el5.rf.i386.rpm                | 1.6 MB     00:28\n(6\/6): nagios-3.2.3-3.el5.rf.i386.rpm                         | 3.7 MB     01:07\n-------------------------------------------------------------------------------------\nTotal                                                 53 kB\/s | 5.6 MB     01:48\nRunning rpm_check_debug\nRunning Transaction Test\nFinished Transaction Test\nTransaction Test Succeeded\nRunning Transaction\nInstalling     : fping                                                         1\/6\nInstalling     : perl-Crypt-DES                                                2\/6\nInstalling     : nagios-plugins-setuid                                         3\/6\nInstalling     : nagios                                                        4\/6\nInstalling     : perl-Net-SNMP                                                 5\/6\nInstalling     : nagios-plugins                                                6\/6\n\nInstalled:\nnagios.i386 0:3.2.3-3.el5.rf                 nagios-plugins.i386 0:1.4.15-2.el5.rf\nnagios-plugins-setuid.i386 0:1.4.15-2.el5.rf\n\nDependency Installed:\nfping.i386 0:2.4b2-7.el5                   perl-Crypt-DES.i386 0:2.05-3.2.el5.rf\nperl-Net-SNMP.noarch 0:5.2.0-1.2.el5.rf\n\nComplete!\n<\/pre>\n<\/ol>\n<p>3. Create the default Nagios user and set a password using htpasswd:<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# htpasswd -c \/etc\/nagios\/htpasswd.users nagiosadmin\nNew password:\nRe-type new password:\nAdding password for user nagiosadmin\n<\/pre>\n<\/ol>\n<p>4. Verify default config files using below command :<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# nagios -v \/etc\/nagios\/nagios.cfg\n\nNagios Core 3.2.3\nCopyright (c) 2009-2010 Nagios Core Development Team and Community Contributors\nCopyright (c) 1999-2009 Ethan Galstad\nLast Modified: 10-03-2010\nLicense: GPL\n\nWebsite: http:\/\/www.nagios.org\nReading configuration data...\nRead main config file okay...\nProcessing object config file '\/etc\/nagios\/objects\/commands.cfg'...\nProcessing object config file '\/etc\/nagios\/objects\/contacts.cfg'...\nProcessing object config file '\/etc\/nagios\/objects\/timeperiods.cfg'...\nProcessing object config file '\/etc\/nagios\/objects\/templates.cfg'...\nProcessing object config file '\/etc\/nagios\/objects\/localhost.cfg'...\nRead object config files okay...\n\nRunning pre-flight check on configuration data...\n\nChecking services...\nChecked 8 services.\nChecking hosts...\nChecked 1 hosts.\nChecking host groups...\nChecked 1 host groups.\nChecking service groups...\nChecked 0 service groups.\nChecking contacts...\nChecked 1 contacts.\nChecking contact groups...\nChecked 1 contact groups.\nChecking service escalations...\nChecked 0 service escalations.\nChecking service dependencies...\nChecked 0 service dependencies.\nChecking host escalations...\nChecked 0 host escalations.\nChecking host dependencies...\nChecked 0 host dependencies.\nChecking commands...\nChecked 24 commands.\nChecking time periods...\nChecked 5 time periods.\nChecking for circular paths between hosts...\nChecking for circular host and service dependencies...\nChecking global event handlers...\nChecking obsessive compulsive processor commands...\nChecking misc settings...\n\nTotal Warnings: 0\nTotal Errors:   0\n\nThings look okay - No serious problems were detected during the pre-flight check\n<\/pre>\n<\/ol>\n<p>5. Configure nagiso service to start at boot<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# chkconfig nagios on\n<\/pre>\n<\/ol>\n<p>6. Start the nagios service<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# \/etc\/init.d\/nagios start\nnagios is stopped\nStarting nagios:                                           [  OK  ]\n<\/pre>\n<\/ol>\n<p>7. Restart apache server<\/p>\n<ol>\n<pre class=\"code\">[root@server ~]# \/etc\/init.d\/httpd restart\nStopping httpd:                                            [  OK  ]\nStarting httpd:                                            [  OK  ]\n<\/pre>\n<\/ol>\n<p>8. To login, navigate your browser to http:\/\/servername\/nagios<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nagios is a popular open source system and network monitoring software application. It monitor hosts and services and then alerting users when something wrong has been triggered. It is the&#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-960","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\/960","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=960"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/960\/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=960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}