Difference between revisions of "Install Nagios on CentOS 5"

From CSLabsWiki
m (Added configuring iptables to allow httpd traffic.)
m (added links to both x86 & x64 for dag)
Line 3: Line 3:
 
==Install==
 
==Install==
 
===Add RPMForge Yum Repository===
 
===Add RPMForge Yum Repository===
  +
*For x86 (32-bit) systems
*<code>rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm</code>
 
  +
**<code>rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm</code>
**From [http://dag.wieers.com/rpm/FAQ.php#B2 Dag Wieers]
 
  +
***From [http://dag.wieers.com/rpm/FAQ.php#B2 Dag Wieers]
  +
  +
*For x64 (64-bit) systems
  +
**<code>rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm</code>
  +
***From [http://dag.wieers.com/rpm/FAQ.php#B2 Dag Wieers]
   
 
===Install & Configure Prerequisites===
 
===Install & Configure Prerequisites===
Line 11: Line 16:
   
 
*Configure Apache to start on boot
 
*Configure Apache to start on boot
**<code>/sbin/chkconfig --levels 35 httpd on</code>
+
**<code>/sbin/chkconfig --levels 345 httpd on</code>
   
 
*Configure iptables to allow Apache traffic
 
*Configure iptables to allow Apache traffic

Revision as of 17:34, 25 May 2009

This page summarizes how to perform a basic installation of Nagios on CentOS 5.

Install

Add RPMForge Yum Repository

Install & Configure Prerequisites

  • Install Apache
    • yum install httpd
  • Configure Apache to start on boot
    • /sbin/chkconfig --levels 345 httpd on
  • Configure iptables to allow Apache traffic
    • /sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT
    • /sbin/service iptables save
    • /etc/init.d/iptables restart

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
    • /etc/init.d/nagios start
  • Start Apache
    • /etc/init.d/httpd start

Verify Install

  • Try logging into your new Nagios installation by going to http://servername/nagios/ and logging in with nagiosadmin and the password you set.
  • Note: Not all plugins will run without additional packages being installed (Ex. check_mysql won't run without installing mysql).