Nagios

Quickstart Notes - Ubuntu


Up To: Contents
See Also: Quickstart Installation Guide

Introduction

If you're installing Nagios on Ubuntu, there are a few things that you'll need to do differently than described in the quickstart installation guide. This document is intended to act as a supplement to the quickstart guide and only contains portions of the quickstart guide that differ for Ubuntu. That means you'll have to use this document in conjunction with the quickstart.

These instructions were written based on an Ubuntu 6.10 (desktop) installation.

The installation notes for Ubuntu differ from the quickstart installation guide because of the following:

Commands and file names that differ from the quickstart installation guide are highlighted in red. Only sections of the quickstart that differ for Ubuntu are included below.

Required Packages

Make sure you've installed the following packages on your Ubuntu installation before continuing.

You can use apt-get to install these packages by running the following commands:

sudo apt-get install apache2
sudo apt-get install build-essential
sudo apt-get install libgd2-dev

1) Create Account Information

Become the root user.

sudo -s

Create a new nagios user account and give it a password.

/usr/sbin/useradd nagios
passwd nagios

Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.

/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data

5) Configure the Web Interface

Copy the sample web config file to the Apache conf.d directory.

cp sample-config/httpd.conf /etc/apache2/conf.d/nagios.conf

Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Restart Apache to make the new settings take effect.

/etc/init.d/apache2 reload

7) Start Nagios

Configure Nagios to automatically start when the system boots.

ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

Verify the sample Nagios configuration files.

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If there are no errors, start Nagios.

/etc/init.d/nagios start

9) Modify SELinux Settings

Ubuntu doesn't ship with SELinux (Security Enhanced Linux), so you don't need to modify enforcement settings as described in the quickstart guide.

10) Other Modifications

Ubuntu doesn't ship with firewall settings that block remote access to the Apache web server, so you shouldn't need to modify anything to access your Nagios interface remotely.

If you want to receive email notifications for Nagios alerts, you need to install the mailx (Postfix) package.

sudo apt-get install mailx

You'll have to edit the Nagios email notification commands found in /usr/local/nagios/etc/commands.cfg and change any '/bin/mail' references to '/usr/bin/mail'. Once you do that you'll need to restart Nagios to make the configuration changes live.

sudo /etc/init.d/nagios restart

Configuring email notifications is out of the scope of this documentation. Refer to your system documentation, search the web, or look to the NagiosCommunity.org wiki for specific instructions on configuring your Ubuntu system to send email messages to external addresses.