User Tools

Site Tools


user:thakes3:portfolio:fall2013:nagios

Installing & Configuring Nagios Core 4.0.0

Intro

This tutorial is designed to demonstrate a full installation & configuration of nagios 4.0.0 on a debian wheezy system. Nagios is (GPL) open-source industry standard monitoring software. It more or less stalks each computer for the information it wants and if it doesn't get the information it'll destroy you via notifications.

Installation

Please make sure you have the following packages installed:

satan@lab46:~> sudo apt-get install build-essential apache2 php5-gd libgd2-xpm libgd2-xpm-dev libapache2-mod-php5

The next step is to get the latest nagios 4.0.0 onto the server for instalation. http://nagios.sourceforge.net/ for all of your nagios core needs.

You will want the nagios core 4.0.0 and the plugins ( at this date version 1.5 )

Now give nagios a user and group to run from. *please note* the last command adds the user 'nagios' to group 'nagcmd'

satan@lab46:~> sudo useradd nagios
satan@lab46:~> sudo groupadd nagcmd
satan@lab46:~> usermod -a -G nagcmd nagios

Now, make a directory for nagios. It can be /home/nagios or /etc/nagios or whatever you want to pick. Since most of the tutorials i've seen has put them in /etc/nagios , I will as well.

satan@lab46:~> sudo mkdir /etc/nagios 
satan@lab46:~> sudo mv nagios-4.0.0.tar.gz /etc/nagios

now extract that mofo

satan@lab46:~> sudo tar xfvz /etc/nagios/nagios-4.0.0.tar.gz

jump in that folder, and compile it good

satan@lab46:~> cd /etc/nagios/nagios/
satan@lab46:/etc/nagios/nagios> sudo ./configure --with-nagios-group=nagios --with-command-group=nagcmd --with-mail=/usr/bin/sendmail

from here it'll spit out a bunch of crap, and if it doesn't error out you've set up everything right from this point up, so gz for that.

now? now we must make this work. with make. make.

satan@lab46:/etc/nagios/nagios> sudo make all
satan@lab46:/etc/nagios/nagios> sudo make install
satan@lab46:/etc/nagios/nagios> sudo make install-init
satan@lab46:/etc/nagios/nagios> sudo make install-config
satan@lab46:/etc/nagios/nagios> sudo make install-commandmode
satan@lab46:/etc/nagios/nagios> sudo make install-webconf

Now copy the event handlers to their location, and make sure that they are owned by the proper person / thing.

satan@lab46:/etc/nagios/nagios> sudo cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
satan@lab46:/etc/nagios/nagios> sudo chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers

And now, check to make sure the default config will work. If it does, start it up.

satan@lab46:~> sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
satan@lab46:~> sudo /etc/init.d/nagios start

got this error

satan@lab46:~> /etc/init.d/nagios start
/etc/init.d/nagios: 20: .: Can't open /etc/rc.d/init.d/functions

checking into it

user/thakes3/portfolio/fall2013/nagios.txt · Last modified: 2013/10/10 20:16 by thakes3