{"id":354,"date":"2010-05-14T14:12:25","date_gmt":"2010-05-14T21:12:25","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=354"},"modified":"2010-05-14T14:12:25","modified_gmt":"2010-05-14T21:12:25","slug":"nagios-installation-procedures-used-on-centos5","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=354","title":{"rendered":"Nagios installation procedures used on CentOS5."},"content":{"rendered":"<p>Ensure that you have the following installed:<br \/>\nhttpd, gcc, glibc, glibc-common, gd, gd-devel<\/p>\n<p>Create accounts and groups.<br \/>\nuseradd -m nagios<br \/>\npasswd nagios<br \/>\ngroupadd nagcmd<br \/>\nusermod -a -G nagcmd nagios<br \/>\nusermod -a -G nagcmd apache<\/p>\n<p>Build nagios from the source.<br \/>\ncd \/usr\/local\/src<br \/>\nDownload nagios and nagios-plugins from http:\/\/www.nagios.org\/download\/ to \/usr\/local\/src.<br \/>\ntar -zxvf nagios-3.0.5.tar.gz<br \/>\ncd nagios-3.0.5<br \/>\n.\/configure  &#8211;with-command-group=nagcmd<br \/>\nmake all 2>&#038;1 | tee MAKEALL.log<br \/>\nmake install 2>&#038;1 | tee MAKEINSTALL.log<br \/>\nmake install-init 2>&#038;1 | tee MAKEINSTALLINIT.log<br \/>\nmake install-config 2>&#038;1 | tee MAKEINSTALLCONFIG.log<br \/>\nmake install-commandmode 2>&#038;1 | tee MAKEINSTALLCOMMANDMODE.log<br \/>\ncd \/usr\/local\/nagios\/etc\/objects\/<br \/>\ncp -rp contacts.cfg contacts.cfg.orig<br \/>\nvi contacts.cfg<br \/>\nhtpasswd -c \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin<br \/>\ncd \/usr\/local\/src\/nagios-3.0.5<br \/>\nmake install-webconf 2>&#038;1 | tee MAKEINSTALLWEBCONF.log<br \/>\nservice httpd restart<br \/>\ncd ..<br \/>\ntar -zxvf nagios-plugins-1.4.13.tar.gz<br \/>\ncd nagios-plugins-1.4.13<br \/>\n.\/configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios<br \/>\nmake 2>&#038;1 | tee MAKE.log<br \/>\nmake install 2>&#038;1 | tee MAKEINSTALL.log<br \/>\nchkconfig &#8211;add nagios<br \/>\nchkconfig nagios on<\/p>\n<p>This is a great way to debug errors in your configuration files:<br \/>\n\/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/p>\n<p>service nagios start<\/p>\n<p>I created configuration files based the template.cfg provided in the distribution in the objects directory.<br \/>\ncd \/usr\/local\/nagios\/etc\/objects\/<\/p>\n<p>You have to make changes to your nagios.cfg file based on any new configuration files you created above.<br \/>\nvi ..\/nagios.cfg<\/p>\n<p>Check your configuration:<br \/>\n\/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/p>\n<p>You have restart nagios whenever you make a change to the configuration files.<br \/>\nservice nagios restart<\/p>\n<p>Installed NSClient on a Windows 2003 server to monitor it in nagios.<br \/>\nhttp:\/\/files.nsclient.org\/x-0.3.x\/NSClient%2B%2B-Win32-0.3.5.msi<br \/>\nEdit nsc.ini.  The file is pretty well documented.<\/p>\n<p>The following is how I installed nrpe on a linux system to allow nagios to monitor it.<br \/>\nInstall nrpe to allow nagios access to system status<br \/>\ncd \/usr\/local\/src<br \/>\nwget http:\/\/internap.dl.sourceforge.net\/sourceforge\/nagios\/nrpe-2.12.tar.gz<br \/>\nuseradd nagios<br \/>\npasswd nagios<br \/>\nwget http:\/\/superb-east.dl.sourceforge.net\/sourceforge\/nagiosplug\/nagios-plugins-1.4.13.tar.gz<br \/>\ntar zxvf nagios-plugins-1.4.13.tar.gz<br \/>\ncd nagios-plugins-1.4.13<br \/>\n.\/configure 2>&#038;1 | tee CONFIGURE.log<br \/>\nmake 2>&#038;1 | tee MAKE.log<br \/>\nmake install 2>&#038;1 | tee MAKEINSTALL.log<br \/>\nchown nagios.nagios \/usr\/local\/nagios<br \/>\nchown -R nagios.nagios \/usr\/local\/nagios\/libexec\/<br \/>\ncd ..<br \/>\ntar zxvf nrpe-2.12.tar.gz<br \/>\ncd nrpe-2.12<br \/>\n.\/configure 2>&#038;1 | tee CONFIGURE.log<br \/>\nmake all 2>&#038;1 | tee MAKEALL.log<br \/>\nmake install-plugin 2>&#038;1 | tee MAKEPLUGIN.log<br \/>\nmake install-daemon 2>&#038;1 | tee MAKEDAEMON.log<br \/>\nmake install-daemon-config 2>&#038;1 | tee MAKEDAEMONCONFIG.log<br \/>\nmake install-xinetd 2>&#038;1 | tee MAKEXINETD.log<br \/>\nvi \/etc\/xinetd.d\/nrpe<br \/>\n&#8230;<br \/>\n        only_from       = 127.0.0.1 192.168.0.3<br \/>\n&#8230;<br \/>\nvi \/etc\/services<br \/>\n&#8230;<br \/>\nnrpe            5666\/tcp                        # NRPE<br \/>\n&#8230;<br \/>\nyum install xinetd<br \/>\nservice xinetd start<br \/>\nnetstat -at | grep nrpe<\/p>\n<p>Verify nrpe is working:<br \/>\n\/usr\/local\/nagios\/libexec\/check_nrpe -H localhost<br \/>\n\/usr\/local\/nagios\/libexec\/check_nrpe -H localhost -c check_users<br \/>\n\/usr\/local\/nagios\/libexec\/check_nrpe -H localhost -c check_load<\/p>\n<p>Add customized commands to support the machine<br \/>\nvi \/usr\/local\/nagios\/etc\/nrpe.cfg<br \/>\n&#8230;<br \/>\n# Customized for this machine<br \/>\ncommand[check_users]=\/usr\/local\/nagios\/libexec\/check_users -w 5 -c 10<br \/>\ncommand[check_load]=\/usr\/local\/nagios\/libexec\/check_load -w 15,10,5 -c 30,25,20<br \/>\ncommand[check_hda1]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/hda1<br \/>\ncommand[check_hda2]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/hda2<br \/>\ncommand[check_hdd1]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/hdd1<br \/>\ncommand[check_hdd2]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/hdd2<br \/>\ncommand[check_hdd5]=\/usr\/local\/nagios\/libexec\/check_disk -w 20% -c 10% -p \/dev\/hdd5<br \/>\ncommand[check_zombie_procs]=\/usr\/local\/nagios\/libexec\/check_procs -w 5 -c 10 -s Z<br \/>\ncommand[check_total_procs]=\/usr\/local\/nagios\/libexec\/check_procs -w 150 -c 200<br \/>\ncommand[check_mailq_timeout]=\/usr\/local\/nagios\/libexec\/check_mailq -M postfix -w 5 -c 15<br \/>\ncommand[check_mailq]=\/usr\/local\/nagios\/libexec\/check_mailq -w 10 -c 20<br \/>\ncommand[check_procs_named]=\/usr\/local\/nagios\/libexec\/check_procs -C named -t 3 -w 1:1<br \/>\n&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ensure that you have the following installed: httpd, gcc, glibc, glibc-common, gd, gd-devel Create accounts and groups. useradd -m nagios passwd nagios groupadd nagcmd usermod -a -G nagcmd nagios usermod -a -G nagcmd apache Build nagios from the source. cd \/usr\/local\/src Download nagios and nagios-plugins from http:\/\/www.nagios.org\/download\/ to \/usr\/local\/src. tar -zxvf nagios-3.0.5.tar.gz cd nagios-3.0.5 .\/configure [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[40,79,78,80,81],"class_list":["post-354","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-centos","tag-installation","tag-nagios","tag-nrpe","tag-nsclient"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354"}],"version-history":[{"count":1,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":355,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions\/355"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}