
In this series of posts im going to gro through the steps to install and configure Nagios 4.0 On Centos 6.4, so it can be used to monitor server and network equipment on a network. I will be using Centos 6.4 64bit to install and configure Nagios. i will assume you have a clean centos installation on your pc/server.
Requirments for nagios:
Required packages are:
httpd, php, gcc, glibc, glibc-common, gd, gd-devel, net-snmp, net-snmp-utils, net-snmp-devel, wget
Use Yum to install the required packages.
yum install -y httpd php gcc glibc glibc-common gd gd-devel net-snmp net-snmp-utils net-snmp-devel wgetPreperation:
Create Nagios User
#/usr/sbin/useradd -m NagiosCreate Nagios Group
#/usr/sbin/groupadd nagiosAdd the newley created nagios user and the HTTP user (apache) to the nagios group
#/usr/sbin/usermod -a -G nagios nagios
#/usr/sbin/usermod -a -G nagios apacheDownload Nagios and the Plugins
Create a Download Directory and navagate to it.
#mkdir ~/downloads
#cd ~/downloadsDownload the Packages
#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.0.tar.gz
#wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gzExtract Nagios
tar zxvf nagios-4.0.0.tar.gz
tar zxvf nagios-plugins-1.4.15.tar.gzCompile the Nagios:
Change to the new Nagios directory and Compile the packages:
#cd nagiosHere we will compile the nagios package useing some switches. This will allow us to compile the nagios packages how we like.
This option will allow you to install nagios in to one location and not install it system wide.
–prefix=/opt/nagios
–-with-cgiurl=/nagios/cgi-bin
-–with-htmlurl=/nagios
–with-nagios-user=nagios
-–with-nagios-group=nagios
–with-template-objects
#./configure –prefix=/opt/nagios –-with-cgiurl=/nagios/cgi-bin -–with-htmlurl=/nagios --with-nagios-user=nagios -–with-nagios-group=nagios --with-template-objectsInstall Nagios:
#make all
#make install
#make install-init
#make install-config
#make install-commandmode
#make install-webconfCreating HTTP users:
#cd /usr/bin/
#./htpasswd -c /opt/nagios/etc/htpasswd.users nagiosadmin
#/etc/init.d/httpd restartinstall of nagios is now compleet. You should be able to log on to the server using a web address
http:\\your-server-name\nagios
Username:nagiosadmin
Password:”password you chose”

Leave a Reply