How To Install and Configure Nagios in CentOS

Linux System Administrator
Nagios is a monitoring solution for complex IT infrastructures, Nagios is easy to implement and can be extended by custom-modules, called plugins. In this howto I explain howto install Nagios on a CentOS host and make the configuration for it.
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.

2 thoughts on “How To Install and Configure Nagios in CentOS

Leave a Reply

Your email address will not be published. Required fields are marked *