The document provides instructions for installing and configuring Nagios on an Ubuntu 15.04 server to monitor the localhost and other servers. It outlines steps to install required packages like Apache, MySQL, PHP, SNMP and Nagios. It also explains how to add users, configure hosts and services, edit configuration files, restart services and access the Nagios web interface.
1. How install Nagios in Ubuntu 15.04
To setup Nagios your Ubuntu serve with the help of given below command you
must be install servers like this. But you need update server before, install
server.
# apt-get update
# apt-get install apache2 -y mysql-server-5.6 php5 libapache2-mod-php5
During the installing process, you will be asked to configure the password of
MySQL server. Press “OK” after setting up the password and then repeat the
same upon next prompt.
2. We need to install the few other packages that are necessary for fully
functional Nagios setup and to monitor the “localhost”. Run the below
command to install these packages on Ubuntu.
# apt-get install -y snmp snmpd rrdtool
To easy in configure nagios you should install VIM.
# apt-get install vim
3. gu then you are need install server monitoring packages for function on
localhost, you are have rights in chose versions monitoring following type as
well as nagios3 nagios4 and a lots. Right now I’ll show about Nagios3. Run the
below command to install.
# apt-get install –y nagios-nrpe-plugin
4. # apt-get install –y nagios3 nagios-nrpe-plugin
Press on Tab to contiues.
5. Click on internet site and then press on Tab to continue.
For mail name you can put your email and press Tab to continue.
7. You’ll be asked to enter a password for the nagiosadmin user. The user’s
credentials are stored in /etc/nagios3/htpasswd.users. Run the below
command.
# htpasswd –c /etc/nagio3/htpasswd.users nagiosadmin
For adding a user into localhost run the below command.
# htpasswd –c /etc/nagio3/htpasswd.users steve
8. By default Nagios in configured to check HTTP, disk space. SSH, current users,
processes, and load on the localhost. Nagios will also ping check the gateway.
# cd /etc/nagios3/con.d
Create host for file on server2.
# cp localhost_nagios2.cfg TP-S1.cfg
9. Edit host.
# vim TP-S1.cfg
And then save and exit.
Restart nagios3 service for new configuration.
# systemctl restart nagios3.service
Testing on browser.
For log into browser you can write hostname or IP address up to you.
For example, http://machine/nagios3 or http://192.168.44.170/nagios3
10.
11.
12. If your process monitoring has problem ERROE, please into
hostgroups_nagios2.cfg and then close hostgroup by use assign # in front of.
For example # vim hostgroup_nagios2.cfg
How to add parents to host other you do like this.
# vim TP-S1.cfg
How to add picture to host by, run below command.
#c vim TP-S1.cfg