1. Install a vanilla Centos.

2. install Nagios Core as following:

yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
cd /tmp
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.3.tar.gz
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
tar xvf nagios-plugins-1.4.16.tar.gz
tar xvf nagios-3.4.3.tar.gz
cd /tmp/nagios
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start
/etc/init.d/httpd start
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
cd /tmp/nagios-plugins-1*
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --add httpd
chkconfig --level 35 httpd on

Use the browser and go to http://SERVER_IP_ADRESS/nagios/ and off it goes

Username:nagiosadmin
password: whatever you set

When installing Nagios (core) on Centos as per the install description and you have the  issue that you can reach the Nagios main webpage but can’t  reach any subpage. You are getting the error :

————————————-

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Apache/2.2.15 (CentOS) Server at x.x.x.x Port 80

 

Do the following:

 

chcon -R -t httpd_sys_content_t /usr/local/nagios

2 thoughts on “Nagios: Install Nagios Core on Centos 6.x

Leave a Reply