{"id":193,"date":"2010-06-15T21:57:23","date_gmt":"2010-06-15T20:57:23","guid":{"rendered":"http:\/\/simkin.org\/wordpress\/?p=193"},"modified":"2010-06-15T22:02:40","modified_gmt":"2010-06-15T21:02:40","slug":"nagios-on-ubuntu-81","status":"publish","type":"post","link":"http:\/\/simkin.org\/wordpress\/?p=193","title":{"rendered":"Nagios on Ubuntu 8.1"},"content":{"rendered":"<p>So I thought I&#8217;d try to find oout why my desktop and NAS keep arguing. Nagios. That will help. So I fired-up a spare piece of tin, dropped Ubuntu 8.1 onto it and followed <a href=\"http:\/\/www.thedailyadmin.com\/2009\/03\/how-to-install-nagios-on-ubuntu-linux.html\">some instructions<\/a>. The instructions are a bit out of date so I thought I&#8217;d record how I actually did it in case it helps somebody else.<\/p>\n<p><strong>Ubuntu<\/strong><\/p>\n<p>I assume you have installed it with LAMP to save a lot of farting around. If not, aptitude yourself to a point where you have then come back here.<\/p>\n<p><strong>Compilers and Libraries<\/strong><\/p>\n<p><code>sudo apt-get install build-essential<\/code><\/p>\n<p><code>sudo apt-get install libgd2-xpm-dev<\/code><\/p>\n<p><strong>Nagios<\/strong><\/p>\n<p><code>cd ~<\/code><\/p>\n<p><code>sudo wget http:\/\/downloads.sourceforge.net\/nagios\/nagios-3.1.0.tar.gz?use_mirror=voxel<\/code><\/p>\n<p><code>sudo wget http:\/\/downloads.sourceforge.net\/nagiosplug\/nagios-plugins-1.4.13.tar.gz?use_mirror=voxel<\/code><\/p>\n<p>Extract it (If you have a newer build of Nagios, change the path names below):<\/p>\n<p><code>sudo tar -zxvf nagios-3.1.0.tar.gz<\/code><\/p>\n<p><code>cd nagios-3.1.0<\/code><\/p>\n<p>Create a user and Group:<br \/>\n<code>sudo useradd -m nagios<\/code><\/p>\n<p><code>sudo passwd nagios<\/code><\/p>\n<p><code>sudo groupadd nagcmd<\/code><\/p>\n<p><code>sudo usermod -a -G nagcmd nagios<\/code><\/p>\n<p><code>sudo usermod -a -G nagcmd www-data<\/code><\/p>\n<p>Now we can install&#8230;.<\/p>\n<p><code>sudo .\/configure --with-command-group=nagcmd<\/code><\/p>\n<p><code>sudo make all<\/code><\/p>\n<p><code>sudo make install<\/code><\/p>\n<p><code>sudo make install-init<\/code><\/p>\n<p><code>sudo make install-config<\/code><\/p>\n<p><code>sudo make install-commandmode<\/code><\/p>\n<p><code>sudo make install-webconf<\/code><\/p>\n<p>Create an Apache user we can login as called nagiosadmin:<br \/>\n<code><br \/>\nsudo htpasswd -c \/usr\/local\/nagios\/etc\/htpasswd.users nagiosadmin<\/code><\/p>\n<p>Extract and compile the plugins that were downloaded earlier:<\/p>\n<p><code>cd ~<\/code><\/p>\n<p><code>tar -zxvf nagios-plugins-1.4.13.tar.gz<\/code><\/p>\n<p><code>cd nagios-plugins-1.4.13<\/code><\/p>\n<p><code>sudo .\/configure --with-nagios-user=nagios --with-nagios-group=nagios<\/code><\/p>\n<p><code>sudo make<\/code><\/p>\n<p><code>sudo make install<\/code><\/p>\n<p>Create a link to start the service:<br \/>\n<code>sudo ln -s \/etc\/init.d\/nagios \/etc\/rcS.d\/S99nagios<\/code><\/p>\n<p>Verify the config:<br \/>\n<code>sudo \/usr\/local\/nagios\/bin\/nagios -v \/usr\/local\/nagios\/etc\/nagios.cfg<\/code><\/p>\n<p>Restart Apache:<br \/>\n<code>sudo \/etc\/init.d\/apache2 restart<\/code><\/p>\n<p>Start Nagios:<br \/>\n<code>sudo \/etc\/init.d\/nagios start<\/code><\/p>\n<p>You should now be able to log into the Nagios web interface (<a href=\"http:\/\/localhost\/nagios\">http:\/\/localhost\/nagios<\/a>) using the nagiosadmin user and password.<\/p>\n<p><strong>Customise your installation&#8230;<\/strong><\/p>\n<p>sudo vim \/usr\/local\/nagios\/etc\/nagios.cfg<\/p>\n<p>I have to credit thedailyadmin.com for helping me out with a lot of the above. I urge you to go <a href=\"http:\/\/www.thedailyadmin.com\/2009\/03\/how-to-install-nagios-on-ubuntu-linux.html\">visit that site<\/a> if only to stop me feeling guilty .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I thought I&#8217;d try to find oout why my desktop and NAS keep arguing. Nagios. That will help. So &hellip; <a class=\"more-link\" href=\"http:\/\/simkin.org\/wordpress\/?p=193\">More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3],"tags":[210,140],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/193"}],"collection":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193"}],"version-history":[{"count":0,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/193\/revisions"}],"wp:attachment":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}