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/useradd nagios
passwd nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data
Change to a directory to install the source
cd /usr/local/src/
Download sources (latest versions available from http://www.nagios.org/download)
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.2.tar.gz
wget http://switch.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.12.tar.gz
Untar sources
tar xzf nagios-3.0.2.tar.gz
cd nagios-3.0.2
Configure the basic setup of Nagios
./configure –with-command-group=nagcmd
Compile Nagios
make all
Install binaries, init script, sample config files and set permissions on the external command directory.
make install
make install-init
make install-config
make install-commandmode
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.
vi /usr/local/nagios/etc/objects/contacts.cfg
Install the Nagios web config file in the Apache conf.d directory.
make install-webconf
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 restart
Extract the Nagios plugins source code tarball.
cd /usr/local/src
tar -zxvf nagios-plugins-1.4.12.tar.gz
Change to the plugins dir
cd nagios-plugins-1.4.12
Compile the plugins
./configure –with-nagios-user=nagios –with-nagios-group=nagios
make
make install
Start Nagios on boot:
update-rc.d nagios defaults
Verify the configs:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Start Nagios
/etc/init.d/nagios start
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.
THANKYOU!
LikeLike
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.
PF.
LikeLike
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.
LikeLike
ar-lock,
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,
Matt.
LikeLike
Excellent. It’s working. Nice tutorial, simple to follow.
Next step, make database with mysql to use nagios. Any “tutos” on that? 🙂
LikeLike