1. Login to Client Server as root
2. create one sh file like below
vim install-nrpe.sh
## paste below as it is.
yum install openssl-devel gcc xinetd make glibc -y
yum install wget vim telnet htop -y
wget http://ufpr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.14/nrpe-2.14.tar.gz
tar -xzf nrpe-2.14.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
tar -xzf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
useradd nagios
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make && make install
chown -R nagios:nagios /usr/local/nagios/libexec
cd ..
cd nrpe-2.14
./configure
make all && make install-plugin && make install-daemon && make install-daemon-config && make install-xinetd
:wq
chmod +x install-nrpe.sh && ./install-nrpe.sh
vim /etc/services
nrpe 5666/tcp # NRPE
:wq
vim /etc/xinetd.d/nrpe
only_from = 127.0.0.1 192.168.0.100
# Add nagios ip
192.168.0.100
# add nagios ip
:wq
service xinetd start && chkconfig xinetd on && chmod -R 777 /usr/local/nagios/libexec/* ; chown -R nagios:nagios /usr/local/nagios/libexec/*
vim /usr/local/nagios/etc/nrpe.cfg
command[check_users]=/usr/local/nagios/libexec/check_users -w 4 -c 5
command[check_load]=/usr/local/nagios/libexec/check_load -w 75 -c 85
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 16% -c 15%
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 140 -c 150
command[check_mem]=/usr/local/nagios/libexec/check_mem -w 85 -c 90
command[check_cpu_perf]=/usr/local/nagios/libexec/check_cpu_perf
command[check_uptime]=/usr/local/nagios/libexec/check_uptime
:wq
vim /usr/local/nagios/libexec/check_cpu_perf
vim /usr/local/nagios/libexec/check_mem
cd /usr/local/nagios/libexec/ && chmod +x check_cpu_perf check_mem && chown nagios. check_cpu_perf check_mem && service xinetd restart
2. create one sh file like below
vim install-nrpe.sh
## paste below as it is.
yum install openssl-devel gcc xinetd make glibc -y
yum install wget vim telnet htop -y
wget http://ufpr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.14/nrpe-2.14.tar.gz
tar -xzf nrpe-2.14.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
tar -xzf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
useradd nagios
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make && make install
chown -R nagios:nagios /usr/local/nagios/libexec
cd ..
cd nrpe-2.14
./configure
make all && make install-plugin && make install-daemon && make install-daemon-config && make install-xinetd
:wq
chmod +x install-nrpe.sh && ./install-nrpe.sh
vim /etc/services
nrpe 5666/tcp # NRPE
:wq
vim /etc/xinetd.d/nrpe
only_from = 127.0.0.1 192.168.0.100
# Add nagios ip
192.168.0.100
# add nagios ip
:wq
service xinetd start && chkconfig xinetd on && chmod -R 777 /usr/local/nagios/libexec/* ; chown -R nagios:nagios /usr/local/nagios/libexec/*
vim /usr/local/nagios/etc/nrpe.cfg
command[check_users]=/usr/local/nagios/libexec/check_users -w 4 -c 5
command[check_load]=/usr/local/nagios/libexec/check_load -w 75 -c 85
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 16% -c 15%
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 140 -c 150
command[check_mem]=/usr/local/nagios/libexec/check_mem -w 85 -c 90
command[check_cpu_perf]=/usr/local/nagios/libexec/check_cpu_perf
command[check_uptime]=/usr/local/nagios/libexec/check_uptime
:wq
vim /usr/local/nagios/libexec/check_cpu_perf
vim /usr/local/nagios/libexec/check_mem
cd /usr/local/nagios/libexec/ && chmod +x check_cpu_perf check_mem && chown nagios. check_cpu_perf check_mem && service xinetd restart
No comments:
Post a Comment