Tuesday, February 25, 2014

Nagios- Setting up

Nagios client Side setting
=============
cd /usr/local/src/
mkdir nagios
cd nagios
useradd nagios
wget http://pkgs.fedoraproject.org/repo/pkgs/nagios-plugins/nagios-plugins-1.4.16.tar.gz/862f5e44fb5bc65ce7e5d86d654d4da0/nagios-plugins-1.4.16.tar.gz
tar -xzf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
export LDFLAGS=-ldl
./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround --enable-ssl
make
make install
cd ..

Nrpe

========

wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz/download
tar -xzf nrpe-2.13.tar.gz
cd nrpe-2.13
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd
yum install xinetd
service xinetd restart
echo "nrpe 5666/tcp # NRPE" >> /etc/services

Open The Port 5666 in csf if its installed .
===========

Now add  IP to allowed_hosts in following files
/etc/xinet.d/nrpe
/usr/local/nagios/etc/nrpe.cfg

ADD port 5666 in /etc/csf/csf.conf file TCP_IN section and restart
firewall

passwd nagios

CREATE USER 'nagios'@'IP' IDENTIFIED BY 'password@666#';
CREATE USER 'nagios'@'127.0.0.1' IDENTIFIED BY 'password@666#';
UPDATE mysql.user SET Password=PASSWORD('new-password-here') WHERE User='user-name-here' AND Host='host-name-here';

define service{
use local-service ; Name of service template to use
host_name sample.example.com
service_description mySQL
is_volatile 0
check_period 24x7
max_check_attempts 20
normal_check_interval 5
retry_check_interval 1
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_mysql!nagios!password@666#
}

No comments:

Post a Comment