SOURCECODEBD.NET

Live Experience

Install and Configure Nagios in CentOS

Install Nagios in order to watch server's status.

httpd is also needed.

[1] Install Nagios  
 
[root@ns ~]# yum install nagios nagios-plugins

[root@ns ~]# vi /etc/nagios/nagios.cfg

# line 52: uncomment
cfg_dir=/etc/nagios/servers

[root@ns ~]# vi /etc/httpd/conf.d/nagios.conf

# line 16: add IPs you allow
Allow from
127.0.0.1 192.168.0.

# line 33: add IPs you allow
Allow from
127.0.0.1 192.168.0.

[root@ns ~]# mkdir /etc/nagios/servers
[root@ns ~]# chown nagios. /etc/nagios/servers
[root@ns ~]# vi /etc/nagios/objects/contacts.cfg

# line 35: change to admin's email address
email
webmaster@localhost

[root@ns ~]# /etc/rc.d/init.d/httpd restart
[root@ns ~]# /etc/rc.d/init.d/nagios start
[root@ns ~]# chkconfig nagios on 

 [2] Access with web browser to 'http://(your hostname or IP address)/nagios/', then follow Input nagiosadmin for user and password set with htpasswd.

You are here: Home / CentOS / Install and Configure Nagios in CentOS