Nagios on CentOS 4
1. setup dag repository
Edit /etc/yum.repos.d/CentOS-Base.repo adding these config:
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
2. install nagios
yum install nagios nagios-plugins
3. Setting Up The Service
Edit /etc/nagios/cgi.cfg, doing these settings:
use_authentication=1
authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
Start up the service:
service nagios start
4. Setting Up The Web Interface
Setting up a user:
htpasswd -c /etc/nagios/htpasswd.users nagios
There already has a /etc/httpd/conf.d/nagios.conf installed, so you just need to restart apache:
/etc/init.d/apache reload
Now you can visit the nagios web interface at:
http://localhost/nagios