SlideShare ist ein Scribd-Unternehmen logo
1 von 58
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Uyuni - Introduction and how to manage CentOS
Uyuni - Introduction and how to manage CentOSUyuni - Introduction and how to manage CentOS
Uyuni - Introduction and how to manage CentOS
 
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | EdurekaDevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
DevOps vs Agile | DevOps Tutorial For Beginners | DevOps Training | Edureka
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Harbor RegistryのReplication機能
Harbor RegistryのReplication機能Harbor RegistryのReplication機能
Harbor RegistryのReplication機能
 
[XECon2016] A-4 조정현 GitHub + Jenkins + Docker로 자동배포 시스템 구축하기
[XECon2016] A-4 조정현 GitHub + Jenkins + Docker로 자동배포 시스템 구축하기[XECon2016] A-4 조정현 GitHub + Jenkins + Docker로 자동배포 시스템 구축하기
[XECon2016] A-4 조정현 GitHub + Jenkins + Docker로 자동배포 시스템 구축하기
 
Logs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK StackLogs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK Stack
 
How to Get Started With NGINX
How to Get Started With NGINXHow to Get Started With NGINX
How to Get Started With NGINX
 
Devops Devops Devops
Devops Devops DevopsDevops Devops Devops
Devops Devops Devops
 
Nagios, Getting Started.
Nagios, Getting Started.Nagios, Getting Started.
Nagios, Getting Started.
 
Using ngx_lua / lua-nginx-module in pixiv
Using ngx_lua / lua-nginx-module in pixivUsing ngx_lua / lua-nginx-module in pixiv
Using ngx_lua / lua-nginx-module in pixiv
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
DevOps a pratical approach
DevOps a pratical approachDevOps a pratical approach
DevOps a pratical approach
 
containerd the universal container runtime
containerd the universal container runtimecontainerd the universal container runtime
containerd the universal container runtime
 
Monitoring with Prometheus
Monitoring with PrometheusMonitoring with Prometheus
Monitoring with Prometheus
 
CI/CD for Microservices Best Practices
CI/CD for Microservices Best PracticesCI/CD for Microservices Best Practices
CI/CD for Microservices Best Practices
 
DevSecOps reference architectures 2018
DevSecOps reference architectures 2018DevSecOps reference architectures 2018
DevSecOps reference architectures 2018
 
パケット キャプチャで学ぶ SMB (CIFS) の基本
パケット キャプチャで学ぶSMB (CIFS) の基本パケット キャプチャで学ぶSMB (CIFS) の基本
パケット キャプチャで学ぶ SMB (CIFS) の基本
 
Introduction to CI/CD
Introduction to CI/CDIntroduction to CI/CD
Introduction to CI/CD
 
Spring Cloud Gateway on Kubernetes
Spring Cloud Gateway on KubernetesSpring Cloud Gateway on Kubernetes
Spring Cloud Gateway on Kubernetes
 

Ähnlich wie Nagios intro

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 nagios
hassandb
 
Install nagios
Install nagiosInstall nagios
Install nagios
hassandb
 
Install nagios
Install nagiosInstall nagios
Install nagios
hassandb
 
Nagios 3
Nagios 3Nagios 3
Nagios 3
zmoly
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Kürzlich hochgeladen (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 

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

Hinweis der Redaktion

  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