SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
DATACENTER MANAGEMENT NAGIOS CONFIGURATION
Submitted By
Pankaj U. Rane (120851923024)
P.Venkatesh(120851923027)

Install and configure Nagios on Fedora Core 8 (VM or Physical Machine)
Monitor the following:
>> Local Machine
>> Remote Linux Machine (preferably Fedora) – Hostname to be displayed as “LINUX1”
>> Remote Windows Machine – Hostname to be displayed as “WIN1”
>> Remote Website – Name to be displayed as “MYWEBSITE”
*** MONITORING THE WINDOWS MACHINE***
To achieve this , we need to install an agent on the WINDOWS Machine.
Agent acts as a proxy between the Nagios Plugin that does the monitoring and the
actual service or attribute of the windows machine.
Client used for this user manual is NSClient++
The check_nt plugin will be used to communicate with the NSClient++
Steps involved:
Perform first-time pre-requisite.
Install monitoring agent on the Windows Machine.
Create new host and service definitions for monitoring the Windows Machine.
Restart the Nagios daemon.
Download the NSClient++ installer package from www.nsclient.org to the target
machine you wish to install it on.
Run the NSClient++ MSI installer package to initiate the installation. The welcome
screen will appear. Click Next to continue to the next step.
Read through the End User License Agreement.
Once you have agreed to itsterms, check the acceptance box and click Next to
continue.
You may customize the installation options on the next screen if you wish. No
changes are required for an working installation of the agent. Click Next to continue.
If an existing NSClient++ installation exists on the target machine, you will have the
option of using the old configuration file. This option is not enable if this is the first
time you are installing the client. Click Next to continue.
In the next step you will need to configure the NSClient++ agent. These steps
are important! Make sure you: Enter the IP address of the Nagios XI or Nagios
Core server in the Allowed hosts box.
Enter a password in the NSClient password box that will be required for
communication between the Nagios server and the Windows machine.
Check the following boxes in the Modules to load section:
Enable common check plugins Enable , nsclient server (check_nt) , NRPE server
and WMI checks. Click Next to continue.
Click the Install button on the next screen to begin the installation.
When the installation completes, make sure to check the Start service option and click
Finish to complete the setup.
The NSClient++ agent will now be running as a service, which means the Windows
machine is ready to be monitored with Nagios.
And now to Start->Run->cmd->services.msc and click on NSClient++ and select
the Logon tab and enable “Allow service to interact with desktop” and click “OK”
and Restart the NSClient++ service.
NOW CONFIGURE FEDORA TO MONITOR WINDOWS
#nano /usr/local/nagios/etc/nagios.cfg
# Definitions for monitoring a Windows Machine
cfg_file=/usr/local/nagios/etc/objects/windows.cfg
uncomment the cfg_file and save nagios.cfg

*** NAGIOS SERVER INSTALLATION***
Before installing Nagios server check the pre-requistives :
apache - #yum list installed | grep httpd
php
- #yum list installed | grep php
gcc compiler - # yum list installed | grep gcc
GD Development libraries - # yum list installed | grep gcc
net-snmp - # yum list installed | grep net-snmp (if not installed #yum install net-snmp)
Server Installation of Nagios :
Step1 : Create and manage account and group
a) Make sure you are in “root”
b) Create a new nagios user and give it a password
#whoami
root
#cat /etc/passwd
#useradd –m nagios ( -m : To create a user in home dir)
#ls /home/
nagios
#passwd nagios ( Set the password the nagios user)

c) Check if a group exist with the nagios name.
#cat /etc/group
#cat /etc/group | cut –d”:” –f1 | sort –u | less
nagios
d) Create a new nagcmd group for allowing external commands to be submitted through the
web interface.
#groupadd nagcmd
#cat /etc/group | grep nagcmd
nagcmd:x:502
e) Add both the nagios user and the apache user to the group.
#usermod –a –G nagcmd nagios
#usermod –a –G nagcmd apache
#cat /etc/group | grep nagcmd
nagcmd:x:502:nagios,apache
f) Download Nagios and Plugin Source Code.
nagios-3.4.1.tar.gz
nagios-plugins-1.4.16
g) Compile and install nagios
i) Extract the nagios source code tarball.
#tar xzf nagios-3.4.1.tar.gz
#ls –l
nagios-3.4.1
#cd nagios-3.4.1
nagios>#ls
ii) Run the nagios configure script, passing the name of the group you created earlier.
nagios>#./configure - -with-command-group=nagcmd
iii) Compile the nagios source code
nagios>#make all
iv) Install binaries , init scripts , sample config files and set permissions on the external
command directory.
nagios># make install
nagios># make install-init
nagios># make install-config
nagios># make install-commandmode
v) Configuration customization
#nano /usr/local/nagios/etc/objects/contact.cfg
Define contact {
email
pankaj.rane2k8@gmail.com ; (Note: should be type in single line)
and save contact.cfg
vi) Configure the web interface
a) Install the nagios web config file in the Apache conf.d directory.
nagios># make install-webconf
b) Install the classic theme for the nagios web interface
nagios># make install-classicui
c) Create a nagiosadmin account for loggin into the nagios web interface.
Note : Remember the password of nagiosadmin
We will use the htpasswd for this , htpasswd is used to create and update the flat-files used to
store usernames and passwords for basic authentication of HTTP users.
#htpasswd –c /usr/local/nagios/etc/htpasswd.users
nagiosadmin
New passwd:nagiosadmin123
Re-type passwd:nagiosadmin123
#service httpd restart
#cd .. ( come out of nagios folder)
#ls –l
#tar xzf nagios-plugin.tar.gz
#cd nagios-plugin
#./configure - -with-nagios-user=nagios - -with-nagios-group=nagios
#make
#make install
d) Start Nagios
Add nagios to the list of system services and have it automatically start when the system boots.
#chkconfig - -add nagios
#chkconfig nagios on
The chkconfig command updates and queries runlevel information for system services.
Verify the sample nagios configuration files.
nagios-plugin>#/usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/nagios.cfg
0 warnings
0 Errors
#service nagios start
SE-linux is in enforcing mode make it disabled.
#getenforce
Permissive
#setenforce 0 - To disable
Go to browser http://localhost/nagios/
Username : nagiosadmin
Password:nagiosadmin123

*** MONITORING THE REMOTE LINUX MACHINE***
How to?
Use the NRPE daemon to execute Nagios plugins on the remote server and report back to the
monitoring host server.NRPE-Nagios Remote Plugin Executor.
Step1: Remote server installation and setup ( Nagios client)
Check openssl-devel is installed
#yum list installed | grep openssl-devel
Create nagios user account on remote server to be monitored
#useradd nagios
#passwd nagios
New passwd:Password1234
Download and install Nagios Plugin nagios-plugin-1.4.16.tar.gz
#tar xzf nagios-plugin-1.4.16.tar.gz
#cd nagios-plugin-1.4.16
#./configure - -with-nagios-user=nagios - -with-nagios-group=nagios
#make
#make install
Change the permissions on the plugins directory and the plugins to the nagios user.
nagios-plugin>#chown nagios.nagios /usr/local/nagios/
nagios-plugin>#chown nagios.nagios /usr/local/nagios/libexec/
Install xinetd package
nagios-plugin>#yum install xinetd
#cd . .
Download nrpe-2.13.tar.gz
#tar zxf nrpe-2.13.tar.gz
#cd nrpe-2.13
#./configure
#make all
#make install-plugin
#make install-daemon
#make install-daemon-config
#make install-xinetd
POST NRPE Configuration
Edit xinetd NRPE Entry:
Add nagios monitoring server to the “only_from” directive:
nrpe>#nano /etc/xinetd.d/nrpe
only_from = 127.0.0.1 192.168.145.132
EDIT SERVICES FILE ENTRY
Add entry for nrpe daemon:
nrpe>#nano /etc/services
go to bottom and write
nrpe

5666/tcp

and save services
Restart xinetd and set to start at boot
nrpe>#chkconfig xinetd on
nrpe>#service xinetd start
#netstat –antp | grep 5666
If you can‟t see the service disable SE Linux

#NRPE
#nano /etc/selinux/config
Set to be disabled , if it is permissive - Restart the system
#service xinetd restart
#netstat –antp | grep 5666

Check NRPE daemon is functioning
#/usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.13
#/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1
Disk OK – free space:/boot 167MB(93% inode=99%);
-w 20% (Warning)
-c 10% (Critical Warning)
-p /dev/sda1 (Parameter passing primary storage)
***NOW GO TO NAGIOS SERVER***
Download NRPE into the server, compile and configure NRPE
#tar xzf nrpe.tar.gz
#cd nrpe
nrpe>#./configure
nrpe>#make all
nrpe>#make install-plugin
CREATE NRPE COMMAND DEFINITION
A command definition needs to be created in order for the check_nrpe plugin to be used by
nagios.
#nano /usr/local/nagios/etc/objects/commands.cfg
#######################################
# NRPE CHECK COMMAND
# Command to use NRPE to check remote host
######################################
define command{
command_name check_nrpe
command_line

$USER1$check_nrpe -H $HOSTADDRESS$ -c $ARG1$

}
#######################################
# CHECK WEBSITE RESPONSE
# Command to check public service
######################################
# „check_website_response‟ command definition
define command{
command_name check_website_response
command_line $USER1$/check_website_response.sh –u $ARG1$ -w $ARG2$ -c $ARG3$
}
And save the commands.cfg
Create new linux-box-remote object template file:
#nano /usr/local/nagios/etc/objects/linux-box-remote.cfg
define host {
name linux-box-remote

; None of this template

use

; Inherit default values

generic-host

check_period

24x7

check_interval

5

retry_interval

1

max_check_attempts

10

check_command

check-host-alive

notification_period

24x7
notification_interval

30

notification_options

d,r

contact_groups

admins

register

0

; DO NOT REGISTER TIS-IT IS A TEMPLATE

}
define host{
use

linux-box-remote

; Inherit default values from template

host_name

LINUX1

; Remote Linux Server

alias

Fedora

; Alias Name

address

192.168.145.134

; IP

}
define service{
use

generic-service

host_name

fc8

service_description

CPULoad

check_command

check_nrpe!check_load

}
Save linux-box-remote.cfg
ACTIVATE the linux-box-remote.cfg template
#nano /usr/local/nagios/etc/nagios.cfg
# Definitions for monitoring remote Linux machine
cfg_file=/usr/local/nagios/etc/objects/linux-box-remote.cfg
save nagios.cfg and exit
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
#service nagios restart
#service httpd restart
Open the browser http://localhost/nagios
Username: nagiosadmin
Password:Password123
Click on host

*** MONITORING PUBLICLY AVAILABLE SERVICES***
Examples of Pubic Services – HTTP , POP3 , IMAP etc
#cd /usr/local/nagios/libexec
(All the commands are stored in this path)
Copy check_website_response.sh to /usr/local/nagios/libexec
Add the following lines to nagios.cfg
# Definitions for monitoring Public Service
Cfg_file=/usr/local/nagios/etc/objects/publichost.cfg
Add the following to the /usr/local/nagios/etc/objects/commands.cfg
# „check_website_response‟ command definition
Define command {
Command_name

check_website_response

Command_line $USER1$/check_website_response.sh –u $ARG1$ -w $ARG2$ -c
$ARG3$
}
#cd /usr/local/nagios/libexec
libexec>#ls –l check_website_response.sh
#chmod 755 check_website_response.sh
#./ check_website_response.sh
# check_website_response.sh –w 1000 –c 2000 –u http://192.168.1.181/
RESPONSE:OK
Create the file publichost.cfg under the path /usr/local/nagios/etc/objects
define host

{

use

generic-host

; Inherit default values from a template

host_name

MYWEBSITE ; Website Name

max_check_attempts 3
contact_groups

admins

}
define service {
host_name

MYWEBSITE

service_description

Website Response : www.mywebsite.in

check_command

check_website_response!"http://192.168.1.181/"!1000!2000

max_check_attempts 5
check_interval

1

retry_interval

1

check_period

24x7

}
Save publichost.cfg
TESTING
#/usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/nagios.cfg
#service nagios restart
Go to browser http://localhost/nagios
Username: nagiosadmin
Password:Password123
Click on Host and Services

Mais conteúdo relacionado

Mais procurados

Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-apiEric Ahn
 
Docker command
Docker commandDocker command
Docker commandEric Ahn
 
Webinar: Automate IBM Connections Installations and more
Webinar: Automate IBM Connections Installations and moreWebinar: Automate IBM Connections Installations and more
Webinar: Automate IBM Connections Installations and morepanagenda
 
How to install nginx vs unicorn
How to install nginx vs unicornHow to install nginx vs unicorn
How to install nginx vs unicornbaran19901990
 
Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...
Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...
Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...OW2
 
Passwordless login with unix auth_socket
Passwordless login with unix auth_socketPasswordless login with unix auth_socket
Passwordless login with unix auth_socketOtto Kekäläinen
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from githubAntony Gitomeh
 
Odoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvOdoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvacsone
 
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PSSitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PSPeter Nazarov
 
How to Install Odoo 11 on Ubuntu 16.04?
How to Install Odoo 11 on Ubuntu 16.04?How to Install Odoo 11 on Ubuntu 16.04?
How to Install Odoo 11 on Ubuntu 16.04?Celine George
 
Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...Otto Kekäläinen
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про HerokuSerge Seletskyy
 
How to install squid proxy on server or how to install squid proxy on centos o
How to install squid proxy on server  or how to install squid proxy on centos oHow to install squid proxy on server  or how to install squid proxy on centos o
How to install squid proxy on server or how to install squid proxy on centos oProxiesforrent
 
Ajenti control panel
Ajenti control panel Ajenti control panel
Ajenti control panel chacheng_dbl
 

Mais procurados (18)

Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Docker command
Docker commandDocker command
Docker command
 
Webinar: Automate IBM Connections Installations and more
Webinar: Automate IBM Connections Installations and moreWebinar: Automate IBM Connections Installations and more
Webinar: Automate IBM Connections Installations and more
 
Installing GravCMS
Installing GravCMSInstalling GravCMS
Installing GravCMS
 
How to install nginx vs unicorn
How to install nginx vs unicornHow to install nginx vs unicorn
How to install nginx vs unicorn
 
Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...
Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...
Hammr Project Update: Machine Images and Docker Containers for your Cloud, OW...
 
Passwordless login with unix auth_socket
Passwordless login with unix auth_socketPasswordless login with unix auth_socket
Passwordless login with unix auth_socket
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
 
Hadoop presentation
Hadoop presentationHadoop presentation
Hadoop presentation
 
Odoo V8 Installation
Odoo V8 InstallationOdoo V8 Installation
Odoo V8 Installation
 
Odoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvOdoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenv
 
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PSSitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
 
How to Install Odoo 11 on Ubuntu 16.04?
How to Install Odoo 11 on Ubuntu 16.04?How to Install Odoo 11 on Ubuntu 16.04?
How to Install Odoo 11 on Ubuntu 16.04?
 
Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...Less passwords, more security: unix socket authentication and other MariaDB h...
Less passwords, more security: unix socket authentication and other MariaDB h...
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про Heroku
 
How to install squid proxy on server or how to install squid proxy on centos o
How to install squid proxy on server  or how to install squid proxy on centos oHow to install squid proxy on server  or how to install squid proxy on centos o
How to install squid proxy on server or how to install squid proxy on centos o
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
Ajenti control panel
Ajenti control panel Ajenti control panel
Ajenti control panel
 

Destaque

BGP Protocol Makes the Internet Work
BGP Protocol Makes the Internet WorkBGP Protocol Makes the Internet Work
BGP Protocol Makes the Internet WorkIT Tech
 
5. mrtg in nagios1 0
5. mrtg in nagios1 05. mrtg in nagios1 0
5. mrtg in nagios1 0aqpjuan
 
Cisco switch selector layer2 or layer3
Cisco switch selector layer2 or layer3Cisco switch selector layer2 or layer3
Cisco switch selector layer2 or layer3IT Tech
 
Network protocols
Network protocolsNetwork protocols
Network protocolsIT Tech
 
The feature licenses available for main cisco asa 5500 models
The feature licenses available for main cisco asa 5500 modelsThe feature licenses available for main cisco asa 5500 models
The feature licenses available for main cisco asa 5500 modelsIT Tech
 
How to configure flexible netflow export on cisco routers
How to configure flexible netflow export on cisco routersHow to configure flexible netflow export on cisco routers
How to configure flexible netflow export on cisco routersIT Tech
 
Ordering guide for cisco isr g2
Ordering guide for cisco isr g2Ordering guide for cisco isr g2
Ordering guide for cisco isr g2IT Tech
 
Computer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardwareComputer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardwareShripal Oswal
 
GTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesGTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesTOPS Technologies
 
Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...IT Tech
 
Plugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlowPlugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlowNetFlow Analyzer
 
How to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco RoutersHow to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco RoutersSolarWinds
 
Central management of network and call services
Central management of network and call servicesCentral management of network and call services
Central management of network and call servicesNazmul Hossain Rakib
 
Line cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switchesLine cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switchesIT Tech
 
Packet Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-logPacket Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-logRafat Khandaker
 

Destaque (18)

Nagios nrpe
Nagios nrpeNagios nrpe
Nagios nrpe
 
BGP Protocol Makes the Internet Work
BGP Protocol Makes the Internet WorkBGP Protocol Makes the Internet Work
BGP Protocol Makes the Internet Work
 
5. mrtg in nagios1 0
5. mrtg in nagios1 05. mrtg in nagios1 0
5. mrtg in nagios1 0
 
Cisco switch selector layer2 or layer3
Cisco switch selector layer2 or layer3Cisco switch selector layer2 or layer3
Cisco switch selector layer2 or layer3
 
Network protocols
Network protocolsNetwork protocols
Network protocols
 
Nagios
NagiosNagios
Nagios
 
The feature licenses available for main cisco asa 5500 models
The feature licenses available for main cisco asa 5500 modelsThe feature licenses available for main cisco asa 5500 models
The feature licenses available for main cisco asa 5500 models
 
How to configure flexible netflow export on cisco routers
How to configure flexible netflow export on cisco routersHow to configure flexible netflow export on cisco routers
How to configure flexible netflow export on cisco routers
 
Ordering guide for cisco isr g2
Ordering guide for cisco isr g2Ordering guide for cisco isr g2
Ordering guide for cisco isr g2
 
Computer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardwareComputer repair -_a_complete_illustrated_guide_to_pc_hardware
Computer repair -_a_complete_illustrated_guide_to_pc_hardware
 
GTU PHP Project Training Guidelines
GTU PHP Project Training GuidelinesGTU PHP Project Training Guidelines
GTU PHP Project Training Guidelines
 
Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...Licensing on Cisco 2960, 3560X and 3750X...
Licensing on Cisco 2960, 3560X and 3750X...
 
Plugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlowPlugging Network Security Holes Using NetFlow
Plugging Network Security Holes Using NetFlow
 
How to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco RoutersHow to Configure NetFlow v5 & v9 on Cisco Routers
How to Configure NetFlow v5 & v9 on Cisco Routers
 
Central management of network and call services
Central management of network and call servicesCentral management of network and call services
Central management of network and call services
 
Line cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switchesLine cards that are available for cisco catalyst 4500 series switches
Line cards that are available for cisco catalyst 4500 series switches
 
Packet Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-logPacket Tracer: SNMP, Netflow, Sys-log
Packet Tracer: SNMP, Netflow, Sys-log
 
Netflow slides
Netflow slidesNetflow slides
Netflow slides
 

Semelhante a How to configure Nagios in Fedora ?

How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04Vanda KANY
 
Install nagios
Install nagiosInstall nagios
Install nagioshassandb
 
Install nagios
Install nagiosInstall nagios
Install nagioshassandb
 
Install nagios
Install nagiosInstall nagios
Install nagioshassandb
 
Learning Nagios module 1
Learning Nagios module 1Learning Nagios module 1
Learning Nagios module 1Jayant Chutke
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleChanaka Lasantha
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNagios
 
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.Marc Trimble
 
Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04SANTIAGO HERNÁNDEZ
 
Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installationfranbow
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingBeni Krisbiantoro
 
EMC Networker installation Document
EMC Networker installation DocumentEMC Networker installation Document
EMC Networker installation Documentuzzal basak
 
Install Nagios Core On CentOS 7
Install Nagios Core On CentOS 7Install Nagios Core On CentOS 7
Install Nagios Core On CentOS 7sharad chhetri
 
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMPHow To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMPMatt Dunlap
 
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...JohnWilson47710
 

Semelhante a How to configure Nagios in Fedora ? (20)

How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04How install nagios in ubuntu 15.04, 16.04
How install nagios in ubuntu 15.04, 16.04
 
Install nagios
Install nagiosInstall nagios
Install nagios
 
Install nagios
Install nagiosInstall nagios
Install nagios
 
Install nagios
Install nagiosInstall nagios
Install nagios
 
Learning Nagios module 1
Learning Nagios module 1Learning Nagios module 1
Learning Nagios module 1
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmaple
 
nuxt-en.pdf
nuxt-en.pdfnuxt-en.pdf
nuxt-en.pdf
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
 
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
 
Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04Tested install-isp config3-ubuntu-16-04
Tested install-isp config3-ubuntu-16-04
 
Lamp Server With Drupal Installation
Lamp Server With Drupal InstallationLamp Server With Drupal Installation
Lamp Server With Drupal Installation
 
Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
 
Nagios intro
Nagios intro Nagios intro
Nagios intro
 
EMC Networker installation Document
EMC Networker installation DocumentEMC Networker installation Document
EMC Networker installation Document
 
Install Nagios Core On CentOS 7
Install Nagios Core On CentOS 7Install Nagios Core On CentOS 7
Install Nagios Core On CentOS 7
 
Howto Pxeboot
Howto PxebootHowto Pxeboot
Howto Pxeboot
 
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMPHow To Deploy A Cloud Based Webserver in 5 minutes - LAMP
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
 
Linux
LinuxLinux
Linux
 
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
 
Nrpe
NrpeNrpe
Nrpe
 

Último

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Último (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

How to configure Nagios in Fedora ?

  • 1. DATACENTER MANAGEMENT NAGIOS CONFIGURATION Submitted By Pankaj U. Rane (120851923024) P.Venkatesh(120851923027) Install and configure Nagios on Fedora Core 8 (VM or Physical Machine) Monitor the following: >> Local Machine >> Remote Linux Machine (preferably Fedora) – Hostname to be displayed as “LINUX1” >> Remote Windows Machine – Hostname to be displayed as “WIN1” >> Remote Website – Name to be displayed as “MYWEBSITE” *** MONITORING THE WINDOWS MACHINE*** To achieve this , we need to install an agent on the WINDOWS Machine. Agent acts as a proxy between the Nagios Plugin that does the monitoring and the actual service or attribute of the windows machine. Client used for this user manual is NSClient++ The check_nt plugin will be used to communicate with the NSClient++ Steps involved: Perform first-time pre-requisite. Install monitoring agent on the Windows Machine. Create new host and service definitions for monitoring the Windows Machine. Restart the Nagios daemon. Download the NSClient++ installer package from www.nsclient.org to the target machine you wish to install it on. Run the NSClient++ MSI installer package to initiate the installation. The welcome screen will appear. Click Next to continue to the next step. Read through the End User License Agreement. Once you have agreed to itsterms, check the acceptance box and click Next to continue. You may customize the installation options on the next screen if you wish. No changes are required for an working installation of the agent. Click Next to continue.
  • 2. If an existing NSClient++ installation exists on the target machine, you will have the option of using the old configuration file. This option is not enable if this is the first time you are installing the client. Click Next to continue. In the next step you will need to configure the NSClient++ agent. These steps are important! Make sure you: Enter the IP address of the Nagios XI or Nagios Core server in the Allowed hosts box. Enter a password in the NSClient password box that will be required for communication between the Nagios server and the Windows machine. Check the following boxes in the Modules to load section: Enable common check plugins Enable , nsclient server (check_nt) , NRPE server and WMI checks. Click Next to continue. Click the Install button on the next screen to begin the installation. When the installation completes, make sure to check the Start service option and click Finish to complete the setup. The NSClient++ agent will now be running as a service, which means the Windows machine is ready to be monitored with Nagios. And now to Start->Run->cmd->services.msc and click on NSClient++ and select the Logon tab and enable “Allow service to interact with desktop” and click “OK” and Restart the NSClient++ service. NOW CONFIGURE FEDORA TO MONITOR WINDOWS #nano /usr/local/nagios/etc/nagios.cfg # Definitions for monitoring a Windows Machine cfg_file=/usr/local/nagios/etc/objects/windows.cfg uncomment the cfg_file and save nagios.cfg *** NAGIOS SERVER INSTALLATION*** Before installing Nagios server check the pre-requistives : apache - #yum list installed | grep httpd php - #yum list installed | grep php gcc compiler - # yum list installed | grep gcc GD Development libraries - # yum list installed | grep gcc net-snmp - # yum list installed | grep net-snmp (if not installed #yum install net-snmp) Server Installation of Nagios : Step1 : Create and manage account and group a) Make sure you are in “root” b) Create a new nagios user and give it a password #whoami
  • 3. root #cat /etc/passwd #useradd –m nagios ( -m : To create a user in home dir) #ls /home/ nagios #passwd nagios ( Set the password the nagios user) c) Check if a group exist with the nagios name. #cat /etc/group #cat /etc/group | cut –d”:” –f1 | sort –u | less nagios d) Create a new nagcmd group for allowing external commands to be submitted through the web interface. #groupadd nagcmd #cat /etc/group | grep nagcmd nagcmd:x:502 e) Add both the nagios user and the apache user to the group. #usermod –a –G nagcmd nagios #usermod –a –G nagcmd apache #cat /etc/group | grep nagcmd nagcmd:x:502:nagios,apache f) Download Nagios and Plugin Source Code. nagios-3.4.1.tar.gz nagios-plugins-1.4.16 g) Compile and install nagios i) Extract the nagios source code tarball. #tar xzf nagios-3.4.1.tar.gz #ls –l nagios-3.4.1 #cd nagios-3.4.1 nagios>#ls ii) Run the nagios configure script, passing the name of the group you created earlier. nagios>#./configure - -with-command-group=nagcmd iii) Compile the nagios source code nagios>#make all iv) Install binaries , init scripts , sample config files and set permissions on the external command directory. nagios># make install nagios># make install-init nagios># make install-config nagios># make install-commandmode v) Configuration customization
  • 4. #nano /usr/local/nagios/etc/objects/contact.cfg Define contact { email pankaj.rane2k8@gmail.com ; (Note: should be type in single line) and save contact.cfg vi) Configure the web interface a) Install the nagios web config file in the Apache conf.d directory. nagios># make install-webconf b) Install the classic theme for the nagios web interface nagios># make install-classicui c) Create a nagiosadmin account for loggin into the nagios web interface. Note : Remember the password of nagiosadmin We will use the htpasswd for this , htpasswd is used to create and update the flat-files used to store usernames and passwords for basic authentication of HTTP users. #htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin New passwd:nagiosadmin123 Re-type passwd:nagiosadmin123 #service httpd restart #cd .. ( come out of nagios folder) #ls –l #tar xzf nagios-plugin.tar.gz #cd nagios-plugin #./configure - -with-nagios-user=nagios - -with-nagios-group=nagios #make #make install d) Start Nagios Add nagios to the list of system services and have it automatically start when the system boots. #chkconfig - -add nagios #chkconfig nagios on The chkconfig command updates and queries runlevel information for system services. Verify the sample nagios configuration files. nagios-plugin>#/usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/nagios.cfg 0 warnings 0 Errors #service nagios start SE-linux is in enforcing mode make it disabled. #getenforce Permissive #setenforce 0 - To disable
  • 5. Go to browser http://localhost/nagios/ Username : nagiosadmin Password:nagiosadmin123 *** MONITORING THE REMOTE LINUX MACHINE*** How to? Use the NRPE daemon to execute Nagios plugins on the remote server and report back to the monitoring host server.NRPE-Nagios Remote Plugin Executor. Step1: Remote server installation and setup ( Nagios client) Check openssl-devel is installed #yum list installed | grep openssl-devel Create nagios user account on remote server to be monitored #useradd nagios #passwd nagios New passwd:Password1234 Download and install Nagios Plugin nagios-plugin-1.4.16.tar.gz #tar xzf nagios-plugin-1.4.16.tar.gz #cd nagios-plugin-1.4.16 #./configure - -with-nagios-user=nagios - -with-nagios-group=nagios #make #make install Change the permissions on the plugins directory and the plugins to the nagios user. nagios-plugin>#chown nagios.nagios /usr/local/nagios/ nagios-plugin>#chown nagios.nagios /usr/local/nagios/libexec/ Install xinetd package
  • 6. nagios-plugin>#yum install xinetd #cd . . Download nrpe-2.13.tar.gz #tar zxf nrpe-2.13.tar.gz #cd nrpe-2.13 #./configure #make all #make install-plugin #make install-daemon #make install-daemon-config #make install-xinetd POST NRPE Configuration Edit xinetd NRPE Entry: Add nagios monitoring server to the “only_from” directive: nrpe>#nano /etc/xinetd.d/nrpe only_from = 127.0.0.1 192.168.145.132 EDIT SERVICES FILE ENTRY Add entry for nrpe daemon: nrpe>#nano /etc/services go to bottom and write nrpe 5666/tcp and save services Restart xinetd and set to start at boot nrpe>#chkconfig xinetd on nrpe>#service xinetd start #netstat –antp | grep 5666 If you can‟t see the service disable SE Linux #NRPE
  • 7. #nano /etc/selinux/config Set to be disabled , if it is permissive - Restart the system #service xinetd restart #netstat –antp | grep 5666 Check NRPE daemon is functioning #/usr/local/nagios/libexec/check_nrpe -H localhost NRPE v2.13 #/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1 Disk OK – free space:/boot 167MB(93% inode=99%); -w 20% (Warning) -c 10% (Critical Warning) -p /dev/sda1 (Parameter passing primary storage) ***NOW GO TO NAGIOS SERVER*** Download NRPE into the server, compile and configure NRPE #tar xzf nrpe.tar.gz #cd nrpe nrpe>#./configure nrpe>#make all nrpe>#make install-plugin CREATE NRPE COMMAND DEFINITION A command definition needs to be created in order for the check_nrpe plugin to be used by nagios. #nano /usr/local/nagios/etc/objects/commands.cfg ####################################### # NRPE CHECK COMMAND
  • 8. # Command to use NRPE to check remote host ###################################### define command{ command_name check_nrpe command_line $USER1$check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } ####################################### # CHECK WEBSITE RESPONSE # Command to check public service ###################################### # „check_website_response‟ command definition define command{ command_name check_website_response command_line $USER1$/check_website_response.sh –u $ARG1$ -w $ARG2$ -c $ARG3$ } And save the commands.cfg Create new linux-box-remote object template file: #nano /usr/local/nagios/etc/objects/linux-box-remote.cfg define host { name linux-box-remote ; None of this template use ; Inherit default values generic-host check_period 24x7 check_interval 5 retry_interval 1 max_check_attempts 10 check_command check-host-alive notification_period 24x7
  • 9. notification_interval 30 notification_options d,r contact_groups admins register 0 ; DO NOT REGISTER TIS-IT IS A TEMPLATE } define host{ use linux-box-remote ; Inherit default values from template host_name LINUX1 ; Remote Linux Server alias Fedora ; Alias Name address 192.168.145.134 ; IP } define service{ use generic-service host_name fc8 service_description CPULoad check_command check_nrpe!check_load } Save linux-box-remote.cfg ACTIVATE the linux-box-remote.cfg template #nano /usr/local/nagios/etc/nagios.cfg # Definitions for monitoring remote Linux machine cfg_file=/usr/local/nagios/etc/objects/linux-box-remote.cfg save nagios.cfg and exit #/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg #service nagios restart #service httpd restart Open the browser http://localhost/nagios
  • 10. Username: nagiosadmin Password:Password123 Click on host *** MONITORING PUBLICLY AVAILABLE SERVICES*** Examples of Pubic Services – HTTP , POP3 , IMAP etc #cd /usr/local/nagios/libexec (All the commands are stored in this path) Copy check_website_response.sh to /usr/local/nagios/libexec Add the following lines to nagios.cfg # Definitions for monitoring Public Service Cfg_file=/usr/local/nagios/etc/objects/publichost.cfg Add the following to the /usr/local/nagios/etc/objects/commands.cfg # „check_website_response‟ command definition Define command { Command_name check_website_response Command_line $USER1$/check_website_response.sh –u $ARG1$ -w $ARG2$ -c $ARG3$ } #cd /usr/local/nagios/libexec libexec>#ls –l check_website_response.sh #chmod 755 check_website_response.sh #./ check_website_response.sh # check_website_response.sh –w 1000 –c 2000 –u http://192.168.1.181/ RESPONSE:OK
  • 11. Create the file publichost.cfg under the path /usr/local/nagios/etc/objects define host { use generic-host ; Inherit default values from a template host_name MYWEBSITE ; Website Name max_check_attempts 3 contact_groups admins } define service { host_name MYWEBSITE service_description Website Response : www.mywebsite.in check_command check_website_response!"http://192.168.1.181/"!1000!2000 max_check_attempts 5 check_interval 1 retry_interval 1 check_period 24x7 } Save publichost.cfg TESTING #/usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/nagios.cfg #service nagios restart Go to browser http://localhost/nagios Username: nagiosadmin Password:Password123 Click on Host and Services