Nagios Install on Fedora 7

Nagios Install on Fedora 7

Nagios Install on Fedora 7 150 150 Roderick Derks

yum -y update

vi /etc/inittab
shutdown -r 0

yum -y install gcc perl-Config-IniFiles net-snmp net-snmp-perl net-snmp-utils perl-Net-SNMP net-snmp-libs gd gd-devel libpng libpng-devel libjpg libjpg-devel

cd /tmp/
wget http://downloads.sourceforge.net/nagiosplug/nagios-plugins-1.4.9.tar.gz?modtime=1180952247&big_mirror=0
wget http://downloads.sourceforge.net/nagiosplug/nagios-plugins-1.4.9.tar.gz?modtime=1180952247&big_mirror=0
tar xvzf nagios-2.9.tar.gz
rm nagios-2.9.tar*
cd nagios-2.9
adduser nagios
mkdir /usr/local/nagios
chown nagios:nagios /usr/local/nagios
grep “^User” /etc/httpd/conf/httpd.conf
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd apache
/usr/sbin/usermod -G nagcmd nagios

../configure –prefix=/usr/local/nagios –with-command-group=nagcmd
make all
make install
make install-init
chkconfig –add nagios
service nagios status
cd /usr/local/nagios/
chown -R nagios:nagios etc/
ln -s /usr/local/nagios/etc/apache/nagios.conf /etc/httpd/conf.d/nagios.conf
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

rsync -avu root@cacti.elisabeth.nl:/usr/local/nagios/etc /usr/local/nagios/
rsync -avu root@cacti.elisabeth.nl:/usr/local/nagios/libexec /usr/local/nagios/
mv share share.bak
rsync -avu root@cacti.elisabeth.nl:/usr/local/nagios/share /usr/local/nagios/
system-config-securitylevel-tui
service httpd start

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

tar xvzf nagiosgraph-0.9.0.tgz
cd nagiosgraph-0.9.0
mkdir /usr/local/nagios/nagiosgraph
cp nagiosgraph.conf /usr/local/nagios/nagiosgraph/
cp map /usr/local/nagios/nagiosgraph/
cp insert.pl /usr/local/nagios/nagiosgraph/
cp show.cgi /usr/local/nagios/nagiosgraph/
vi /usr/local/nagios/nagiosgraph/nagiosgraph.conf

ls -ald /var/log
touch /usr/local/nagios/var/nagiosgraph.log
chown nagios:nagios /usr/local/nagios/var/nagiosgraph.log
vi /usr/local/nagios/nagiosgraph/nagiosgraph.conf
mkdir /usr/local/nagios/nagiosgraph/rrd
chown nagios:nagios /usr/local/nagios/nagiosgraph/rrd
chown -R nagios:nagios /usr/local/nagios/nagiosgraph
vi /usr/local/nagios/nagiosgraph/nagiosgraph.conf
updatedb
locate perfdata.log
touch /usr/local/nagios/var/perfdata.log
vi /usr/local/nagios/nagiosgraph/nagiosgraph.conf

cd /usr/local/nagios/nagiosgraph/
vi insert.pl
vi show.cgi

chown nagios:nagios /usr/local/nagios/var/perfdata.log
chmod 664 /usr/local/nagios/var/nagiosgraph.log
chmod 664 /usr/local/nagios/var/perfdata.log
chmod 775 /usr/local/nagios/nagiosgraph/rrd/

chown nagios:nagios ../../var/nagiosgraph.log
chmod 666 ../../var/nagiosgraph.log
perl-Config-IniFiles

yum -y install perl-Config-IniFiles

[root@cacti ~]# scp /lib/libssl.so.5 root@10.20.2.26:/lib/
root@10.20.2.26’s password:
libssl.so.5                                   100%  225KB 224.7KB/s   00:00    
[root@cacti ~]# scp /lib/libcrypto.so.5 root@10.20.2.26:/lib/
root@10.20.2.26’s password:
libcrypto.so.5    

ldconfig

NagiosPlugin NSCA
——————

tar xvzf nsca-2.7.2.tar.gz
cd nsca-2.7.2
../configure
make all
cp src/nsca /usr/local/nagios/bin
cp /tmp/nsca-2.7.2/sample-config/nsca.cfg /usr/local/nagios/etc/nsca.conf
cp /tmp/nsca-2.7.2/sample-config/nsca.xinetd /etc/xinetd.d/nsca

vi /etc/services

nsca            5667/tcp                        # NSCA

vi README
touch /etc/xinetd.d/nsca

[root@cacti ~]# vi /etc/xinetd.d/nsca
# default: on
# description: NSCA (Nagios Service Check Acceptor)
service nsca
{
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nsca
        server_args     = -c /usr/local/nagios/etc/nsca.cfg –inetd
        log_on_failure  += USERID
        disable         = no
        #only_from       = 127.0.0.1 ezhdevdb02 ezhcom02 ezhcom01
}

cd /usr/local/nagios/var
touch nsca.dump
chown nagios:nagios nsca.dump
chmod 660 nsca.dump
vi /usr/local/nagios/etc/nsca.cfg

 command_file=/usr/local/nagios/var/rw/nagios.cmd
 alternate_dump_file=/usr/local/nagios/var/nsca.dump

yum install xinetd
chkconfig –add xinetd
chkconfig –level 3  xinetd on
service xinetd start
chkconfig –list
# system-config-securitylevel
add port 5667

Voorbeeldcommando:
ezhcom01;adt-endo_adt;2;TESTJE”| /usr/local/nagios/bin/send_nsca -H 10.20.2.26 -d “;” -c /usr/local/nagios/etc/send_nsca.cfg

————————————————————

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your Name (required)

Your Email (required)

Subject

Your Message

Your Name (required)

Your Email (required)

Subject

Your Message