Nagios Server Installation Steps
a. yum install below package
1) httpd 2) php and php-cli 3) gcc 4) glibc and glibc-common 5) gd and gd-devel 6) net-snmp 7) wget
b. vi /etc/httpd/conf/httpd.conf
Change listen port to 8080 (if default 80 had been used)
c. Enable and start httpd services
# systemctl enable httpd # systemctl start httpd
d. Add Nagios Unix User and Group
# useradd nagios # passwd nagios (“Nagios”) # groupadd nagcmd # usermod –a –G nagcmd nagios # usermod –a –G nagcmd apache
e. Get Nagios Server Installer file
# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz (or latest version)
f. Install with below step
1) # tar xzvf nagios-4.0.8.tar.gz 2) # cd nagios-4.0.8 3) # ./configure --with-command-group=nagcmd 4) # make all 5) # make install 6) # make install-init 7) # make install-config 8) # make install-commadmode 9) # make install-webconf
g. Get latest Nagios Plugins File
# wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
h. Then, install all the plugin
1) # tar xzvf Nagios-plugin-2.0.3.tar.gz 2) # cd Nagios-plugins-2.0.3 3) # ./configure --with-nagios-user=nagios --with-nagios-group=nagcmd 4) # make 5) # make install
i. Create Nagios web access user
# htpasswd -c /usr/local/nagios/etc/htpasswd.users admin Store the password to be used for web access later
j. Change Directory into Nagios configuration and start configure
# cd /usr/local/nagios/etc/object/ # vi localhost.cfg (server define, add servers and host groups) # vi commands.cfg (command define, add supported commands) # vi contacts.cfg (contact define, add alert contact emails)
k. Make sure all file in nagios directory are access by Nagios user
# chown –R nagios:nagcmd /usr/local/nagios
l. Allow apache to read user access file
# chmod 644 /usr/local/nagios/etc/htpasswd.users
m. Enable and start nagios services
# systemctl enable nagios # systemctl start nagios (Using port 5666 for Nagios)
2. Testing web access to nagios
a. Start browser and type in Nagios address http://www.yourdomain.com:8080/nagios. b. An pop-up menu will display for login, key-in username and password Username : admin Password : password
refer to NRPE Installation guide for client Installation and how to use Nagios plugin in client.
Leave a Reply