this is obsolete doc -- see http://doc.nethence.com/ instead
Setting up Nagios
(out of date)
Introduction
Make sure the time is up-to-date,
vi /etc/ntp.conf
server your_ntp_server
reload the service
Installation
Install those packages,
yum install gcc httpd gd gd-devel perl make net-snmp-perl
Note net-snmp-perl is needed for nagios plugins. Not sure about this one,
yum install net-snmp-devel
To run Checkinstall to make RPMs out of your nagios install, those packages are also needed,
yum install which rpmbuild
Get Checkinstall from http://www.asic-linux.com.mx/~izto/checkinstall/download.php
Note the resulting RPMs are located in /usr/src,
ls -l /usr/src/redhat/RPMS/i386
Prepare the groups & users,
useradd nagios
passwd nagios
groupadd nagcmd
usermod -G nagcmd nagios
usermod -G nagcmd apache
Get Nagios 3 from http://www.nagios.org and,
tar xvzf nagios-3*.tar.gz
cd nagios-3*
./configure --with-command-group=nagcmd
make all
checkinstall
checkinstall --pkgname=nagios-init make install-init
checkinstall --pkgname=nagios-config make install-config
checkinstall --pkgname=nagios-commandmode make install-commandmode
rpm -ivh /usr/src/redhat/RPMS/i386/nagios-*.rpm
vi /usr/local/nagios/etc/objects/contacts.cfg
checkinstall --pkgname=nagios-webconf make install-webconf
rpm -ivh /usr/src/redhat/RPMS/i386/nagios-webconf*.rpm
service httpd reload
Ref. http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html
Get Nagios-plugins and install it (Checkinstall fails),
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Postinstall fix,
cd /usr/local/nagios/var
mkdir rw
chown nagios:nagcmd rw
chmod g+s rw
service nagios start
Eventually change the side menu colors,
share/side.html
SNMP tips
Some usefull plugin commands,
./check_snmp_cpfw.pl -H IP -p PORT -C public -w
./check_snmp -H IP -o OID -p PORT
Note. the mentioned .pl plugin needs latest Net::SNMP ask for method "session"
http://search.cpan.org/~dtown/Net-SNMP-5.2.0/
http://search.cpan.org/
perl -e Makefile.pl
make test
make install
Some usefull tools to make your own SNMP plugin,
snmpwalk -r3 -v1 -c public IP:PORT -On
snmpget -r3 -v1 -c public IP:PORT OID
Note. OID start with a dot
Note. default port is 161 (and 162 for snmptrapd) but checkpoint firewall spit on 260, beside the plaform (snmpd running on linux) default snmp which also runs on it.
Note. snmpwalk doesn't see all the OIDS, you need to check the OID (*precisely*) by yourself using e.g. windows Getif .
Note. double check the ending of the OID, .0 .1 or .2 is often needs to be added manually at the end when copy/pasting the OID getif displays)
Note. to authenticate w/ snmpv3,
snmpget -r3 -v3 -u LOGIN -A PASSWORD -l authNoPriv
MIB hints
Locate RFC ==> you will find the dir where all MIBs are in.
Put your MIb into it and append -m ALL to the snmpget & snmpwalk command lines.
Windows hint
Use NRPE (2.6 http://ovh.dl.sourceforge.net/sourceforge/nagios/nrpe-2.6.tar.gz)
Firefox plugin
https://addons.mozilla.org/en-US/firefox/addon/3607
Links
http://www.nagvis.org/
http://nedi.sourceforge.net/about.html
http://netmon.grnet.gr/weathermap/
(OLD) http://www.network-weathermap.com/
http://www.ayo-online.com/2008/03/28/quick-and-dirty-install-nagios-on-freebsd-how-to/