SlideShare ist ein Scribd-Unternehmen logo
1 von 44
NRPE
Nagios Remote Plugin Executor


        Mike Weber

    mweber@spidertools.com
NRPE Concepts


  Agent Required on Client
  * plugin or script executes locally
  * daemon runs on client (port 5666)

  Nagios
  * check_nrpe connects to client


  Direct Checks
  * connect and collect data from client

  Indirect Checks
  * connect to client, execute plugin to connect to second client




                                    2012                            2
Basic Concepts




                 2012   3
NRPE: Active and Indirect Checks




                      2012         4
NRPE Components: Client


   NRPE Daemon
   * daemon managed by xinetd
   * security based on allowed_hosts
   * runs on port 5666
   * open firewall

   NRPE Commands File (nrpe.cfg)
   * check_nrpe connects to client
   * command definitions

   Plugins
   * connect and collect data from client




                                     2012   5
NRPE Components: Server


  One Plugin
  * check_nrpe (installed by default in XI)

  Host and Service Definitions
  * define the host
  * define each service




                                   2012       6
NRPE Variables
NRPE Variables: Client


   Agent Install
   * repository (CentOS, SUSE,Ubuntu, Debian, etc.)
   * XI agent from wizard
   * compile

   Daemon Install
   * repository (CentOS, SUSE,Ubuntu, Debian, etc.)
   * compile

   nrpe.cfg
   * repository (CentOS, SUSE,Ubuntu, Debian, etc.)
   * compile

   Command Definitions


                                 2012                 8
Client Variables: Daemon and Config


   Program
   /usr/local/nagios/bin/nrpe
   /usr/sbin/nrpe

   Daemon Config
   /etc/xinet.d/nrpe
   /etc/nagios/nrpe
   /etc/nagios3/nrpe (Ubuntu)




                                2012   9
NRPE: Daemon Config - nrpe


# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
     flags       = REUSE
     socket_type = stream
     port        = 5666
     wait        = no
     user        = nagios
     group        = nagios
     server       = /usr/local/nagios/bin/nrpe
     server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
     log_on_failure += USERID
     disable      = no
     only_from      = 127.0.0.1 192.168.5.99
}




                                            2012               10
Client Variables: Commands File


 Location
 /usr/local/nagios/etc/nrpe.cfg (compile)
 /usr/local/nagios/etc/nrpe/common.cfg (XI Agent)
 /etc/nagios/nrpe.cfg (SUSE)
 /etc/nagios3/nrpe.cfg (Ubuntu)

 Definitions
 * able to use arguments
 * dont_blame_nrpe=1

 command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$

 * unable to use arguments
 * dont_blame_nrpe=0

 command[check_users]=/usr/local/nagios/libexec/check_users -w 2 -c 4



                                         2012                                     11
Client Variables: Plugins Location


 /usr/local/nagios/libexec

 /usr/lib/nagios/plugins

 /usr/lib64/nagios/plugins




                           2012      12
NRPE Compile
Why Compile NRPE and Plugins?


 Eliminate Variables Across Distribution
 * same daemon settings and location
 * same nrpe definitions
 * same commands locations and configuration (nrpe.cfg)
 * same location for plugins
 * same versions

 Uniform Troubleshooting
 * standards across distributions
 * easier for multiple administrators

 Uniform Upgrades
 * method of upgrade the same
 * upgrades will be the latest




                                        2012              14
NRPE: Install Script

#!/bin/bash
if [[ $EUID -ne 0 ]]; then
       echo "This script must be run as root" 1>&2
       exit 1
fi

cd /tmp
wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz/download
tar zxvf nrpe-2.13.tar.gz
cd nrpe-2.13

yum install -y mod_ssl openssl-devel xinetd gcc make
./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib

make
make install
make install-daemon
make install-daemon-config
make install-xinetd

cp sample-config/nrpe.cfg /usr/local/nagios/etc/


                                                 2012                                        15
Plugins: Install Script
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
       echo "This script must be run as root" 1>&2
       exit 1
fi

cd /tmp
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins-
1.4.16.tar.gz/download

yum install -y gcc make mysql-devel mysql net-snmp

useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios

tar zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --with-nagios-user=nagios --with-nagios-group=nagios

make
make install
exit 0

                                               2012                                       16
NRPE: Locations When Compiled


 Daemon Configuration
 /etc/xinetd.d/nrpe


 Daemon Binary
 /usr/local/nagios/bin/nrpe


 Configuration File
 /usr/local/nagios/etc/nrpe.cfg


 Plugins
 /usr/local/nagios/libexec



                                  2012   17
NRPE: XI Agent
CentOS Agent: XI


cd /tmp
wget http://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
tar zxvf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent

./fullinstall

Allow from: 192.168.5.184

Stopping xinetd:                          [ OK ]
Starting xinetd:                          [ OK ]
Subcomponents installed OK
RESULT=0

##########################################################
###                                              ###
### Nagios XI Linux Agent Installation Complete! ###
###                                              ###
##########################################################


                                            2012                                  19
NRPE: Locations XI Agent

 Daemon Configuration
 /etc/xinetd.d/nrpe


 Daemon Binary
 /usr/local/nagios/bin/nrpe


 Configuration File
 /usr/local/nagios/etc/nrpe.cfg
     include_dir=/usr/local/nagios/etc/nrpe
    dont_blame_nrpe=1

 /usr/local/nagios/etc/nrpe/common.cfg

 Plugins
 /usr/local/nagios/libexec

                                    2012      20
common.cfg
### GENERIC SERVICES ###
command[check_init_service]=sudo /usr/local/nagios/libexec/check_init_service $ARG1$
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$

### MISC SYSTEM METRICS ###
#command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$
command[check_load]=/usr/local/nagios/libexec/check_load $ARG1$
command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$
command[check_mem]=/usr/local/nagios/libexec/custom_check_mem $ARG1$

### YUM UPDATES ###
command[check_yum]=/usr/local/nagios/libexec/check_yum

### DISK ###
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
command[check_ide_smart]=/usr/local/nagios/libexec/check_ide_smart $ARG1$

### PROCESSES ###
command[check_all_procs]=/usr/local/nagios/libexec/custom_check_procs
command[check_procs]=/usr/local/nagios/libexec/check_procs $ARG1$

### OPEN FILES ###
command[check_open_files]=/usr/local/nagios/libexec/check_open_files.pl $ARG1$

### NETWORK CONNECTIONS ###
command[check_netstat]=/usr/local/nagios/libexec/check_netstat.pl -p $ARG1$ $ARG2$

                                                   2012                                21
Commands: nrpe.cfg
No Variables Allowed

dont_blame_nrpe=0

command <service_check> <path_to_plugin> <plugin> <arguments>

command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1



Using Variables

dont_blame_nrpe=1

command <service_check> <path_to_plugin> <plugin> <arguments>

command[check_hda1]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p
$ARG3$




                                          2012                                        22
Downside of Arguments


 CentOS
 check_cpu_stats!-a '-w 85 -c 95'


 SUSE Enterprise
 check_cpu_stats!-a -w 80 -a -c 90




                                     2012   23
NRPE: Nagios Core
NRPE: Active Check




                     2012   25
Nagios Core: Service Checks

No Arguments
define service{
     use                   generic-service
     host_name             centos
     service_description   Users
     check_command          check_nrpe!check_users
     }
define service{
     use                   generic-service,srv-pnp
     host_name             centos
     service_description   Mailq
     check_command         check_nrpe!check_mailq
   }

Arguments
define service{
     use                   generic-service
     host_name             centos
     service_description   Disk
     check_command         check_nrpe_arg!check_disk!80!90!/
  }

                                           2012                26
Nagios Core: Command Definition


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

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

Arguments
define command{
     command_name      check_nrpe_arg
     command_line      $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a
$ARG2$ $ARG3$ $ARG4$
}



                                  2012                                    27
Summary
No Arguments
define command{
     command_name          check_nrpe
     command_line          $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
define service{
     use                   generic-service
     host_name             centos
     service_description   Users
     check_command         check_nrpe!check_users
     }
command[check_users]=/usr/local/nagios/libexec/check_users -w 2 -c 4

Arguments
define command{
     command_name           check_nrpe_arg
     command_line           $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
$ARG3$ $ARG4$
}
define service{
     use                    generic-service
     host_name              centos
     service_description    Disk
     check_command          check_nrpe_arg!check_disk!80!90!/
  }
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$

                                         2012                                         28
AIDE: Advanced Intrusion Detection Environment

Script
!/bin/bash
# Create 4 Hour Cron Job With AIDE
logfile=/tmp/aide
x=$(grep "Looks okay" $logfile | wc -l)
if [ $x -eq 1 ]
then
       echo "All Systems Look OK"
       stateid=0
else
       echo "$(egrep "added|changed" /tmp/aide)"
       stateid=2
fi
exit $stateid

Command in nrpe.cfg
command[check_aide]=/usr/local/nagios/libexec/check_aide

Service Definition
define service{
     use              generic-service
     host_name           bash
     service_description AIDE
     check_command           check_nrpe!check_aide
     }

                                                   2012    29
NRPE: Nagios XI
NRPE: Linux Server




                     2012   31
NRPE: Linux Server




                     2012   32
NRPE: Linux Server




                     2012   33
NRPE: Linux Server




                     2012   34
NRPE: Linux Server




                     2012   35
/etc/init.d




ls /etc/init.d
crond            gpm         iscsi        lvm2-monitor   named       nscd        rawdevices
snmpd             sysstat    dc_client    haldaemon      iscsid      mcstrans     netconsole
ntpd             rdisc       snmptrapd    vsftpd         dc_server   halt         killall
messagebus       netfs       portmap      restorecond    snmptt      winbind      dovecot
httpd            kudzu       multipathd   netplugd        postfix    saslauthd   sshd
xinetd           functions   iptables     lm_sensors     mysqld      network     postgresql-9.0
single           syslog




                                              2012                                                36
NRPE: Linux Server




                     2012   37
NRPE: Linux Server




                     2012   38
NRPE: Linux Server




                     2012   39
NRPE: Linux Server




                     2012   40
NRPE: Additional Checks




                     2012   41
NRPE: Additional Checks




                     2012   42
NRPE: Additional Checks




                     2012   43
NRPE: Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Distributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- PuppetDistributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- Puppet
Puppet
 

Was ist angesagt? (19)

Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
Relayd: a load balancer for OpenBSD
Relayd: a load balancer for OpenBSD Relayd: a load balancer for OpenBSD
Relayd: a load balancer for OpenBSD
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
 
Pf: the OpenBSD packet filter
Pf: the OpenBSD packet filterPf: the OpenBSD packet filter
Pf: the OpenBSD packet filter
 
Distributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- PuppetDistributed monitoring at Hyves- Puppet
Distributed monitoring at Hyves- Puppet
 
Intro django
Intro djangoIntro django
Intro django
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
Alexander Reelsen - Seccomp for Developers
Alexander Reelsen - Seccomp for DevelopersAlexander Reelsen - Seccomp for Developers
Alexander Reelsen - Seccomp for Developers
 
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PuppetCamp SEA 1 - Puppet Deployment  at OnAppPuppetCamp SEA 1 - Puppet Deployment  at OnApp
PuppetCamp SEA 1 - Puppet Deployment at OnApp
 
Security and dev ops for high velocity organizations
Security and dev ops for high velocity organizationsSecurity and dev ops for high velocity organizations
Security and dev ops for high velocity organizations
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
 
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
Source Code of Building Linux IPv6 DNS Server (Complete Sourcecode)
 
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpracticesConf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy
 
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018) Speed up web APIs with Expressive and Swoole (PHP Day 2018)
Speed up web APIs with Expressive and Swoole (PHP Day 2018)
 
ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments
 
Adventures in infrastructure as code
Adventures in infrastructure as codeAdventures in infrastructure as code
Adventures in infrastructure as code
 

Andere mochten auch

Andere mochten auch (13)

Nagios XI Best Practices
Nagios XI Best PracticesNagios XI Best Practices
Nagios XI Best Practices
 
Nagios Conference 2013 - James Clark - Nagios On-Call Rotation
Nagios Conference 2013 - James Clark - Nagios On-Call RotationNagios Conference 2013 - James Clark - Nagios On-Call Rotation
Nagios Conference 2013 - James Clark - Nagios On-Call Rotation
 
Nagios Conference 2011 - Jeff Sly - Case Study Nagios @ Nu Skin
Nagios Conference 2011 - Jeff Sly - Case Study Nagios @ Nu SkinNagios Conference 2011 - Jeff Sly - Case Study Nagios @ Nu Skin
Nagios Conference 2011 - Jeff Sly - Case Study Nagios @ Nu Skin
 
Nagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XI
Nagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XINagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XI
Nagios Conference 2014 - Sam Lansing - Advanced Features of Nagios XI
 
Nagios Conference 2014 - Andy Brist - Intro to Incident Manager
Nagios Conference 2014 - Andy Brist - Intro to Incident ManagerNagios Conference 2014 - Andy Brist - Intro to Incident Manager
Nagios Conference 2014 - Andy Brist - Intro to Incident Manager
 
Nagios Conference 2011 - Mike Guthrie - Distributed Monitoring With Nagios
Nagios Conference 2011 - Mike Guthrie - Distributed Monitoring With NagiosNagios Conference 2011 - Mike Guthrie - Distributed Monitoring With Nagios
Nagios Conference 2011 - Mike Guthrie - Distributed Monitoring With Nagios
 
Writing Nagios Plugins in Python
Writing Nagios Plugins in PythonWriting Nagios Plugins in Python
Writing Nagios Plugins in Python
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...
Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...
Nagios Conference 2014 - Scott Wilkerson - Log Monitoring and Log Management ...
 
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
 
Computer monitoring with the Open Monitoring Distribution
Computer monitoring with the Open Monitoring DistributionComputer monitoring with the Open Monitoring Distribution
Computer monitoring with the Open Monitoring Distribution
 
Nagios
NagiosNagios
Nagios
 
Monitoring with Nagios and Ganglia
Monitoring with Nagios and GangliaMonitoring with Nagios and Ganglia
Monitoring with Nagios and Ganglia
 

Ähnlich wie Nagios Conference 2012 - Mike Weber - NRPE

Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Simon Boulet
 

Ähnlich wie Nagios Conference 2012 - Mike Weber - NRPE (20)

Graphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagiosGraphing Nagios services with pnp4nagios
Graphing Nagios services with pnp4nagios
 
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...
 
Nrpe
NrpeNrpe
Nrpe
 
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.
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on Docker
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Nagios intro
Nagios intro Nagios intro
Nagios intro
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails App
 
Nagios Conference 2012 - Mike Weber - Failover
Nagios Conference 2012 - Mike Weber - FailoverNagios Conference 2012 - Mike Weber - Failover
Nagios Conference 2012 - Mike Weber - Failover
 
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical NagiosNagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
Nagios Conference 2014 - Leland Lammert - Distributed Heirarchical Nagios
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmaple
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
 
Hands on Virtualization with Ganeti
Hands on Virtualization with GanetiHands on Virtualization with Ganeti
Hands on Virtualization with Ganeti
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 

Mehr von Nagios

Mehr von Nagios (20)

Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture Overview
 
Trevor McDonald - Nagios XI Under The Hood
Trevor McDonald  - Nagios XI Under The HoodTrevor McDonald  - Nagios XI Under The Hood
Trevor McDonald - Nagios XI Under The Hood
 
Sean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient NotificationsSean Falzon - Nagios - Resilient Notifications
Sean Falzon - Nagios - Resilient Notifications
 
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise EditionMarcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
Marcus Rochelle - Landis+Gyr - Monitoring with Nagios Enterprise Edition
 
Janice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios PluginsJanice Singh - Writing Custom Nagios Plugins
Janice Singh - Writing Custom Nagios Plugins
 
Dave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical ExperienceDave Williams - Nagios Log Server - Practical Experience
Dave Williams - Nagios Log Server - Practical Experience
 
Mike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service ChecksMike Weber - Nagios and Group Deployment of Service Checks
Mike Weber - Nagios and Group Deployment of Service Checks
 
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios InstallationMike Guthrie - Revamping Your 10 Year Old Nagios Installation
Mike Guthrie - Revamping Your 10 Year Old Nagios Installation
 
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
Bryan Heden - Agile Networks - Using Nagios XI as the platform for Monitoring...
 
Matt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With NagiosMatt Bruzek - Monitoring Your Public Cloud With Nagios
Matt Bruzek - Monitoring Your Public Cloud With Nagios
 
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.
 
Eric Loyd - Fractal Nagios
Eric Loyd - Fractal NagiosEric Loyd - Fractal Nagios
Eric Loyd - Fractal Nagios
 
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
Marcelo Perazolo, Lead Software Architect, IBM Corporation - Monitoring a Pow...
 
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
Thomas Schmainda - Tracking Boeing Satellites With Nagios - Nagios World Conf...
 
Nagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson OpeningNagios World Conference 2015 - Scott Wilkerson Opening
Nagios World Conference 2015 - Scott Wilkerson Opening
 
Nagios Log Server - Features
Nagios Log Server - FeaturesNagios Log Server - Features
Nagios Log Server - Features
 
Nagios Network Analyzer - Features
Nagios Network Analyzer - FeaturesNagios Network Analyzer - Features
Nagios Network Analyzer - Features
 
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing NagiosNagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
Nagios Conference 2014 - Dorance Martinez Cortes - Customizing Nagios
 
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment OptionsNagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
Nagios Conference 2014 - Mike Weber - Nagios Rapid Deployment Options
 
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
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Nagios Conference 2012 - Mike Weber - NRPE

  • 1. NRPE Nagios Remote Plugin Executor Mike Weber mweber@spidertools.com
  • 2. NRPE Concepts Agent Required on Client * plugin or script executes locally * daemon runs on client (port 5666) Nagios * check_nrpe connects to client Direct Checks * connect and collect data from client Indirect Checks * connect to client, execute plugin to connect to second client 2012 2
  • 3. Basic Concepts 2012 3
  • 4. NRPE: Active and Indirect Checks 2012 4
  • 5. NRPE Components: Client NRPE Daemon * daemon managed by xinetd * security based on allowed_hosts * runs on port 5666 * open firewall NRPE Commands File (nrpe.cfg) * check_nrpe connects to client * command definitions Plugins * connect and collect data from client 2012 5
  • 6. NRPE Components: Server One Plugin * check_nrpe (installed by default in XI) Host and Service Definitions * define the host * define each service 2012 6
  • 8. NRPE Variables: Client Agent Install * repository (CentOS, SUSE,Ubuntu, Debian, etc.) * XI agent from wizard * compile Daemon Install * repository (CentOS, SUSE,Ubuntu, Debian, etc.) * compile nrpe.cfg * repository (CentOS, SUSE,Ubuntu, Debian, etc.) * compile Command Definitions 2012 8
  • 9. Client Variables: Daemon and Config Program /usr/local/nagios/bin/nrpe /usr/sbin/nrpe Daemon Config /etc/xinet.d/nrpe /etc/nagios/nrpe /etc/nagios3/nrpe (Ubuntu) 2012 9
  • 10. NRPE: Daemon Config - nrpe # default: on # description: NRPE (Nagios Remote Plugin Executor) service nrpe { flags = REUSE socket_type = stream port = 5666 wait = no user = nagios group = nagios server = /usr/local/nagios/bin/nrpe server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd log_on_failure += USERID disable = no only_from = 127.0.0.1 192.168.5.99 } 2012 10
  • 11. Client Variables: Commands File Location /usr/local/nagios/etc/nrpe.cfg (compile) /usr/local/nagios/etc/nrpe/common.cfg (XI Agent) /etc/nagios/nrpe.cfg (SUSE) /etc/nagios3/nrpe.cfg (Ubuntu) Definitions * able to use arguments * dont_blame_nrpe=1 command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$ * unable to use arguments * dont_blame_nrpe=0 command[check_users]=/usr/local/nagios/libexec/check_users -w 2 -c 4 2012 11
  • 12. Client Variables: Plugins Location /usr/local/nagios/libexec /usr/lib/nagios/plugins /usr/lib64/nagios/plugins 2012 12
  • 14. Why Compile NRPE and Plugins? Eliminate Variables Across Distribution * same daemon settings and location * same nrpe definitions * same commands locations and configuration (nrpe.cfg) * same location for plugins * same versions Uniform Troubleshooting * standards across distributions * easier for multiple administrators Uniform Upgrades * method of upgrade the same * upgrades will be the latest 2012 14
  • 15. NRPE: Install Script #!/bin/bash if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" 1>&2 exit 1 fi cd /tmp wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz/download tar zxvf nrpe-2.13.tar.gz cd nrpe-2.13 yum install -y mod_ssl openssl-devel xinetd gcc make ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib make make install make install-daemon make install-daemon-config make install-xinetd cp sample-config/nrpe.cfg /usr/local/nagios/etc/ 2012 15
  • 16. Plugins: Install Script #!/bin/bash if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" 1>&2 exit 1 fi cd /tmp wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins- 1.4.16.tar.gz/download yum install -y gcc make mysql-devel mysql net-snmp useradd nagios groupadd nagcmd usermod -a -G nagcmd nagios tar zxvf nagios-plugins-1.4.16.tar.gz cd nagios-plugins-1.4.16 ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install exit 0 2012 16
  • 17. NRPE: Locations When Compiled Daemon Configuration /etc/xinetd.d/nrpe Daemon Binary /usr/local/nagios/bin/nrpe Configuration File /usr/local/nagios/etc/nrpe.cfg Plugins /usr/local/nagios/libexec 2012 17
  • 19. CentOS Agent: XI cd /tmp wget http://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz tar zxvf linux-nrpe-agent.tar.gz cd linux-nrpe-agent ./fullinstall Allow from: 192.168.5.184 Stopping xinetd: [ OK ] Starting xinetd: [ OK ] Subcomponents installed OK RESULT=0 ########################################################## ### ### ### Nagios XI Linux Agent Installation Complete! ### ### ### ########################################################## 2012 19
  • 20. NRPE: Locations XI Agent Daemon Configuration /etc/xinetd.d/nrpe Daemon Binary /usr/local/nagios/bin/nrpe Configuration File /usr/local/nagios/etc/nrpe.cfg include_dir=/usr/local/nagios/etc/nrpe dont_blame_nrpe=1 /usr/local/nagios/etc/nrpe/common.cfg Plugins /usr/local/nagios/libexec 2012 20
  • 21. common.cfg ### GENERIC SERVICES ### command[check_init_service]=sudo /usr/local/nagios/libexec/check_init_service $ARG1$ command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$ ### MISC SYSTEM METRICS ### #command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$ command[check_load]=/usr/local/nagios/libexec/check_load $ARG1$ command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$ command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$ command[check_mem]=/usr/local/nagios/libexec/custom_check_mem $ARG1$ ### YUM UPDATES ### command[check_yum]=/usr/local/nagios/libexec/check_yum ### DISK ### command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$ command[check_ide_smart]=/usr/local/nagios/libexec/check_ide_smart $ARG1$ ### PROCESSES ### command[check_all_procs]=/usr/local/nagios/libexec/custom_check_procs command[check_procs]=/usr/local/nagios/libexec/check_procs $ARG1$ ### OPEN FILES ### command[check_open_files]=/usr/local/nagios/libexec/check_open_files.pl $ARG1$ ### NETWORK CONNECTIONS ### command[check_netstat]=/usr/local/nagios/libexec/check_netstat.pl -p $ARG1$ $ARG2$ 2012 21
  • 22. Commands: nrpe.cfg No Variables Allowed dont_blame_nrpe=0 command <service_check> <path_to_plugin> <plugin> <arguments> command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1 Using Variables dont_blame_nrpe=1 command <service_check> <path_to_plugin> <plugin> <arguments> command[check_hda1]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ 2012 22
  • 23. Downside of Arguments CentOS check_cpu_stats!-a '-w 85 -c 95' SUSE Enterprise check_cpu_stats!-a -w 80 -a -c 90 2012 23
  • 26. Nagios Core: Service Checks No Arguments define service{ use generic-service host_name centos service_description Users check_command check_nrpe!check_users } define service{ use generic-service,srv-pnp host_name centos service_description Mailq check_command check_nrpe!check_mailq } Arguments define service{ use generic-service host_name centos service_description Disk check_command check_nrpe_arg!check_disk!80!90!/ } 2012 26
  • 27. Nagios Core: Command Definition No Arguments define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } define command{ command_name check_nrpe_60 command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c $ARG1$ } Arguments define command{ command_name check_nrpe_arg command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ } 2012 27
  • 28. Summary No Arguments define command{ command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ } define service{ use generic-service host_name centos service_description Users check_command check_nrpe!check_users } command[check_users]=/usr/local/nagios/libexec/check_users -w 2 -c 4 Arguments define command{ command_name check_nrpe_arg command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ } define service{ use generic-service host_name centos service_description Disk check_command check_nrpe_arg!check_disk!80!90!/ } command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$ 2012 28
  • 29. AIDE: Advanced Intrusion Detection Environment Script !/bin/bash # Create 4 Hour Cron Job With AIDE logfile=/tmp/aide x=$(grep "Looks okay" $logfile | wc -l) if [ $x -eq 1 ] then echo "All Systems Look OK" stateid=0 else echo "$(egrep "added|changed" /tmp/aide)" stateid=2 fi exit $stateid Command in nrpe.cfg command[check_aide]=/usr/local/nagios/libexec/check_aide Service Definition define service{ use generic-service host_name bash service_description AIDE check_command check_nrpe!check_aide } 2012 29
  • 36. /etc/init.d ls /etc/init.d crond gpm iscsi lvm2-monitor named nscd rawdevices snmpd sysstat dc_client haldaemon iscsid mcstrans netconsole ntpd rdisc snmptrapd vsftpd dc_server halt killall messagebus netfs portmap restorecond snmptt winbind dovecot httpd kudzu multipathd netplugd postfix saslauthd sshd xinetd functions iptables lm_sensors mysqld network postgresql-9.0 single syslog 2012 36