0% found this document useful (0 votes)
599 views2 pages

Nagios Full Notes

Nagios is an open source network monitoring tool that monitors servers, switches, applications and services. It alerts administrators when issues arise and when they are resolved. To set up Nagios, it must be installed on a server along with required packages. Users, groups and configuration files are then set up. Nagios is configured to monitor specific hosts by defining them along with the services to check on each host like CPU usage, disk space and ping response.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
599 views2 pages

Nagios Full Notes

Nagios is an open source network monitoring tool that monitors servers, switches, applications and services. It alerts administrators when issues arise and when they are resolved. To set up Nagios, it must be installed on a server along with required packages. Users, groups and configuration files are then set up. Nagios is configured to monitor specific hosts by defining them along with the services to check on each host like CPU usage, disk space and ping response.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Nagios

Nagios is an open source software that can be used for network and infrastructure monitoring.
Nagios will monitor servers, switches, applications and services.
It alerts the System Administrator when something went wrong and also alerts back when the issues have been
rectified.

Features
 Monitor your entire IT infrastructure.
 Identify problems before they occur.
 Know immediately when problems arise.
 Share availability data with stakeholders.
 Detect security breaches.
 Reduce downtime and business losses.

Server Side: Pre requisites for Nagios Server Configuration

yum install –y httpd php wget gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd unzip

Start Webserver

systemctl enable httpd


systemctl start httpd

6
User and Group Creation for Nagios

12
useradd nagios

25
passwd nagios

groupadd nagcmd (nagcmd group for allowing external commands to be submitted through the web interface.)

7
usermod -a -G nagcmd nagios

66
usermod -a -G nagcmd apache

Download Nagios Package and Plugins:

mkdir /nagios
cd /nagios/
, 98
06
curl -L -O https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
(Before Downloading check for latest package)
0

tar xvf nagios-*.tar.gz


22

cd nagios-*
5

./configure --with-command-group=nagcmd
91

make all
make install
make install-commandmode
92

make install-init
make install-config
make install-webconf
om

curl -L -O http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz

tar xvf nagios-plugins-*.tar.gz


cd nagios-plugins-*
s.c

./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl


ab

make
make install
tl
of

curl -L -O http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
rs

tar xvf nrpe-*.tar.gz


cd nrpe-*
te

./configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-


.en

ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu

make all
w

make install
make install-xinetd
w

make install-daemon-config
w

vi /etc/xinetd.d/nrpe

only_from = 127.0.0.1 <Add your Nagios Server IP>

systemctl enable xinetd


systemctl start xinetd

vi /usr/local/nagios/etc/nagios.cfg

Uncomment the below line


#cfg_dir=/usr/local/nagios/etc/servers

mkdir /usr/local/nagios/etc/servers

vi /usr/local/nagios/etc/objects/contacts.cfg

email nagios@<localhost or ur domain> ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS


******

EntersoftLabs , #103,First Floor,In HUDA Maitrivanam Building,Ameerpet,Hyderabad-500038


040-30423415, 98667 25126 https://www.entersoftlabs.com. [email protected]
We Offer Red Hat Training and Certifications,Certified Ethical Hacker v9(CEH), Web Application Penetration Testing and Advanced Courses
Configure check_nrpe Command

vi /usr/local/nagios/etc/objects/commands.cfg
Add this at the end of the file

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

Configure Apache
Use htpasswd to create an admin user, called "nagiosadmin", that can access the Nagios web interface:

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

systemctl start nagios.service


chkconfig nagios on

systemctl restart httpd.service


systemctl enable httpd.service

systemctl status nagios

6
http://nagios_server_ip/nagios

12
To Monitor a Host with NRPE

25
Note: Repeat this section for each server you wish to monitor

7
On a host that you want to monitor, install the EPEL repository:

66
yum install epel-release
yum install nrpe nagios-plugins-all

vi /etc/nagios/nrpe.cfg
allowed_hosts=127.0.0.1,<Private / pub IP of your Nagios Server>
, 98
06
systemctl enable nrpe.service
systemctl start nrpe.service
0
22

Once you are done installing and configuring NRPE on the hosts that you want to monitor, you will have to add these
hosts to your Nagios server configuration before it will start monitoring them.
5

On your Nagios server


91

vi /usr/local/nagios/etc/servers/yourhost.cfg
92

define host {
use linux-server
host_name Remote host Name to be monitored
alias My first Apache server
address <IP Address of Remote host to be monitored>
om

max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
s.c

}
ab

If you want to monitor particular Service (If you're not sure what use generic-service means, it is simply inheriting the values of a service
template called "generic-service" that is defined by default.)
tl

define service {
of

use generic-service
host_name Remote host Name to be monitored
service_description PING
rs

check_command check_ping!100.0,20%!500.0,60%
}
te

define service {
.en

use generic-service
host_name Remote host Name to be monitored
service_description SSH
check_command check_ssh
w

notifications_enabled 0
}
w
w

systemctl reload nagios.service

http://nagios_server_ip/nagios

EntersoftLabs , #103,First Floor,In HUDA Maitrivanam Building,Ameerpet,Hyderabad-500038


040-30423415, 98667 25126 https://www.entersoftlabs.com. [email protected]
We Offer Red Hat Training and Certifications,Certified Ethical Hacker v9(CEH), Web Application Penetration Testing and Advanced Courses

You might also like