How to Install Nagios Core 4.0.8 With Plugins on Debian 8, Linux Mint 17.3 & Ubuntu 14.04,16.04
Hello Everyone,
In this tutorial,
let us Install Nagios Core 4.0.7 Network Monitoring Tool and Nagios Plugins 2.0.3 Latest Version in Ubuntu 14.04 Server.
1. Software Required
Nagios 4.0.7.tar.gz
Nagios plugins 2.0.3.tar.gz
2. You Need to Login With Root to Perform all Command
Step1 :- sudo su
3. Installed packages
Step2 :- sudo apt-get install apache2 build-essential daemon libapache2-mod-php5 libgd2-xpm libgd2-xpm-dev php5-gd unzip wget sendmail
4. Installation Part
Update ubuntu repositories by giving the below command
Step3 :- sudo apt-get update
Step4 :- sudo apt-get upgrade
5. Install package
Step5:- sudo apt-get install apache2 php
Step6:- sudo apt-get install gcc glibc-common
Step7:- sudo apt-get install gd gd-devel
6. Create Nagios User, Group and Password
Step8:- useradd nagios or /usr/sbin/useradd -m nagios
Step9:- passwd nagios
Step10:- groupadd nagcmd or /usr/sbin/groupadd nagcmd
Step11:- usermod -G nagcmd nagios
usermod -G nagcmd apache or /usr/sbin/usermod -a -G nagcmd nagios
7. Download Nagios Core 4.0.7 and Nagios Plugin 2.0.3
Step12:- mkdir /root/nagios
Step13 :- cd /root/nagios
Step14:- sudo wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.7.tar.gz
Step15:- sudo wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz
OR DIRECT D/L LINK
http://www.nagios.org/download/core
8. Unzip the download nagios
Step16:- tar xvf nagios-4.0.7.tar.gz
Step17:- ll (two new folders will appear in that directory)
Step18:- cd nagios-4.0.7.tar.gz
Step19:- ./configure --with-command-group=nagios--with-command-group=nagcmd --with-mail=/usr/bin/sendmail
Step20:- make all
Step21:- make install
Step22:- make install-init ---- scripts
Step23:- make install-config ---- configuration file
Step24:- make install-commandmode ---- external dir command
Step25:- make install-webconf ---- apache and nagiso config file install
1. In this step, we will be creating a password for “nagiosadmin"
2. Keep it remember because this password will be used when you login in the Nagios Web interface.
Step26:- htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
9. Customizing Nagios Configuration
Step27 :- vi /usr/local/nagios/etc/objects/contacts.cfg
11. Unzip the download nagios
Step28:- cd /home/download or cd /root/nagios
Step29:- tar xvf nagios-2.03.tar.gz
Step30:- cd nagios-2.0.3.tar.gz
Step31:- ./configure --with-nagios-user=nagios --with-nagios-group=nagios
Step32:- make all
Step33:- make install
12. Copy and link Nagios Apache configuration
Step34:- sudo cp /etc/apache2/conf.d/nagios.conf /etc/apache2/sites-available/nagios
Step35:- sudo ln -s /etc/apache2/sites-available/nagios /etc/apache2/sites-enabled/nagios
14. Check Nagios configuration for errors
Step36:- sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
15. Make Nagios and Apache start at boot
Step37:- sudo ln -s /etc/init.d/nagios /etc/rcS.d/S98nagios
Step38:- sudo ln -s /etc/init.d/apache2 /etc/rcS.d/S99apache2
Step39:- chkconfig -add nagios
Step40:- chkconfig nagios on
16. Start Nagios Core 4.0.7 Service
step41:- sudo service nagios start
17. Start Apache Service
step42 :- sudo service apache2 start
TESTING TIME
Visit Nagios URL in your browser
http://IPADDRESS/nagios or http://domainname.cm/nagios
username:- nagiosadmin and password:- created in step 8
18. To Add New User & Reset Password
The user's credentials password are stored in
/etc/nagios3/htpasswd.users
19. To change the nagiosadmin password.
step43:- sudo htpasswd /etc/nagios3/htpasswd.users nagiosadmin
20. To add a user
step44:- sudo htpasswd /etc/nagios3/htpasswd.users steve
ERROR
Error 1 after login :- error could not read object configuration data nagios 4 run nagios as daemon.
Step45:- sudo /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
Error 1 after login:- It appears as though you do not have permission to view information for any of the hosts you requested.
Step46:- sudo nano /usr/local/nagios/etc/cgi.cfg
Step47:- sudo service nagios restart
NOTE :- For Any Clarification Please Comment Below
Comment,
Like and
Share us and help us to spread.
####--------------------------------------------------------------------------------------####
Subscribe to Cloud Network :- http://goo.gl/LjKGzc
Website :- http://www.cloudnetwork.in
Like us on Facebook :- http://facebook.com/itcloudnetwork
Follow us on Twitter :- http://twitter.com/itcloudnet
Circle us on Google+ :- https://goo.gl/StVdHb
Pin us on Pinterset :- http://pinterset.com/itcloudnet
Add us on LinkedIn :- http://in.linkedin.com/pub/itcloudnet
Skype Id :- cloud.network1
E-Mail Id :- itcloudnet@gmail.com
####----------------------------------------------------------------------------------------####
Thanking You
Hope U Like it........