Install Nagios on CentOS 5
This page summarizes how to perform a basic installation of Nagios on CentOS 5. This tutorial assumes you are either logged in as root or have sudo.
If you notice a problem with this How-To or would like to provide feedback, please email Matt.
Add RPMForge Yum Repository
|It is recommended that you configure yum-priorities prior to following this tutorial to avoid having base CentOS packages being overwritten by the RPMForge repository. Instructions to do so can be found on the CentOS Wiki.|
- For x86 (32-bit) systems
- For x64 (64-bit) systems
Install & Configure Prerequisites
- Install Apache
yum install httpd php gcc glibc glibc-common gd gd-devel
- Configure Apache to start on boot
/sbin/chkconfig --levels 345 httpd on
- Configure iptables to allow Apache traffic
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
Install & Configure Nagios
- Install Nagios & Plugins
yum install nagios nagios-plugins nagios-plugins-setuid
- Create the default Nagios web access user & set a password
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
- Verify default config files
nagios -v /etc/nagios/nagios.cfg
- Start Nagios
- Start Apache
- Try logging into your new Nagios installation by going to
http://servername/nagios/and logging in with
nagiosadminand the password you set.
- Resources on configuring Nagios can be found in the official documentation. In addition, the CentOS wiki has a nice page here.
- Not all plugins will run without additional packages being installed (Ex.
check_mysqlwon't run without installing