SlideShare a Scribd company logo
Nagios
Hsi-Kai Wang
o Nagios
o PNP4Nagios
o Grafana
Outline
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY2
Nagios
Introduction
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY3
o MRTG
• (Multi Router Traffic Grapher), is free software for monitoring and measuring the traffic load on network links. It
allows the user to see traffic load on a network over time in graphical form.
o RRDTool
• (Round-Robin Database Tool) aims to handle time series data such as network bandwidth, temperatures or CPU load.
The data is stored in a circular buffer based database, thus the system storage footprint remains constant over time.
o Nagios
• is a free and open source computer-software application that monitors systems, networks and infrastructure
o Ganglia
• is a scalable, distributed monitoring tool for high-performance computing systems, clusters and network
o Cacti
• is an open-source, web-based network monitoring and graphing tool designed as a front-end application for the open-
source, industry-standard data logging tool RRDtool
History
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY4
Monitor Tool
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY5
1995 1999 2000 200720042001
o Nagios, now known as Nagios Core, is a free and open source computer-software
application that monitors systems, networks and infrastructure. Nagios offers
monitoring and alerting services for servers, switches, applications and services. It
alerts users when things go wrong and alerts them a second time when the problem
has been resolved.
About Nagios
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY6
Ref: Nagios
Ref: wiki
Nagios Core vs Nagios XI
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY7
Ref: Feature-Comparison
Nagios Architecture
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY8
Nagios
Installation
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY9
o OS:
• CentOS 7
o Package:
• nagios-4.3.4, nagios-plugins-2.2.1
Environment
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY10
o # disable selinux
o nagios:~ # sed s'/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
nagios:~ # reboot
o # install package
o nagios:~ # yum install epel-release
nagios:~ # yum install nagios nagios-plugins-all
o # start and enable service
o nagios:~ # systemctl start nagios
nagios:~ # systemctl start httpd
nagios:~ # systemctl enble nagios
nagios:~ # systemctl enble httpd
Install
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY11
o # verify config
o nagios:~ # nagios -v /etc/nagios/nagios.cfg
o # setup web account and password
o nagios:~ # htpasswd -c /etc/nagios/passwd nagiosadmin
o # config firewall
o nagios:~ # firewall-cmd --zone=public --add-port=80/tcp --permanent
nagios:~ # firewall-cmd --reload
Setting
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY12
o http://<nagios_ip>/nagios
Access Nagios
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY14
Nagios
Configuration
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY15
o nagios.cfg
• main config
o cgi.cfg
• cgi config
o resource.cfg
• define multiple resourc
o objects
• define hosts, host groups, contacts, contact groups,
services, etc
o passwd
• web access account and password
Folder Structure
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY16
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY17
Ref: Object Overview
o define object-type{
object-specific variable
}
o define host{
use linux-server
host_name localhost
alias localhost
address 127.0.0.1
}
o Hosts are one of the central objects in the monitoring logic
o Host Groups are groups of one or more hosts
o Services are one of the central objects in the monitoring
logic
o Service Groups are groups of one or more service
o Contacts are people involved in the notification process
o Contact Groups are groups of one or more contacts
o Commands are used to tell Nagios what programs, scripts,
etc. it should execute to perform
o Timeperiods are used to control
Syntax Type Object
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY18
Ref: Object Configuration Overview
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY19
Ref: Object Configuration Overview
localhost example
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY20
commands.cfg
templates.cfg
localhost.cfg
Nagios
Plugins
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY21
Nagios Exchange
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY22
Ref: Nagios Exchange
o Step 1. Require Package
o Nagios:~ # yum install bc net-snmp-utils
o Step 2. Download check_qnap
o Step 3. Install
o nagios:~ # chmod +x check_qnap
nagios:~ # cp check_qnap /usr/lib64/nagios/plugins/
nagios:~ # /usr/lib64/nagios/plugins/check_qnap <qnap_ip> public diskused 90 95
o Step 4. Setup object
o nagios:~ # vi /etc/nagios/conf.d/nas.cfg
Add QNAP Plugins
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY23
Object Configuration
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY24
QNAP Configuration
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY25
Demo
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY26
Demo
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY27
Nagios
Addons
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY
o NRPE
• is used for performing active checks in Nagios
o NSCA
• is used for performing passive checks in Nagios
Remote Monitor
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY29
Ref: Nagios Core Addons
o NRPE, Nagios Remote Plugin Executor, is an
addon that allows you to execute plugins on
remote Linux/Unix hosts. This is useful if you
need to monitor local resources/attributes like
disk usage, CPU load, memory usage, etc. on a
remote host. Similiar functionality can be
accomplished by using the check_by_ssh plugin,
although it can impose a higher CPU load on
the monitoring machine - especially if you are
monitoring hundreds or thousands of hosts.
NRPE
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY30
o NSCA, Nagios Service Check Acceptor, is an
addon that allows you to send passive check
results from remote Linux/Unix hosts to the
Nagios Core daemon running on the
monitoring server. This is very useful in
distributed and redundant/failover monitoring
setups.
NSCA
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY31
o Step 1. Install
o remote:~ # yum install nagios-plugins-all
remote:~ # yum install nrpe
o Step 2. Configuration
o remote:~ # vi /etc/nagios/nrpe.cfg
allowed_hosts=<nagios_ip>
dont_blame_nrpe=1
command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$
command[secure_check_disk]=/usr/lib64/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
command[check_all_disk]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -e
o Step 3. Start Service
o remote:~ # systemctl start nrpe
remote:~ # systemctl enable nrpe
o Step 4. Setup firewall
o remote:~ # firewall-cmd --zone=public --add-port=5666/tcp --permanent
remote:~ # firewall-cmd --reload
Install NRPE on Remote
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY32
o Step 1. Install
o nagios:~ # yum install nagios-plugins-nrpe
o Step 2. Test
o nagios:~ # /usr/lib64/nagios/plugins/check_nrpe -H <remote_ip> -c check_disk -a '-w 20% -c 10% -p /'
o Step 3. Configure
o nagios:~ # vi /etc/nagios/conf.d/nodes.cfg
o Step 3. Restart Service
o nagios:~ # systemctl restart nagios
Install NRPE on Nagios
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY33
Nagios Config For NRPE
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY34
remote host must define the
command on nrpe.conf
PNP4Nagios
Introduction
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY35
o n2rrd
o Nagiosgraph
o PNP4Nagios
RRDTool On Nagios
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY36
o Synchronous Mode
o Bulk Mode
o Bulk Mode with NPCD
o Bulk Mode with npcdmod
o Gearman Mode
Mode
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY37
Ref: Modes
o The “synchronous mode” is the
simplest and easiest to set up. Nagios
will call the perl script
process_perfdata.pl for every service
and host, respectively, to process the
data. The synchronous mode will work
very good up to about 1,000 services in
a 5 minute interval.
Synchronous Mode
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY38
o In bulk mode Nagios writes the necessary data
to a temporary file. After expiration of a
defined time the file will be processed in one
piece and deleted afterwards.
o The number of calls of process_perfdata.pl will
be reduced to a fraction. Depending on time
and the amount of collected data there will be
much less system calls. Instead,
process_perfdata.pl will run longer.
o Note Using this mode you should keep an eye
on the runtime of process_perfdata.pl. While it
is running to process data nagios will not
execute any checks.
Bulk Mode
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY39
o Nagios again uses a temporary file to store the
data and executes a command after expiration
of a certain time. Instead of immediate
processing by process_perfdata.pl the file is
moved to a spool directory. As moving a file
inside the same filesystem nearly takes no time
nagios is able to execute crucial work
immediately.
o The NPCD daemon (Nagios Performance C
Daemon) will monitor the directory for new
files and will pass the names to
process_perfdata.pl. Processing of performance
data is decoupled completely from nagios.
NPCD itself is able to start multiple thread for
processing the data.
Bulk Mode with NPCD
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY40
o This scenario includes npcdmod.o, an
NEB-module. This module reduces the
configuration of the “Bulk Mode with
NPCD” to a mere two lines in
nagios.cfg
o This mode is similar to “Bulk Mode
with NPCD” and it is exactly the same
functionality and the same
performance.
Bulk Mode with npcdmod
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY41
o Since version 0.6.12 PNP4Nagios can be
driven as a gearman worker. This way
large Nagios environments are possible
using mod_gearman. Nagios and
PNP4Nagios can be run on different
machines.
Gearman Mode
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY42
PNP4Nagios
Installation & Configuration
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY43
o Step 1. Install package
o nagios:~ # yum install rrdtool rrdtool-perl
nagios:~ # yum install pnp4nagios
o Step 2. Restart service
o nagios:~ # systemctl restart httpd
o Step 3. Test
o http://<nagios_ip>/pnp4nagios
Install
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY44
o Step 1. Download pnp-metrics-api
o nagios:~ # wget https://github.com/lingej/pnp-metrics-
api/raw/master/application/controller/api.php -O
/usr/share/nagios/html/pnp4nagios/application/controllers/api.php
o Step 2. Test
o nagios:~ # curl -s -u ‘<user>:<password>’
http://<nagios_ip>/pnp4nagios/index.php/api/hosts
Install pnp-metrics-api
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY45
o Step 1. Update nagios.cfg
o nagios:~ # vi /etc/nagios/nagios.cfg
...
# modify below
process_performance_data=1
enable_environment_macros=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata
Configuration - nagios.cfg (Bulk mode)
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY46
Ref: Configuration
o # service performance data
o service_perfdata_file=/var/log/pnp4nagios/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tSERVICE
DESC::$SERVICEDESC$tSERVICEPERFDATA::$SERVICEPERFDATA$tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$tHO
STSTATE::$HOSTSTATE$tHOSTSTATETYPE::$HOSTSTATETYPE$tSERVICESTATE::$SERVICESTATE$tSERVICESTATETYPE::$
SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file
o # host performance data starting with Nagios
o host_perfdata_file=/var/log/pnp4nagios/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tHOSTPERFDATA:
:$HOSTPERFDATA$tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$tHOSTSTATE::$HOSTSTATE$tHOSTSTATETYPE::$HOSTSTAT
ETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
Configuration - nagios.cfg (Bulk mode)
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY47
o Step 2. Update commands.cfg
o nagios:~ # vi /etc/nagios/objects/commands.cfg
...
# modify below
define command{
command_name process-service-perfdata-file
command_line /usr/libexec/pnp4nagios/process_perfdata.pl --bulk /var/log/pnp4nagios/service-
perfdata
}
define command{
command_name process-host-perfdata-file
command_line /usr/libexec/pnp4nagios/process_perfdata.pl --bulk /var/log/pnp4nagios/host-
perfdata
}
o
Configuration - commands.cfg
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY48
Ref: Configuration
o Step 3. Update templates.cfg
o nagios:~ # vi /etc/nagios/objects/templates.cfg
...
# add below
define host {
name host-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
register 0
}
define service {
name srv-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
register 0
}
o
Configuration - templates.cfg
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY49
Ref: Configuration
o Step 4. Update localhost.cfg
o nagios:~ # vi /etc/nagios/objects/localhost.cfg
...
# modifty below
define host{
use linux-server,host-pnp
host_name localhost
alias localhost
address 127.0.0.1
}
...
define service{
use local-service,srv-pnp
host_name localhost
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
o
Configuration - localhost.cfg
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY50
Ref: Configuration
Demo
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY51
Grafana
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY52
o Grafana is an open-source, general purpose dashboard and graph composer, which
runs as a web application. It supports graphite, InfluxDB or opentsdb as backends.
Introduction
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY53
Ref: Grafana Labs
o Step 1. Require Package
o nagios:~ # yum install initscripts fontconfig urw-fonts
o Step 2. Install
o nagios:~ # yum install https://s3-us-west-2.amazonaws.com/grafana-
releases/release/grafana-4.6.3-1.x86_64.rpm
nagios:~ # systemctl start grafana-server.service
nagios:~ # systemctl enable grafana-server.service
o Step 3. Install plugin
o nagios:~ # grafana-cli plugins install sni-pnp-datasource
nagios:~ # systemctl restart grafana-server.service
o Step 4. Firewall
o nagios:~ # firewall-cmd --zone=public --add-port=3000/tcp --permanent
nagios:~ # firewall-cmd --reload
Install
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY54
Ref: PNP4Nagios and Grafana
o http://<nagios_ip>:3000
o default account: admin
o default password: admin
Web
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY55
Home page
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY56
Check Plugins
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY57
o Type choose PNP
o URL key in pnp4nagios
o Access select proxy
o Click Basic Auth
Create Data Source
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY58
Create Dashboard
© 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY59

More Related Content

What's hot

Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018
Grafana Labs
 
The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practicesBill Buchan
 
Linux security introduction
Linux security introduction Linux security introduction
Linux security introduction
Mohamed Gad
 
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdfPrometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Knoldus Inc.
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
Knoldus Inc.
 
Implementing Cisco AAA
Implementing Cisco AAAImplementing Cisco AAA
Implementing Cisco AAA
dkaya
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Frederik Mogensen
 
Server monitoring using grafana and prometheus
Server monitoring using grafana and prometheusServer monitoring using grafana and prometheus
Server monitoring using grafana and prometheus
Celine George
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
Juraj Hantak
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Suresh Kumar
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
Arvind Kumar G.S
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
CoreStack
 
Infrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using PrometheusInfrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using Prometheus
Marco Pas
 
Monitoring With Prometheus
Monitoring With PrometheusMonitoring With Prometheus
Monitoring With Prometheus
Knoldus Inc.
 
Observability For Modern Applications
Observability For Modern ApplicationsObservability For Modern Applications
Observability For Modern Applications
Amazon Web Services
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
Julien Pivotto
 
Grafana.pptx
Grafana.pptxGrafana.pptx
Grafana.pptx
Bhushan Rane
 
Windows server
Windows serverWindows server
Windows server
Hideo Amezawa
 
System Monitoring With Nagios PowerPoint Presentation Slides
System Monitoring With Nagios PowerPoint Presentation SlidesSystem Monitoring With Nagios PowerPoint Presentation Slides
System Monitoring With Nagios PowerPoint Presentation Slides
SlideTeam
 
Squid server
Squid serverSquid server
Squid server
Rohit Phulsunge
 

What's hot (20)

Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018Explore your prometheus data in grafana - Promcon 2018
Explore your prometheus data in grafana - Promcon 2018
 
The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practices
 
Linux security introduction
Linux security introduction Linux security introduction
Linux security introduction
 
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdfPrometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Implementing Cisco AAA
Implementing Cisco AAAImplementing Cisco AAA
Implementing Cisco AAA
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Server monitoring using grafana and prometheus
Server monitoring using grafana and prometheusServer monitoring using grafana and prometheus
Server monitoring using grafana and prometheus
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Infrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using PrometheusInfrastructure & System Monitoring using Prometheus
Infrastructure & System Monitoring using Prometheus
 
Monitoring With Prometheus
Monitoring With PrometheusMonitoring With Prometheus
Monitoring With Prometheus
 
Observability For Modern Applications
Observability For Modern ApplicationsObservability For Modern Applications
Observability For Modern Applications
 
Introduction to Prometheus
Introduction to PrometheusIntroduction to Prometheus
Introduction to Prometheus
 
Grafana.pptx
Grafana.pptxGrafana.pptx
Grafana.pptx
 
Windows server
Windows serverWindows server
Windows server
 
System Monitoring With Nagios PowerPoint Presentation Slides
System Monitoring With Nagios PowerPoint Presentation SlidesSystem Monitoring With Nagios PowerPoint Presentation Slides
System Monitoring With Nagios PowerPoint Presentation Slides
 
Squid server
Squid serverSquid server
Squid server
 

Similar to Nagios intro

Learning Nagios module 1
Learning Nagios module 1Learning Nagios module 1
Learning Nagios module 1
Jayant Chutke
 
Installing-NCPA.pdf
Installing-NCPA.pdfInstalling-NCPA.pdf
Installing-NCPA.pdf
iis2019swati
 
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
Nagios
 
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
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
Freddy Buenaño
 
Install nagios
Install nagiosInstall nagios
Install nagioshassandb
 
Install nagios
Install nagiosInstall nagios
Install nagioshassandb
 
Install nagios
Install nagiosInstall nagios
Install nagioshassandb
 
Nagios 3
Nagios 3Nagios 3
Nagios 3zmoly
 
Nagios 3
Nagios 3Nagios 3
Nagios 3
rajni_kant
 
Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015
Lars Vogdt
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
NGINX, Inc.
 
P4+ONOS SRv6 tutorial.pptx
P4+ONOS SRv6 tutorial.pptxP4+ONOS SRv6 tutorial.pptx
P4+ONOS SRv6 tutorial.pptx
tampham61268
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解
Rex Tsai
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Sridhar Kumar N
 
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
Vanda KANY
 
Nagios En
Nagios EnNagios En
Nagios En
Aleksey Trusov
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
Rod Flohr
 
Ansible intro
Ansible introAnsible intro
Ansible intro
Hsi-Kai Wang
 
Installing nagios core_from_source
Installing nagios core_from_sourceInstalling nagios core_from_source
Installing nagios core_from_source
laonap166
 

Similar to Nagios intro (20)

Learning Nagios module 1
Learning Nagios module 1Learning Nagios module 1
Learning Nagios module 1
 
Installing-NCPA.pdf
Installing-NCPA.pdfInstalling-NCPA.pdf
Installing-NCPA.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.
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
 
Install nagios
Install nagiosInstall nagios
Install nagios
 
Install nagios
Install nagiosInstall nagios
Install nagios
 
Install nagios
Install nagiosInstall nagios
Install nagios
 
Nagios 3
Nagios 3Nagios 3
Nagios 3
 
Nagios 3
Nagios 3Nagios 3
Nagios 3
 
Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
P4+ONOS SRv6 tutorial.pptx
P4+ONOS SRv6 tutorial.pptxP4+ONOS SRv6 tutorial.pptx
P4+ONOS SRv6 tutorial.pptx
 
Ubuntu Core 技术详解
Ubuntu Core 技术详解Ubuntu Core 技术详解
Ubuntu Core 技术详解
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
 
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
 
Nagios En
Nagios EnNagios En
Nagios En
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
Installing nagios core_from_source
Installing nagios core_from_sourceInstalling nagios core_from_source
Installing nagios core_from_source
 

Recently uploaded

A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 

Recently uploaded (20)

A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 

Nagios intro

  • 2. o Nagios o PNP4Nagios o Grafana Outline © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY2
  • 3. Nagios Introduction © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY3
  • 4. o MRTG • (Multi Router Traffic Grapher), is free software for monitoring and measuring the traffic load on network links. It allows the user to see traffic load on a network over time in graphical form. o RRDTool • (Round-Robin Database Tool) aims to handle time series data such as network bandwidth, temperatures or CPU load. The data is stored in a circular buffer based database, thus the system storage footprint remains constant over time. o Nagios • is a free and open source computer-software application that monitors systems, networks and infrastructure o Ganglia • is a scalable, distributed monitoring tool for high-performance computing systems, clusters and network o Cacti • is an open-source, web-based network monitoring and graphing tool designed as a front-end application for the open- source, industry-standard data logging tool RRDtool History © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY4
  • 5. Monitor Tool © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY5 1995 1999 2000 200720042001
  • 6. o Nagios, now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved. About Nagios © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY6 Ref: Nagios Ref: wiki
  • 7. Nagios Core vs Nagios XI © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY7 Ref: Feature-Comparison
  • 8. Nagios Architecture © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY8
  • 9. Nagios Installation © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY9
  • 10. o OS: • CentOS 7 o Package: • nagios-4.3.4, nagios-plugins-2.2.1 Environment © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY10
  • 11. o # disable selinux o nagios:~ # sed s'/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config nagios:~ # reboot o # install package o nagios:~ # yum install epel-release nagios:~ # yum install nagios nagios-plugins-all o # start and enable service o nagios:~ # systemctl start nagios nagios:~ # systemctl start httpd nagios:~ # systemctl enble nagios nagios:~ # systemctl enble httpd Install © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY11
  • 12. o # verify config o nagios:~ # nagios -v /etc/nagios/nagios.cfg o # setup web account and password o nagios:~ # htpasswd -c /etc/nagios/passwd nagiosadmin o # config firewall o nagios:~ # firewall-cmd --zone=public --add-port=80/tcp --permanent nagios:~ # firewall-cmd --reload Setting © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY12
  • 13. o http://<nagios_ip>/nagios Access Nagios © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY14
  • 14. Nagios Configuration © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY15
  • 15. o nagios.cfg • main config o cgi.cfg • cgi config o resource.cfg • define multiple resourc o objects • define hosts, host groups, contacts, contact groups, services, etc o passwd • web access account and password Folder Structure © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY16
  • 16. © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY17 Ref: Object Overview
  • 17. o define object-type{ object-specific variable } o define host{ use linux-server host_name localhost alias localhost address 127.0.0.1 } o Hosts are one of the central objects in the monitoring logic o Host Groups are groups of one or more hosts o Services are one of the central objects in the monitoring logic o Service Groups are groups of one or more service o Contacts are people involved in the notification process o Contact Groups are groups of one or more contacts o Commands are used to tell Nagios what programs, scripts, etc. it should execute to perform o Timeperiods are used to control Syntax Type Object © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY18 Ref: Object Configuration Overview
  • 18. © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY19 Ref: Object Configuration Overview
  • 19. localhost example © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY20 commands.cfg templates.cfg localhost.cfg
  • 20. Nagios Plugins © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY21
  • 21. Nagios Exchange © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY22 Ref: Nagios Exchange
  • 22. o Step 1. Require Package o Nagios:~ # yum install bc net-snmp-utils o Step 2. Download check_qnap o Step 3. Install o nagios:~ # chmod +x check_qnap nagios:~ # cp check_qnap /usr/lib64/nagios/plugins/ nagios:~ # /usr/lib64/nagios/plugins/check_qnap <qnap_ip> public diskused 90 95 o Step 4. Setup object o nagios:~ # vi /etc/nagios/conf.d/nas.cfg Add QNAP Plugins © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY23
  • 23. Object Configuration © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY24
  • 24. QNAP Configuration © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY25
  • 25. Demo © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY26
  • 26. Demo © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY27
  • 27. Nagios Addons © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY
  • 28. o NRPE • is used for performing active checks in Nagios o NSCA • is used for performing passive checks in Nagios Remote Monitor © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY29 Ref: Nagios Core Addons
  • 29. o NRPE, Nagios Remote Plugin Executor, is an addon that allows you to execute plugins on remote Linux/Unix hosts. This is useful if you need to monitor local resources/attributes like disk usage, CPU load, memory usage, etc. on a remote host. Similiar functionality can be accomplished by using the check_by_ssh plugin, although it can impose a higher CPU load on the monitoring machine - especially if you are monitoring hundreds or thousands of hosts. NRPE © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY30
  • 30. o NSCA, Nagios Service Check Acceptor, is an addon that allows you to send passive check results from remote Linux/Unix hosts to the Nagios Core daemon running on the monitoring server. This is very useful in distributed and redundant/failover monitoring setups. NSCA © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY31
  • 31. o Step 1. Install o remote:~ # yum install nagios-plugins-all remote:~ # yum install nrpe o Step 2. Configuration o remote:~ # vi /etc/nagios/nrpe.cfg allowed_hosts=<nagios_ip> dont_blame_nrpe=1 command[check_disk]=/usr/lib64/nagios/plugins/check_disk $ARG1$ command[secure_check_disk]=/usr/lib64/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ command[check_all_disk]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -e o Step 3. Start Service o remote:~ # systemctl start nrpe remote:~ # systemctl enable nrpe o Step 4. Setup firewall o remote:~ # firewall-cmd --zone=public --add-port=5666/tcp --permanent remote:~ # firewall-cmd --reload Install NRPE on Remote © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY32
  • 32. o Step 1. Install o nagios:~ # yum install nagios-plugins-nrpe o Step 2. Test o nagios:~ # /usr/lib64/nagios/plugins/check_nrpe -H <remote_ip> -c check_disk -a '-w 20% -c 10% -p /' o Step 3. Configure o nagios:~ # vi /etc/nagios/conf.d/nodes.cfg o Step 3. Restart Service o nagios:~ # systemctl restart nagios Install NRPE on Nagios © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY33
  • 33. Nagios Config For NRPE © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY34 remote host must define the command on nrpe.conf
  • 34. PNP4Nagios Introduction © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY35
  • 35. o n2rrd o Nagiosgraph o PNP4Nagios RRDTool On Nagios © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY36
  • 36. o Synchronous Mode o Bulk Mode o Bulk Mode with NPCD o Bulk Mode with npcdmod o Gearman Mode Mode © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY37 Ref: Modes
  • 37. o The “synchronous mode” is the simplest and easiest to set up. Nagios will call the perl script process_perfdata.pl for every service and host, respectively, to process the data. The synchronous mode will work very good up to about 1,000 services in a 5 minute interval. Synchronous Mode © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY38
  • 38. o In bulk mode Nagios writes the necessary data to a temporary file. After expiration of a defined time the file will be processed in one piece and deleted afterwards. o The number of calls of process_perfdata.pl will be reduced to a fraction. Depending on time and the amount of collected data there will be much less system calls. Instead, process_perfdata.pl will run longer. o Note Using this mode you should keep an eye on the runtime of process_perfdata.pl. While it is running to process data nagios will not execute any checks. Bulk Mode © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY39
  • 39. o Nagios again uses a temporary file to store the data and executes a command after expiration of a certain time. Instead of immediate processing by process_perfdata.pl the file is moved to a spool directory. As moving a file inside the same filesystem nearly takes no time nagios is able to execute crucial work immediately. o The NPCD daemon (Nagios Performance C Daemon) will monitor the directory for new files and will pass the names to process_perfdata.pl. Processing of performance data is decoupled completely from nagios. NPCD itself is able to start multiple thread for processing the data. Bulk Mode with NPCD © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY40
  • 40. o This scenario includes npcdmod.o, an NEB-module. This module reduces the configuration of the “Bulk Mode with NPCD” to a mere two lines in nagios.cfg o This mode is similar to “Bulk Mode with NPCD” and it is exactly the same functionality and the same performance. Bulk Mode with npcdmod © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY41
  • 41. o Since version 0.6.12 PNP4Nagios can be driven as a gearman worker. This way large Nagios environments are possible using mod_gearman. Nagios and PNP4Nagios can be run on different machines. Gearman Mode © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY42
  • 42. PNP4Nagios Installation & Configuration © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY43
  • 43. o Step 1. Install package o nagios:~ # yum install rrdtool rrdtool-perl nagios:~ # yum install pnp4nagios o Step 2. Restart service o nagios:~ # systemctl restart httpd o Step 3. Test o http://<nagios_ip>/pnp4nagios Install © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY44
  • 44. o Step 1. Download pnp-metrics-api o nagios:~ # wget https://github.com/lingej/pnp-metrics- api/raw/master/application/controller/api.php -O /usr/share/nagios/html/pnp4nagios/application/controllers/api.php o Step 2. Test o nagios:~ # curl -s -u ‘<user>:<password>’ http://<nagios_ip>/pnp4nagios/index.php/api/hosts Install pnp-metrics-api © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY45
  • 45. o Step 1. Update nagios.cfg o nagios:~ # vi /etc/nagios/nagios.cfg ... # modify below process_performance_data=1 enable_environment_macros=1 host_perfdata_command=process-host-perfdata service_perfdata_command=process-service-perfdata Configuration - nagios.cfg (Bulk mode) © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY46 Ref: Configuration
  • 46. o # service performance data o service_perfdata_file=/var/log/pnp4nagios/service-perfdata service_perfdata_file_template=DATATYPE::SERVICEPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tSERVICE DESC::$SERVICEDESC$tSERVICEPERFDATA::$SERVICEPERFDATA$tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$tHO STSTATE::$HOSTSTATE$tHOSTSTATETYPE::$HOSTSTATETYPE$tSERVICESTATE::$SERVICESTATE$tSERVICESTATETYPE::$ SERVICESTATETYPE$ service_perfdata_file_mode=a service_perfdata_file_processing_interval=15 service_perfdata_file_processing_command=process-service-perfdata-file o # host performance data starting with Nagios o host_perfdata_file=/var/log/pnp4nagios/host-perfdata host_perfdata_file_template=DATATYPE::HOSTPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tHOSTPERFDATA: :$HOSTPERFDATA$tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$tHOSTSTATE::$HOSTSTATE$tHOSTSTATETYPE::$HOSTSTAT ETYPE$ host_perfdata_file_mode=a host_perfdata_file_processing_interval=15 host_perfdata_file_processing_command=process-host-perfdata-file Configuration - nagios.cfg (Bulk mode) © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY47
  • 47. o Step 2. Update commands.cfg o nagios:~ # vi /etc/nagios/objects/commands.cfg ... # modify below define command{ command_name process-service-perfdata-file command_line /usr/libexec/pnp4nagios/process_perfdata.pl --bulk /var/log/pnp4nagios/service- perfdata } define command{ command_name process-host-perfdata-file command_line /usr/libexec/pnp4nagios/process_perfdata.pl --bulk /var/log/pnp4nagios/host- perfdata } o Configuration - commands.cfg © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY48 Ref: Configuration
  • 48. o Step 3. Update templates.cfg o nagios:~ # vi /etc/nagios/objects/templates.cfg ... # add below define host { name host-pnp action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ register 0 } define service { name srv-pnp action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$ register 0 } o Configuration - templates.cfg © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY49 Ref: Configuration
  • 49. o Step 4. Update localhost.cfg o nagios:~ # vi /etc/nagios/objects/localhost.cfg ... # modifty below define host{ use linux-server,host-pnp host_name localhost alias localhost address 127.0.0.1 } ... define service{ use local-service,srv-pnp host_name localhost service_description Root Partition check_command check_local_disk!20%!10%!/ } o Configuration - localhost.cfg © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY50 Ref: Configuration
  • 50. Demo © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY51
  • 51. Grafana © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY52
  • 52. o Grafana is an open-source, general purpose dashboard and graph composer, which runs as a web application. It supports graphite, InfluxDB or opentsdb as backends. Introduction © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY53 Ref: Grafana Labs
  • 53. o Step 1. Require Package o nagios:~ # yum install initscripts fontconfig urw-fonts o Step 2. Install o nagios:~ # yum install https://s3-us-west-2.amazonaws.com/grafana- releases/release/grafana-4.6.3-1.x86_64.rpm nagios:~ # systemctl start grafana-server.service nagios:~ # systemctl enable grafana-server.service o Step 3. Install plugin o nagios:~ # grafana-cli plugins install sni-pnp-datasource nagios:~ # systemctl restart grafana-server.service o Step 4. Firewall o nagios:~ # firewall-cmd --zone=public --add-port=3000/tcp --permanent nagios:~ # firewall-cmd --reload Install © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY54 Ref: PNP4Nagios and Grafana
  • 54. o http://<nagios_ip>:3000 o default account: admin o default password: admin Web © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY55
  • 55. Home page © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY56
  • 56. Check Plugins © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY57
  • 57. o Type choose PNP o URL key in pnp4nagios o Access select proxy o Click Basic Auth Create Data Source © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY58
  • 58. Create Dashboard © 2016 BROCADE COMMUNICATIONS SYSTEMS, INC. INTERNAL USE ONLY59

Editor's Notes

  1. nagios:~ # ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-rrdtool=/usr/bin/rrdtool
  2. nagios:~ # ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-rrdtool=/usr/bin/rrdtool