Please note these are more notes for me than a finished write-up, however I hope to document this on the Nagios WIKI in due course…
Install the dependencies
aptitude install build-essential gcc libgd2-xpm-dev libglib2.0-dev make
accept defaults for the dpkg-config
Create the users and groups that are required:
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data
Change to a directory to install the source
Download sources (latest versions available from http://www.nagios.org/download)
tar xzf nagios-3.0.2.tar.gz
Configure the basic setup of Nagios
Install binaries, init script, sample config files and set permissions on the external command directory.
Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you’d like to use for receiving alerts.
Install the Nagios web config file in the Apache conf.d directory.
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.
Extract the Nagios plugins source code tarball.
tar -zxvf nagios-plugins-1.4.12.tar.gz
Change to the plugins dir
Compile the plugins
./configure –with-nagios-user=nagios –with-nagios-group=nagios
Start Nagios on boot:
update-rc.d nagios defaults
Verify the configs:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Browse to the web interface and log in!
This worked perfectly, I had to install the ‘make’ package (big deal) … I’m a debian ‘noob’ and managed to get this all running with no issues.
Glad to hear it worked.
I’ve noticed on a few systems recently that make doesn’t get installed by default when you install build-essential, I’ve updated the post to reflect this.
In debian, its better practice to install the debian package, as opposed to compiling from source.
there is a package for nagios2 in the repository and currently you can find an Intrepid backport in the ppa’s …
soon nagios 3 will be in the repository.
I agree completely, where possible the package should be used, however sometimes you need features that aren’t compiled into the package, other times it’s easier to install from source than perform a dist-upgrade!
Thanks for visiting,
Excellent. It’s working. Nice tutorial, simple to follow.
Next step, make database with mysql to use nagios. Any “tutos” on that? 🙂