Nagios Monitoring Tool Installation

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

Nagios monitoring tool

Server Nagios:
Step1:
Installing the Nagios ,Nagios-plugins-all
, Nagios-plugins-nrpe .
Step2:
 Enabling the service Nagios
 check you installed the http
 added the port 80 in firewall or
disable it…
Step3:
After enabling the service you can login
the url by,
 http://192.168.5.11/nagios
your server ip addresses
Step4:
Username: nagiosadmin
Password: (empty)
To set the password,
 htpasswd –c /etc/nagios/passwd
nagiosadmin
now my ,
username: nagiosadmin
password: redhat123
Step5:
If you need a custom directory instead
of ,
http://192.168.5.11/nagios
u have to change it in the configuration
file called…
 vi /etc/httpd/conf.d/nagios.conf
 before that check your version of
httpd

You are having the version of 2.4.6


So that you have to edit the content
according to your version….
So in Alias u have to mention the
name which you want….

Then,
Require all granted
If you enable this , think that you are
having the PUBLIC IPADDRESS
every one can access this Nagios
page …..
You want specific person to access
the page(url), you can enable this

Require host 192.168.5.11

Do edit the proper version of


Nagios….

Step6:

 vi /etc/nagios/nagios.cfg
this file is your complete Nagios
configuration file….
LINE18: /var/log/nagios/nagios.log
log file on server side
LINE29:
/etc/nagios/objects/commands.cfg
Plugins we install that will executed by
command which is present in this
commands.cfg file…
LINE30
/etc/nagios/objects/contacts.cfg
Failover alert and whom you want to
contact that will be stored in the
contacts file
LINE31
/etc/nagios/objects/timeperiods.cfg
It will be default we are not going to
change in this …
LINE32
/etc/nagios/objects/templates.cfg
Your view about the page…

Step7:

You adding the client to the server to


monitor that time if you comment in
the cfg_dir=/etc/Nagios/servers , it will
not read this file so your client can’t be
monitored…
This check_external_commands=1 then
only it will enable the values if you set
to 0 it wont enable…

Step8:

The flow of the configuration files,


1.Nagios.cfg --- main config file
2.objects/
 commands.cfg
This file having the variable

contacts.cfg
localhost.cfg
This file having the values…sometimes
you will specify the values in the client
nodes itself
[ we have to create this directory when
you enabled in Nagios.cfg file]
templates.cfg
This will denote the information about
screen …how to need the Nagios page
3.servers/
node1.cfg(for node1 machine)
node2.cfg(for node2 machine)
Till you can add n number of
machines…..

In that node1.cfg:

define host{
use linux-server
host_name node1
alias node1
address 192.168.5.12
max_check_attempts 2
normal_check_interval 10
retry_check_interval 1
notification_interval 5
}
define service{
use generic-service
host_name node1
service_description PING
check_command
check_ping!100.0,20%!500.0,60%
}

# for free disk

define service{
use generic-service
host_name node1
service_description Root Partition
check_command
check_nrpe!check_sda2
#\!20%\!10%\!/
}

define service{
use generic-service
host_name node1
service_description Boot Partition
check_command
check_nrpe!check_sda1
#\!20%\!10%\!/
}
define service{
use generic-service
host_name node1
service_description Httpd_service
check_command
check_nrpe!check_httpd
#\!20%\!10%\!/
}
# for current users

define service{
use generic-service
host_name node1
service_description Current Users
check_command
check_nrpe!check_users\!20\!50
}

# for total processes

define service{
use generic-service
host_name node1
service_description Total Processes
check_command
check_nrpe!check_total_procs
#\!250\!400\!RSZDT
}
# for current load

define service{
use generic-service
host_name node1
service_description Current Load
check_command
check_nrpe!check_load\!5.0,4.0,3.0\!10
.0,6.0,4.0

define service{
use generic-service
host_name node1
service_description HTTP
check_command
check_nrpe!check_http
notifications_enabled 1
##(notification will be enabled while
giving 1)
}
}
Like this you can monitor n number of
service in each nodes…

To communicate the server with client


we need plugins for that we are adding
the content in
/etc/nagios/objects/commands.cfg
Here we are seeing the $USER and
$HOSTADDRESS and $ARG …what
it mean????

 systemctl restart nagios


restart the Nagios service nad check in
the url…..

http://192.168.5.11/vaishu
CLIENT CONFIGURATION:
In client side you have to install the
following package,
 yum install Nagios-plugins-all nrpe
-y
 systemctl enable nrpe
 systemctl start nrpe
After the installation,
 vi /etc/nagios/nrpe
These plugins are linked with the server
and the values are applied to the
specific nodes…

You might also like