SlideShare a Scribd company logo
1 of 24
Download to read offline
Panagiotis Garefalakis
ICS-FORTH
Heraklion, Greece




                         pgaref@ics.forth.gr
   Storage management challenges

   What is Nagios

   Tutorial topics:
    ◦   How to start a Nagios server
    ◦   Writing storage service monitoring code
    ◦   Monitoring local & remote storage
    ◦   Event handling




                                     pgaref@ics.forth.gr
pgaref@ics.forth.gr
   A key measurement tool for actively
    monitoring availability of devices and
    services.
   The most used open source network
    monitoring software.
   Can support monitoring and
    management of thousands of devices
    and services.


                           pgaref@ics.forth.gr
pgaref@ics.forth.gr
define host{
     name                       generic-host
     notifications_enabled         1
     event_handler_enabled         1
     flap_detection_enabled        1
     process_perf_data             1
     retain_status_information     1
     retain_nonstatus_information 1
     check_command                 check-host-alive
     max_check_attempts            5
     notification_interval         60
     notification_period           24x7
     notification_options          d,r
     contact_groups                nobody
     register                      0
     }




                                        pgaref@ics.forth.gr
define host{
     use              generic-host
     host_name        switch1
     alias            Core_switches
     address          192.168.1.2
     parents          router1
     contact_groups   switch_group
}




                                      pgaref@ics.forth.gr
define service{
     name                             generic-service
     active_checks_enabled            1
     passive_checks_enabled           1
     parallelize_check                1
     obsess_over_service              1
     check_freshness                  0
     notifications_enabled            1
     event_handler_enabled            1
     flap_detection_enabled           1
     process_perf_data                1
     retain_status_information        1
     retain_nonstatus_information     1
     is_volatile                      0
     check_period                     24x7
     max_check_attempts           5
     normal_check_interval        5
     retry_check_interval             1
     notification_interval            60
     notification_period              24x7
     notification_options             c,r
     register                         0
     }



                                             pgaref@ics.forth.gr
define service{
     host_name               switch1
     use                     generic-service
     service_description     PING
     check_command           check-host-alive
     max_check_attempts      5
     normal_check_interval   5
     notification_options    c,r,f
     contact_groups          switch-group
}




                                         pgaref@ics.forth.gr
   Commands wrap the check scripts.
    define command{
            command_name    check-host-alive
            command_line    $USER1$/check_ping -H
      $HOSTADDRESS$ -w 99,99% -c 100,100% -p 1
            }
   Check scripts can be in any language.




                                 pgaref@ics.forth.gr
pgaref@ics.forth.gr
   Manual install.

   Read the installation instructions (USB).
    ◦ Installation commands – Ubuntu
    ◦ Installation script - CentOS




                                  pgaref@ics.forth.gr
pgaref@ics.forth.gr
   Locate Nagios configuration files.
    /usr/local/nagios/etc/objects
   Open localhost.cfg (Sudo access)
   Add the lines:
define service{
     use                              local-service   ; Name of service template to use
     host_name                       localhost
     service_description             DISK_TEST
     check_command                   check_local_disk!70%!20%!/dev/sda3
     }

   Validate:              sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg



   Restart Nagios: /etc/init.d/nagios restart


                                                                  pgaref@ics.forth.gr
   Copy the given plugin “check_dir.sh” to
    nagios plugin directory:/usr/local/nagios/libexec
   Modify the commands.cfg file:
define command{
     command_name          check_dir
     command_line          $USER1$/check_dir $ARG1$
     }

   Modify the localhost.cfg file:
define service{
     use                               local-service
     host_name                         localhost
     service_description               CHECK_LOG
     check_command                     check_dir!9999
     }



                                                   pgaref@ics.forth.gr
pgaref@ics.forth.gr
oRemote Host IP is: 139.91.70.76
oYour IP has to be added at nrpe.cfg before running!




                                pgaref@ics.forth.gr
   Follow the instructions to install NRPE Server
    “Enable NRPE Server-Ubuntu.txt”
   You can Skip the Command and Service
    Definitions.
   You can check your connection by running
    the following command and using the IP
    Address of the remote box you want to
    monitor. You should get the return “NRPE
    v2.8.1” if all is working.
    ◦ Command:   /usr/lib/nagios/plugins/check_nrpe -H 139.91.70.76



                                        pgaref@ics.forth.gr
   We have an NFS server running in the remote host. A
    plugin for monitoring NFS is included “check_nfsmount.pl”
   We will modify NRPE configuration at the server part to be
    able to run check nfs remotely.
   Finally test the command:
    ◦ /usr/lib/nagios/plugins/check_nrpe -H 139.91.70.76 -c
      check_nfs


                                         pgaref@ics.forth.gr
   Nagios can attempt to rectify a fault by
    running a script.
   We can use Event Handlers to take action
    when something goes wrong.
    ◦ Growing File example:
      Print error message
      Compress File
      Truncate File




                              pgaref@ics.forth.gr
   We want to react to above-threshold growth
    of files.
   Copy myhandler.sh to libexec/eventhandler
    ◦ Change permission to nagios user!
   Add the following line to our command:
   event_handler my_handler!$SERVICESTATE$ $STATETYPE$
    $SERVICEATTEMPT$


Finally add the command:
define command{
         command_name my_eventhandler
         command_line $USER1$/eventhandlers/myhandler $ARG1$
}




                                               pgaref@ics.forth.gr
pgaref@ics.forth.gr
   Nagios is a very useful tool saving time of administrators but
    can appear very complex when you first look at it.
   My advice is:
    ◦ Install it on your test node (though this may well end up as your
      master server)
    ◦ Run a few check scripts by hand to get the feel for them
    ◦ Set up a simple config file that runs a few check on the local host
    ◦ Install nrpe on the host and nrpe and nagios-plugins on a remote
      host
    ◦ Run check nrpe by hand to get it working then add a couple of
      simple checks on the remote host
    ◦ Now add hosts and service until you run out, then write some
      more




                                             pgaref@ics.forth.gr
   http://www.nagios.org Nagios web site
   http://sourceforge.net/projects/nagiosplug
    Nagios plugins site
   http://www.nagiosexchange.org Unofficial
    Nagios plugin site
   http://www.debianhelp.co.uk/nagios.htm A
    Debian tutorial on Nagios
   http://www.nagios.com/ Commercial Nagios
    support




                               pgaref@ics.forth.gr

More Related Content

What's hot

Oracle cluster installation with grid and nfs
Oracle cluster  installation with grid and nfsOracle cluster  installation with grid and nfs
Oracle cluster installation with grid and nfsChanaka Lasantha
 
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Stacey Whitney
 
Oracle cluster installation with grid and iscsi
Oracle cluster  installation with grid and iscsiOracle cluster  installation with grid and iscsi
Oracle cluster installation with grid and iscsiChanaka Lasantha
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO HavanaDan Radez
 
Namespaces for Local Networks
Namespaces for Local NetworksNamespaces for Local Networks
Namespaces for Local NetworksMen and Mice
 
Odoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo
 
What is new in BIND 9.11?
What is new in BIND 9.11?What is new in BIND 9.11?
What is new in BIND 9.11?Men and Mice
 
Part 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows NetworksPart 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows NetworksMen and Mice
 
Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Puppet
 
DNSSEC signing Tutorial
DNSSEC signing Tutorial DNSSEC signing Tutorial
DNSSEC signing Tutorial Men and Mice
 
Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4Denish Patel
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Puppet
 
How to install squid proxy on server or how to install squid proxy on centos o
How to install squid proxy on server  or how to install squid proxy on centos oHow to install squid proxy on server  or how to install squid proxy on centos o
How to install squid proxy on server or how to install squid proxy on centos oProxiesforrent
 
ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedredhat9
 
Yeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the rootYeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the rootMen and Mice
 
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and ServerspecTest Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and ServerspecYury Tsarev
 
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOSPart 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOSMen and Mice
 
There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...
There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...
There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...Luke Young
 
BIND 9 logging best practices
BIND 9 logging best practicesBIND 9 logging best practices
BIND 9 logging best practicesMen and Mice
 
Codified PostgreSQL Schema
Codified PostgreSQL SchemaCodified PostgreSQL Schema
Codified PostgreSQL SchemaSean Chittenden
 

What's hot (20)

Oracle cluster installation with grid and nfs
Oracle cluster  installation with grid and nfsOracle cluster  installation with grid and nfs
Oracle cluster installation with grid and nfs
 
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
 
Oracle cluster installation with grid and iscsi
Oracle cluster  installation with grid and iscsiOracle cluster  installation with grid and iscsi
Oracle cluster installation with grid and iscsi
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana
 
Namespaces for Local Networks
Namespaces for Local NetworksNamespaces for Local Networks
Namespaces for Local Networks
 
Odoo Online platform: architecture and challenges
Odoo Online platform: architecture and challengesOdoo Online platform: architecture and challenges
Odoo Online platform: architecture and challenges
 
What is new in BIND 9.11?
What is new in BIND 9.11?What is new in BIND 9.11?
What is new in BIND 9.11?
 
Part 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows NetworksPart 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows Networks
 
Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014
 
DNSSEC signing Tutorial
DNSSEC signing Tutorial DNSSEC signing Tutorial
DNSSEC signing Tutorial
 
Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4Out of the box replication in postgres 9.4
Out of the box replication in postgres 9.4
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013
 
How to install squid proxy on server or how to install squid proxy on centos o
How to install squid proxy on server  or how to install squid proxy on centos oHow to install squid proxy on server  or how to install squid proxy on centos o
How to install squid proxy on server or how to install squid proxy on centos o
 
ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalived
 
Yeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the rootYeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the root
 
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and ServerspecTest Driven Infrastructure with Docker, Test Kitchen and Serverspec
Test Driven Infrastructure with Docker, Test Kitchen and Serverspec
 
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOSPart 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
 
There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...
There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...
There's no place like 127.0.0.1 - Achieving "reliable" DNS rebinding in moder...
 
BIND 9 logging best practices
BIND 9 logging best practicesBIND 9 logging best practices
BIND 9 logging best practices
 
Codified PostgreSQL Schema
Codified PostgreSQL SchemaCodified PostgreSQL Schema
Codified PostgreSQL Schema
 

Viewers also liked

Click Log Mining CS598
Click Log Mining CS598Click Log Mining CS598
Click Log Mining CS598Shih-Wen Huang
 
Monitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagiosMonitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagiosLindsay Holmwood
 
Large scale Click-streaming and tranaction log mining
Large scale Click-streaming and tranaction log miningLarge scale Click-streaming and tranaction log mining
Large scale Click-streaming and tranaction log miningitstuff
 
A heuristic approach for web log mining using bayesian networks
A heuristic approach for web log mining using bayesian networksA heuristic approach for web log mining using bayesian networks
A heuristic approach for web log mining using bayesian networksAlexander Decker
 
Behaviour Driven Monitoring with cucumber-nagios
Behaviour Driven Monitoring with cucumber-nagiosBehaviour Driven Monitoring with cucumber-nagios
Behaviour Driven Monitoring with cucumber-nagiosLindsay Holmwood
 

Viewers also liked (7)

Click Log Mining CS598
Click Log Mining CS598Click Log Mining CS598
Click Log Mining CS598
 
Monitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagiosMonitoring web application behaviour with cucumber-nagios
Monitoring web application behaviour with cucumber-nagios
 
Leveraging Log Management to provide business value
Leveraging Log Management to provide business valueLeveraging Log Management to provide business value
Leveraging Log Management to provide business value
 
Large scale Click-streaming and tranaction log mining
Large scale Click-streaming and tranaction log miningLarge scale Click-streaming and tranaction log mining
Large scale Click-streaming and tranaction log mining
 
A heuristic approach for web log mining using bayesian networks
A heuristic approach for web log mining using bayesian networksA heuristic approach for web log mining using bayesian networks
A heuristic approach for web log mining using bayesian networks
 
Behaviour Driven Monitoring with cucumber-nagios
Behaviour Driven Monitoring with cucumber-nagiosBehaviour Driven Monitoring with cucumber-nagios
Behaviour Driven Monitoring with cucumber-nagios
 
Log Data Mining
Log Data MiningLog Data Mining
Log Data Mining
 

Similar to Storage managment using nagios

X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newYiwei Ma
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Nagios
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios
 
Distributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- PuppetDistributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- PuppetPuppet
 
Nagios Conference 2011 - Daniel Wittenberg - Scaling Nagios At A Giant Insur...
Nagios Conference 2011 - Daniel Wittenberg -  Scaling Nagios At A Giant Insur...Nagios Conference 2011 - Daniel Wittenberg -  Scaling Nagios At A Giant Insur...
Nagios Conference 2011 - Daniel Wittenberg - Scaling Nagios At A Giant Insur...Nagios
 
Nagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPENagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPENagios
 
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, ChefCompliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, ChefAlert Logic
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and MaintenanceJazkarta, Inc.
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureMichaël Lopez
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and TuningNGINX, Inc.
 
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...Nagios
 
How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...Tiago Simões
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in pythonJimmy Lai
 
Load Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS ClusterLoad Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS ClusterKevin Jones
 
AMS Node Meetup December presentation Phusion Passenger
AMS Node Meetup December presentation Phusion PassengerAMS Node Meetup December presentation Phusion Passenger
AMS Node Meetup December presentation Phusion Passengericemobile
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX, Inc.
 
Graphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosGraphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosjasonholtzapple
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXKevin Jones
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stackRootGate
 

Similar to Storage managment using nagios (20)

X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
Lee Myers - What To Do When Nagios Notification Don't Meet Your Needs.
 
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios CoreNagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
Nagios Conference 2014 - Eric Mislivec - Getting Started With Nagios Core
 
Distributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- PuppetDistributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- Puppet
 
Nagios Conference 2011 - Daniel Wittenberg - Scaling Nagios At A Giant Insur...
Nagios Conference 2011 - Daniel Wittenberg -  Scaling Nagios At A Giant Insur...Nagios Conference 2011 - Daniel Wittenberg -  Scaling Nagios At A Giant Insur...
Nagios Conference 2011 - Daniel Wittenberg - Scaling Nagios At A Giant Insur...
 
Nagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPENagios Conference 2012 - Mike Weber - NRPE
Nagios Conference 2012 - Mike Weber - NRPE
 
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, ChefCompliance as Code: Velocity with Security - Fraser Pollock, Chef
Compliance as Code: Velocity with Security - Fraser Pollock, Chef
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructure
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
Nagios Conference 2014 - Mike Weber - Expanding NRDS Capabilities on Linux Sy...
 
How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
 
Load Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS ClusterLoad Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS Cluster
 
AMS Node Meetup December presentation Phusion Passenger
AMS Node Meetup December presentation Phusion PassengerAMS Node Meetup December presentation Phusion Passenger
AMS Node Meetup December presentation Phusion Passenger
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
 
Graphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosGraphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagios
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 

More from Panagiotis Garefalakis

Accelerating distributed joins in Apache Hive: Runtime filtering enhancements
Accelerating distributed joins in Apache Hive: Runtime filtering enhancementsAccelerating distributed joins in Apache Hive: Runtime filtering enhancements
Accelerating distributed joins in Apache Hive: Runtime filtering enhancementsPanagiotis Garefalakis
 
Neptune: Scheduling Suspendable Tasks for Unified Stream/Batch Applications
Neptune: Scheduling Suspendable Tasks for Unified Stream/Batch ApplicationsNeptune: Scheduling Suspendable Tasks for Unified Stream/Batch Applications
Neptune: Scheduling Suspendable Tasks for Unified Stream/Batch ApplicationsPanagiotis Garefalakis
 
Medea: Scheduling of Long Running Applications in Shared Production Clusters
Medea: Scheduling of Long Running Applications in Shared Production ClustersMedea: Scheduling of Long Running Applications in Shared Production Clusters
Medea: Scheduling of Long Running Applications in Shared Production ClustersPanagiotis Garefalakis
 
Pgaref Piccolo Building Fast, Distributed Programs with Partitioned Tables
Pgaref   Piccolo Building Fast, Distributed Programs with Partitioned TablesPgaref   Piccolo Building Fast, Distributed Programs with Partitioned Tables
Pgaref Piccolo Building Fast, Distributed Programs with Partitioned TablesPanagiotis Garefalakis
 

More from Panagiotis Garefalakis (8)

Accelerating distributed joins in Apache Hive: Runtime filtering enhancements
Accelerating distributed joins in Apache Hive: Runtime filtering enhancementsAccelerating distributed joins in Apache Hive: Runtime filtering enhancements
Accelerating distributed joins in Apache Hive: Runtime filtering enhancements
 
Neptune: Scheduling Suspendable Tasks for Unified Stream/Batch Applications
Neptune: Scheduling Suspendable Tasks for Unified Stream/Batch ApplicationsNeptune: Scheduling Suspendable Tasks for Unified Stream/Batch Applications
Neptune: Scheduling Suspendable Tasks for Unified Stream/Batch Applications
 
Medea: Scheduling of Long Running Applications in Shared Production Clusters
Medea: Scheduling of Long Running Applications in Shared Production ClustersMedea: Scheduling of Long Running Applications in Shared Production Clusters
Medea: Scheduling of Long Running Applications in Shared Production Clusters
 
Mres presentation
Mres presentationMres presentation
Mres presentation
 
Dais 2013 2 6 june
Dais 2013 2 6 juneDais 2013 2 6 june
Dais 2013 2 6 june
 
Master presentation-21-7-2014
Master presentation-21-7-2014Master presentation-21-7-2014
Master presentation-21-7-2014
 
Pgaref Piccolo Building Fast, Distributed Programs with Partitioned Tables
Pgaref   Piccolo Building Fast, Distributed Programs with Partitioned TablesPgaref   Piccolo Building Fast, Distributed Programs with Partitioned Tables
Pgaref Piccolo Building Fast, Distributed Programs with Partitioned Tables
 
Ithings2012 20nov
Ithings2012 20novIthings2012 20nov
Ithings2012 20nov
 

Storage managment using nagios

  • 2. Storage management challenges  What is Nagios  Tutorial topics: ◦ How to start a Nagios server ◦ Writing storage service monitoring code ◦ Monitoring local & remote storage ◦ Event handling pgaref@ics.forth.gr
  • 4. A key measurement tool for actively monitoring availability of devices and services.  The most used open source network monitoring software.  Can support monitoring and management of thousands of devices and services. pgaref@ics.forth.gr
  • 6. define host{ name generic-host notifications_enabled 1 event_handler_enabled 1 flap_detection_enabled 1 process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 check_command check-host-alive max_check_attempts 5 notification_interval 60 notification_period 24x7 notification_options d,r contact_groups nobody register 0 } pgaref@ics.forth.gr
  • 7. define host{ use generic-host host_name switch1 alias Core_switches address 192.168.1.2 parents router1 contact_groups switch_group } pgaref@ics.forth.gr
  • 8. define service{ name generic-service active_checks_enabled 1 passive_checks_enabled 1 parallelize_check 1 obsess_over_service 1 check_freshness 0 notifications_enabled 1 event_handler_enabled 1 flap_detection_enabled 1 process_perf_data 1 retain_status_information 1 retain_nonstatus_information 1 is_volatile 0 check_period 24x7 max_check_attempts 5 normal_check_interval 5 retry_check_interval 1 notification_interval 60 notification_period 24x7 notification_options c,r register 0 } pgaref@ics.forth.gr
  • 9. define service{ host_name switch1 use generic-service service_description PING check_command check-host-alive max_check_attempts 5 normal_check_interval 5 notification_options c,r,f contact_groups switch-group } pgaref@ics.forth.gr
  • 10. Commands wrap the check scripts. define command{ command_name check-host-alive command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 99,99% -c 100,100% -p 1 }  Check scripts can be in any language. pgaref@ics.forth.gr
  • 12. Manual install.  Read the installation instructions (USB). ◦ Installation commands – Ubuntu ◦ Installation script - CentOS pgaref@ics.forth.gr
  • 14. Locate Nagios configuration files. /usr/local/nagios/etc/objects  Open localhost.cfg (Sudo access)  Add the lines: define service{ use local-service ; Name of service template to use host_name localhost service_description DISK_TEST check_command check_local_disk!70%!20%!/dev/sda3 }  Validate: sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg  Restart Nagios: /etc/init.d/nagios restart pgaref@ics.forth.gr
  • 15. Copy the given plugin “check_dir.sh” to nagios plugin directory:/usr/local/nagios/libexec  Modify the commands.cfg file: define command{ command_name check_dir command_line $USER1$/check_dir $ARG1$ }  Modify the localhost.cfg file: define service{ use local-service host_name localhost service_description CHECK_LOG check_command check_dir!9999 } pgaref@ics.forth.gr
  • 17. oRemote Host IP is: 139.91.70.76 oYour IP has to be added at nrpe.cfg before running! pgaref@ics.forth.gr
  • 18. Follow the instructions to install NRPE Server “Enable NRPE Server-Ubuntu.txt”  You can Skip the Command and Service Definitions.  You can check your connection by running the following command and using the IP Address of the remote box you want to monitor. You should get the return “NRPE v2.8.1” if all is working. ◦ Command: /usr/lib/nagios/plugins/check_nrpe -H 139.91.70.76 pgaref@ics.forth.gr
  • 19. We have an NFS server running in the remote host. A plugin for monitoring NFS is included “check_nfsmount.pl”  We will modify NRPE configuration at the server part to be able to run check nfs remotely.  Finally test the command: ◦ /usr/lib/nagios/plugins/check_nrpe -H 139.91.70.76 -c check_nfs pgaref@ics.forth.gr
  • 20. Nagios can attempt to rectify a fault by running a script.  We can use Event Handlers to take action when something goes wrong. ◦ Growing File example:  Print error message  Compress File  Truncate File pgaref@ics.forth.gr
  • 21. We want to react to above-threshold growth of files.  Copy myhandler.sh to libexec/eventhandler ◦ Change permission to nagios user!  Add the following line to our command:  event_handler my_handler!$SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$ Finally add the command: define command{ command_name my_eventhandler command_line $USER1$/eventhandlers/myhandler $ARG1$ } pgaref@ics.forth.gr
  • 23. Nagios is a very useful tool saving time of administrators but can appear very complex when you first look at it.  My advice is: ◦ Install it on your test node (though this may well end up as your master server) ◦ Run a few check scripts by hand to get the feel for them ◦ Set up a simple config file that runs a few check on the local host ◦ Install nrpe on the host and nrpe and nagios-plugins on a remote host ◦ Run check nrpe by hand to get it working then add a couple of simple checks on the remote host ◦ Now add hosts and service until you run out, then write some more pgaref@ics.forth.gr
  • 24. http://www.nagios.org Nagios web site  http://sourceforge.net/projects/nagiosplug Nagios plugins site  http://www.nagiosexchange.org Unofficial Nagios plugin site  http://www.debianhelp.co.uk/nagios.htm A Debian tutorial on Nagios  http://www.nagios.com/ Commercial Nagios support pgaref@ics.forth.gr