Hello Everyone,
In this tutorial, let us Install Nagios
How to Install Nagios Core 4.0.7 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
Step13:- tar xvf nagios-4.0.7.tar.gz
Step:- ll (two new folders will appear in that directory)
Step14:- cd nagios-4.0.7.tar.gz
Step15:- ./configure --with-command-group=nagios--with-command-group=nagcmd --with-mail=/usr/bin/sendmail
Step16:- make all
Step17:- make install
Step18:- make install-init ---- scripts
Step19:- make install-config ---- configuration file
Step20:- make install-commandmode ---- external dir command
Step21:- 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.
Step:- htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
9. Customizing Nagios Configuration
Step22 :- vi /usr/local/nagios/etc/objects/contacts.cfg
11. Unzip the download nagios
Step25:- cd /home/download or cd /root/nagios
Step26:- tar xvf nagios-2.03.tar.gz
Step27:- cd nagios-2.0.3.tar.gz
Step28:- ./configure --with-nagios-user=nagios --with-nagios-group=nagios
Step29:- make all
Step30:- make install
12. Copy and link Nagios Apache configuration
Step31:- sudo cp /etc/apache2/conf.d/nagios.conf /etc/apache2/sites-available/nagios
Step32:- sudo ln -s /etc/apache2/sites-available/nagios /etc/apache2/sites-enabled/nagios
14. Check Nagios configuration for errors
Step33:- sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
15. Make Nagios and Apache start at boot
Step34:- sudo ln -s /etc/init.d/nagios /etc/rcS.d/S98nagios
Step35:- sudo ln -s /etc/init.d/apache2 /etc/rcS.d/S99apache2
Step36:- chkconfig -add nagios
Step37:- chkconfig nagios on
16. Start Nagios Core 4.0.7 Service
step38 :- sudo service nagios start
17. Start Apache Service
step39 :- 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.
Step40:- 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.
Step41:- sudo nano /usr/local/nagios/etc/cgi.cfg
Step42:- sudo service nagios restart
NOTE :- For Any Clarification Please Comment Below
Thanking You
Hope U Like it........
In this tutorial, let us Install Nagios
How to Install Nagios Core 4.0.7 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
Step13:- tar xvf nagios-4.0.7.tar.gz
Step:- ll (two new folders will appear in that directory)
Step14:- cd nagios-4.0.7.tar.gz
Step15:- ./configure --with-command-group=nagios--with-command-group=nagcmd --with-mail=/usr/bin/sendmail
Step16:- make all
Step17:- make install
Step18:- make install-init ---- scripts
Step19:- make install-config ---- configuration file
Step20:- make install-commandmode ---- external dir command
Step21:- 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.
Step:- htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
9. Customizing Nagios Configuration
Step22 :- vi /usr/local/nagios/etc/objects/contacts.cfg
11. Unzip the download nagios
Step25:- cd /home/download or cd /root/nagios
Step26:- tar xvf nagios-2.03.tar.gz
Step27:- cd nagios-2.0.3.tar.gz
Step28:- ./configure --with-nagios-user=nagios --with-nagios-group=nagios
Step29:- make all
Step30:- make install
12. Copy and link Nagios Apache configuration
Step31:- sudo cp /etc/apache2/conf.d/nagios.conf /etc/apache2/sites-available/nagios
Step32:- sudo ln -s /etc/apache2/sites-available/nagios /etc/apache2/sites-enabled/nagios
14. Check Nagios configuration for errors
Step33:- sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
15. Make Nagios and Apache start at boot
Step34:- sudo ln -s /etc/init.d/nagios /etc/rcS.d/S98nagios
Step35:- sudo ln -s /etc/init.d/apache2 /etc/rcS.d/S99apache2
Step36:- chkconfig -add nagios
Step37:- chkconfig nagios on
16. Start Nagios Core 4.0.7 Service
step38 :- sudo service nagios start
17. Start Apache Service
step39 :- 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.
Step40:- 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.
Step41:- sudo nano /usr/local/nagios/etc/cgi.cfg
Step42:- sudo service nagios restart
NOTE :- For Any Clarification Please Comment Below
Thanking You
Hope U Like it........