Installation tirée du site http://www.unixmen.com/install-and-configure-nagios-in-centos-6-4-rhel-6-4/
Serveur
1 2 3 4 |
yum install gd gd-devel gcc glibc glibc-common wget http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm rpm -Uvh epel-release-6-8.noarch.rpm yum install nagios* |
1 |
vi /etc/nagios/objects/contacts.cfg |
Set nagiosadmin password
1 2 3 4 |
# htpasswd /etc/nagios/passwd nagiosadmin New password: Re-type new password: Updating password for user nagiosadmin |
Start nagios and httpd services and let them to start automatically on every boot.
1 2 3 4 |
service nagios start service httpd start chkconfig nagios on chkconfig httpd on |
Access Nagios admin console
Open nagios administrator console with URL http://nagios-server-ip/nagios and enter the username as nagiosadmin and its password which we created in the earlier steps.
Client
1 2 3 |
wget http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm rpm -Uvh epel-release-6-8.noarch.rpm yum install nrpe nagios-plugins-all openssl |
Edit /etc/nagios/nrpe.cfg file,
1 |
# vi /etc/nagios/nrpe.cfg |
1 2 3 4 |
[...] <em>## Line 81 - Add the Nagios server IP ##</em> allowed_hosts=127.0.0.1,ip_du_serveur_nagios [...] |
1 2 |
service nrpe start chkconfig nrpe on |
1 |
vi /etc/nagios/nagios.cfg |
1 2 |
<em>## Line 52 - Uncomment ##</em> cfg_dir=/etc/nagios/servers |
1 |
mkdir /etc/nagios/servers |
1 |
vi /etc/nagios/servers/clients.cfg |
1 2 3 4 5 6 7 8 9 10 11 |
define host{ use linux-server host_name client alias client address 192.168.1.100 max_check_attempts 5 check_period 24x7 notification_interval 30 notification_period 24x7 } |
1 |
# service nagios restart |