Add Monitoring Targets To Nagios Server:
These Steps will perform on CLIENT MACHINE.
For adding monitor targets to nagios server, To do that you have to to install following two packages in your monitoring targets:
1. nrpe
2. nagios-plugin
These packages will not found in yum repository, so let us add the EPEL Repository to install packages.
Use the following command for installation:
#yum install nrpe nagios-plugins-all -y
Configure Monitoring Targets:
For configure Monitoring targets edit /etc/nagios/nrpe.cfg and do this:
#vim /etc/nagios/nrpe.cfg
allow_hosts=127.0.0.1 192.168.0.220 ( Nagios server IP, add in line no. 81)
save & exit.
Start the nrpe service:
#service nrpe restart
#chkconfig nrpe on
Now come on NAGIOS SERVER MACHINE:
For add the clients:
#vim /etc/nagios/nagios.cfg
uncomment Line No. 52
cfg_dir=/etc/nagios/server
save & exit.
Create a directory "server", under "/etc/nagios":
#mkdir /etc/nagios/server
Create config file to the client to be monitored.
#vim /etc/nagios/server/clients.cfg
define host{
use linux-server
host_name client
alias client
address 192.168.0.200 (client ip)
check_period 24x7
notification_interval 30
notification_period 24x7
}
save & exit.
Restart Nagios service:
#service nagios restart
#chkconfig nagios on
Open Nagios admin console in browser with server ip.
If server ip is 192.168.0.220 then open browser and go to:
http://192.168.0.220/nagios
and enter the username and password as administrator.
If server ip is 192.168.0.220 then open browser and go to:
http://192.168.0.220/nagios
and enter the username and password as administrator.
Click on "hosts". you will see the newly added client will be visible there.
You can define more clients by creating a seprate file under the "/etc/nagios/server" directory for each client.

No comments:
Post a Comment