Thursday, July 29, 2010

Install Nagios on CentOS 5

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
    • service nagios restart
  • Start Apache
    • service httpd restart

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. 

5 comments:

Ashwin said...

Sir, I'm facing an error while starting the nagios service, -

[root@mmcpl phpmyadmin]# service nagios start
nagios is stopped
Configuration validation failed [FAILED]

Unknown said...

# cat /etc/sysconfig/selinux
[...]
SELINUX=disabled

# /etc/init.d/nagios restart

Ashwin said...

Hello Sir,

I've set off the selinux policy but still receiving the same error....

Ashwin said...

Hello Sir,

After setting the selinux policy, still facing the same issue..

Unknown said...

if you send me sosreport from same server.

Rajat