Nrpe
From Linux Tools
Nagios - nrpe Installation
On the remote server ============= Manual Installation ---------- cd /opt/ wget http://www.mycutelife.net/sanju/newtickethelp/nagios_downloads/nagios-plugins-1.4.11.tar.gz wget http://www.mycutelife.net/sanju/newtickethelp/nagios_downloads/nrpe-1.9.tar.gz wget http://www.mycutelife.net/sanju/newtickethelp/nagios_downloads/nrpe wget http://www.mycutelife.net/sanju/newtickethelp/nagios_downloads/nrpe.cfg useradd nagios tar -xvzf nagios-plugins-1.4.11.tar.gz cd nagios-plugins-1.4.11/ ./configure make make install cd /opt/ tar -xvzf nrpe-1.9.tar.gz cd nrpe-1.9/ ./configure make all cd /opt/ mkdir /usr/local/nagios/bin mkdir /usr/local/nagios/etc cp nrpe-1.9/src/nrpe /usr/local/nagios/bin/ cp nrpe.cfg /usr/local/nagios/etc/ cp nrpe /etc/xinetd.d/ echo "nrpe 5666/tcp" >> /etc/services chkconfig nrpe on /sbin/iptables -I INPUT -p tcp -s 0/0 --dport 5666 -j ACCEPT; service iptables save; /etc/rc.d/init.d/xinetd restart
Then enter mysql prompt
mysql
mysql> create database nagios; Query OK, 1 row affected (0.02 sec)
mysql> grant all privileges on nagios.* to nagios@nagios-server-IP identified by '123dsa'; mysql> quit Bye
Adding qmail queue
cd /usr/local/nagios/libexec wget http://www.dwadson.com/files/nagios/check_qmailq chmod ugo+x check_qmailq
For checking the service from nagios server
cd /usr/local/nagios/libexec ./check_mysql --hostname=72.9.234.194 --port=3306 --username=nagios --password=123dsa ./check_nrpe -H <ip> -c check_load ./check_http -H <ip> ./check_smtp -H <ip>
If you get error "Client does not support authentication protocol"
http://dev.mysql.com/doc/refman/5.0/en/old-client.html mysql mysql> SET PASSWORD FOR nagios@63.247.77.234 = OLD_PASSWORD('123dsa'); mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('123dsa') WHERE Host = '63.247.77.234' AND User = 'nagios';
Next step is to give the nagios server ip to file /etc/xinetd.d/nrpe
vi /etc/xinetd.d/nrpe
# default: on
# description: NRPE
service nrpe
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/local/nagios/bin/nrpe
server_args = -c /etc/nrpe.conf --inetd
log_on_failure += USERID
disable = no
only_from = 216.67.247.2 67.18.118.218 63.247.77.234
}
Nagios named service monitoring
The command to check named in commands.cfg
# 'check_dns' command definition
define command{
command_name check_dns
command_line $USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$
}
Error : DNS CRITICAL - '/usr/bin/nslookup -sil' msg parsing exited with no address
Add the following in named.conf file of the remote server
allow-recursion { any; };
or The full section is given below
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
allow-recursion { any; };
