Difference between revisions of "Install Nagios on CentOS 5"

From CSLabsWiki
m (added links to both x86 & x64 for dag)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
{{ archived }}
This page summarizes how to perform a basic installation of Nagios on CentOS 5.
 
  +
{{ deprecated }}
  +
  +
This page summarizes how to perform a basic installation of Nagios on CentOS 5. This tutorial assumes you have root/sudo access and have SELinux set to permissive or disabled.
  +
  +
If you notice a problem with this How-To or would like to provide feedback, please email [[User:Mccarrms|Matt]].
   
 
==Install==
 
==Install==
 
===Add RPMForge Yum Repository===
 
===Add RPMForge Yum Repository===
  +
  +
{{ambox
  +
| type = serious
  +
| text = '''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 [http://wiki.centos.org/PackageManagement/Yum/Priorities CentOS Wiki].'''
  +
}}
 
*For x86 (32-bit) systems
 
*For x86 (32-bit) systems
 
**<code>rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.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>
Line 13: Line 23:
 
===Install & Configure Prerequisites===
 
===Install & Configure Prerequisites===
 
*Install Apache
 
*Install Apache
**<code>yum install httpd</code>
+
**<code>yum install httpd php gcc glibc glibc-common gd gd-devel</code>
   
 
*Configure Apache to start on boot
 
*Configure Apache to start on boot
Line 19: Line 29:
   
 
*Configure iptables to allow Apache traffic
 
*Configure iptables to allow Apache traffic
**<code>/sbin/iptables -A INPUT -p tcp --dport 80 -j ACCEPT</code>
+
**<code>/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT</code>
**<code>/sbin/service iptables save</code>
+
**<code>/etc/init.d/iptables save</code>
 
**<code>/etc/init.d/iptables restart</code>
 
**<code>/etc/init.d/iptables restart</code>
   
Line 43: Line 53:
 
*Try logging into your new Nagios installation by going to <code>http://servername/nagios/</code> and logging in with <code>nagiosadmin</code> and the password you set.
 
*Try logging into your new Nagios installation by going to <code>http://servername/nagios/</code> and logging in with <code>nagiosadmin</code> and the password you set.
   
  +
==Notes==
*Note: Not all plugins will run without additional packages being installed (Ex. <code>check_mysql</code> won't run without installing <code>mysql</code>).
 
  +
*Resources on configuring Nagios can be found in the [http://nagios.sourceforge.net/docs/3_0/ official documentation]. In addition, the CentOS wiki has a nice page [http://wiki.centos.org/HowTos/Nagios here].
  +
  +
*Not all plugins will run without additional packages being installed (Ex. <code>check_mysql</code> won't run without installing <code>mysql</code>).
   
[[Category:How To]]
+
[[Category:How-Tos]]
[[Category:Documentation]]
 

Latest revision as of 14:56, 31 January 2014


This page summarizes how to perform a basic installation of Nagios on CentOS 5. This tutorial assumes you have root/sudo access and have SELinux set to permissive or disabled.

If you notice a problem with this How-To or would like to provide feedback, please email Matt.

Install

Add RPMForge Yum Repository

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
    • /etc/init.d/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.

Notes

  • Not all plugins will run without additional packages being installed (Ex. check_mysql won't run without installing mysql).