Installing Nagios via Aptitude on Ubuntu 9.04

So you took the easy way out huh?  Fair enough!  What you’ll end up with after following this portion of the guide…

  • Nagios and the plugin’s will be installed under /etc/nagios3/
  • Nagios will be configured enough to monitor a handful of things on your local server
  • The handy web interface will work so you can see your local server’s alerts and monitors that come preconfigured.

Required packages

  • Apache 2 – Linux webserver
  • PHP5 – Scripting language
  • GD – Graphics development libraries

Luckily aptitude handles all the other bits and pieces of the dependencies.  So here we go!

  1. Install Nagios 3.0.6-2ubuntu
  2. $ sudo aptitude install nagios3
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Reading extended state information
    Initializing package states... Done
    The following NEW packages will be installed:
     apache2{a} apache2-mpm-worker{a} apache2-utils{a} apache2.2-common{a}
     bsd-mailx{a} libapr1{a} libaprutil1{a} libmysqlclient15off{a}
     libnet-snmp-perl{a} libpq5{a} libradius1{a} mysql-common{a}
     nagios-images{a} nagios-plugins{a} nagios-plugins-basic{a}
     nagios-plugins-standard{a} nagios3 nagios3-common{a} nagios3-doc{a}
     postfix{a} radiusclient1{a} snmp{a}
    0 packages upgraded, 22 newly installed, 0 to remove and 0 not upgraded.
    Need to get 11.3MB of archives. After unpacking 29.9MB will be used.
    Do you want to continue? [Y/n/?]
  3. Select “Y” to continue
  4. You may be prompted to quickly configure postfix
  5. Select “Internet Site” for now
  6. Choose the default domain name
  7. Once Completed we are ready to do the “Pre-Flight Check”
  8. $ sudo nagios3 -v /etc/nagios3/nagios.cfg
  9. You should recieve something similar to the text below…
  10. Nagios 3.0.6
    Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
    Last Modified: 12-01-2008
    License: GPL                                                 
     
    Reading configuration data...
     
    Running pre-flight check on configuration data...
     
    Checking services...
     Checked 7 services.
    Checking hosts...
     Checked 2 hosts.
    Checking host groups...
     Checked 5 host groups.
    Checking service groups...
     Checked 0 service groups.
    Checking contacts...
     Checked 1 contacts.
    Checking contact groups...
     Checked 1 contact groups.
    Checking service escalations...
     Checked 0 service escalations.
    Checking service dependencies...
     Checked 0 service dependencies.
    Checking host escalations...
     Checked 0 host escalations.
    Checking host dependencies...
     Checked 0 host dependencies.
    Checking commands...
     Checked 150 commands.
    Checking time periods...
     Checked 4 time periods.
    Checking for circular paths between hosts...
    Checking for circular host and service dependencies...
    Checking global event handlers...
    Checking obsessive compulsive processor commands...
    Checking misc settings...
     
    Total Warnings: 0
    Total Errors:   0
     
    Things look okay - No serious problems were detected during the pre-flight check
  11. Move into the Nagios3 directory
  12. $ cd /etc/nagios3/
  13. Create the regular “nagios” user and enter a password.
  14. $ sudo htpasswd -c htpasswd.users nagios
  15. Create the admin account “nagiosadmin” user and enter a password.
  16. $ sudo htpasswd htpasswd.users nagiosadmin
  17. Go to your browser
  18. http://YOURSERVERIP/nagios3/
  19. You should be prompted for the username and password you just created.  The “nagios” is a regular user without full admin access. The “nagiosadmin” is obviously the admin account that should have access to everything.

Now, for some reason unknown to me there is no logout button.  I’ve only read on this briefly and don’t have an exact answer as to why.  But just know that if you wish to logout and into a new account you have to close your browser and reopen the page to be prompted for your credentials.

But that is it!  You now have a base install of Nagios running ready for your tweaking pleasure.  Also, you should know that if you just installed Apache along with this guide it is not secured and I would not suggest opening this up to the Internet.  With apache’s basic config, logins and passwords will be sent in clear text until you implement a better method.  I’ll be going over Digest authentication in part 2 of Nagios & Ubuntu.  I would highly suggest using Digest auth as a bare minimum as it will at least encrypt your session information with a md5 hash.

Part 2 can be found here – http://www.sucka.net/2009/07/nagios-ubuntu-9-04-part-2/

Pages: 1 2 3 4 5 6

Tags: