Installing Nagios from Source on Ubuntu 9.04

Good choice, I give my respect.  Anyways, lets do this!

First lets start by cheating a bit.  The scope of this is obviously to install Nagios from source.  Of course you can install these any way you like, but I will demonstrate installing the required dependencies with Aptitude.

What you’ll end up with after following this portion of the guide…

  • Nagios and the plugin’s will be installed under /usr/local/nagios
  • 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 pre-configured.

Required packages

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

Create Account Information

  • Install Apache2, PHP5, GCC and GD dev libraries
  • $ sudo aptitude install apache2 libapache2-mod-php5 build-essential libgd2-xpm-dev
  • Now we must create our users and groups.
  • $ sudo useradd -m -s /bin/bash nagios
  • Set the “nagios” user password to what ever you want, just don’t forget it
  • $ sudo passwd nagios
  • Create a group for external commands to be submitted through the web interface
  • $ sudo groupadd nagcmd
  • Add both the “nagios” user and “www-data” user to the nagcmd group
  • $ sudo usermod -a -G nagcmd nagios
    $ sudo usermod -a -G nagcmd www-data
  • Confirm that both of your users and groups were created and added correctly
  • $ sudo grep nagios /etc/group
  • You should recieve a response like this
  • nagios:x:1001:
    nagcmd:x:1002:nagios,www-data

Download Nagios and the Plugins

  • Create a folder to work with the downloaded source files and move into it.
  • $ mkdir ~/download
    $ cd ~/download
  • Download the latest tarballs. As of creating this article Nagios Core 3.1.2 and Nagios Plugins 1.4.13 are the latest stable.
  • $ wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.1.2.tar.gz
    $ wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz

Pages: 1 2 3 4 5 6

Tags: