Benutzer-Werkzeuge

Webseiten-Werkzeuge


Action disabled: source
tachtler:icinga2_-_plugins

Icinga2 - Plugins

Icinga ist eine vollständig auf Open-Source-Basis basierende, skalierbare und erweiterbare Monitoring-Lösung welche die Verfügbarkeit von definierten Ressource überprüft und über eine Benachrichtigungssystem verfügt.

Ab hier werden zur Ausführung nachfolgender Befehle root-Rechte benötigt. Um der Benutzer root zu werden, melden Sie sich bitte als root-Benutzer am System an, oder wechseln mit nachfolgendem Befehl zum Benutzer root:

$ su -
Password:

Installation

Die Installation erfolgt durch

  1. Download in das Verzeichnis /usr/lib64/nagios/plugins
  2. Ausführbar machen durch
    # chmod +x ...
  3. Hinzufügen der Konfiguration standardmäßig unter
    /etc/icinga2/conf.d/commands.conf

Nachfolgende Liste beinhaltet einige externe Links von Quellen zu weiteren Plugins

perl-Monitoring-Plugin

Nachfolgende Plugins können unter umständen das perl-Modul Monitoring/Plugin.pm benötigen, welches durch Installation des rpm-Paktes

  • perl-Monitoring-Plugin

durch ausführen des nachfolgenden Befehls, installiert werden kann:

# yum install perl-Monitoring-Plugin
Loaded plugins: changelog, priorities
213 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package perl-Monitoring-Plugin.noarch 0:0.38-1.el7.1 will be installed
--> Processing Dependency: perl(Params::Validate) for package: perl-Monitoring-Plugin-0.38-1.el7.1.noarch
--> Processing Dependency: perl(Math::Calc::Units) for package: perl-Monitoring-Plugin-0.38-1.el7.1.noarch
--> Processing Dependency: perl(Config::Tiny) for package: perl-Monitoring-Plugin-0.38-1.el7.1.noarch
--> Processing Dependency: perl(Class::Accessor::Fast) for package: perl-Monitoring-Plugin-0.38-1.el7.1.noarch
--> Processing Dependency: perl(Class::Accessor) for package: perl-Monitoring-Plugin-0.38-1.el7.1.noarch
--> Running transaction check
---> Package perl-Class-Accessor.noarch 0:0.34-12.el7 will be installed
---> Package perl-Config-Tiny.noarch 0:2.14-7.el7 will be installed
---> Package perl-Math-Calc-Units.noarch 0:1.07-9.el7 will be installed
---> Package perl-Params-Validate.x86_64 0:1.08-4.el7 will be installed
--> Processing Dependency: perl(Module::Implementation) for package: perl-Params-Validate-1.08-4.el7.x86_64
--> Running transaction check
---> Package perl-Module-Implementation.noarch 0:0.06-6.el7 will be installed
--> Processing Dependency: perl(Module::Runtime) >= 0.012 for package: perl-Module-Implementation-0.06-6.el7.noarch
--> Processing Dependency: perl(Try::Tiny) for package: perl-Module-Implementation-0.06-6.el7.noarch
--> Running transaction check
---> Package perl-Module-Runtime.noarch 0:0.013-4.el7 will be installed
---> Package perl-Try-Tiny.noarch 0:0.12-2.el7 will be installed
--> Finished Dependency Resolution

Changes in packages about to be updated:


Dependencies Resolved

===============================================================================
 Package                         Arch        Version           Repository
                                                                          Size
===============================================================================
Installing:
 perl-Monitoring-Plugin          noarch      0.38-1.el7.1      epel       62 k
Installing for dependencies:
 perl-Class-Accessor             noarch      0.34-12.el7       epel       29 k
 perl-Config-Tiny                noarch      2.14-7.el7        base       25 k
 perl-Math-Calc-Units            noarch      1.07-9.el7        epel       42 k
 perl-Module-Implementation      noarch      0.06-6.el7        base       17 k
 perl-Module-Runtime             noarch      0.013-4.el7       base       19 k
 perl-Params-Validate            x86_64      1.08-4.el7        base       69 k
 perl-Try-Tiny                   noarch      0.12-2.el7        base       23 k

Transaction Summary
===============================================================================
Install  1 Package (+7 Dependent packages)

Total download size: 285 k
Installed size: 500 k
Is this ok [y/d/N]: y
Downloading packages:
(1/8): perl-Class-Accessor-0.34-12.el7.noarch.rpm         |  29 kB   00:00     
(2/8): perl-Math-Calc-Units-1.07-9.el7.noarch.rpm         |  42 kB   00:00     
(3/8): perl-Config-Tiny-2.14-7.el7.noarch.rpm             |  25 kB   00:00     
(4/8): perl-Module-Implementation-0.06-6.el7.noarch.rpm   |  17 kB   00:00     
(5/8): perl-Module-Runtime-0.013-4.el7.noarch.rpm         |  19 kB   00:00     
(6/8): perl-Params-Validate-1.08-4.el7.x86_64.rpm         |  69 kB   00:00     
(7/8): perl-Try-Tiny-0.12-2.el7.noarch.rpm                |  23 kB   00:00     
(8/8): perl-Monitoring-Plugin-0.38-1.el7.1.noarch.rpm     |  62 kB   00:00     
-------------------------------------------------------------------------------
Total                                             426 kB/s | 285 kB  00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-Module-Runtime-0.013-4.el7.noarch                      1/8 
  Installing : perl-Class-Accessor-0.34-12.el7.noarch                      2/8 
  Installing : perl-Try-Tiny-0.12-2.el7.noarch                             3/8 
  Installing : perl-Module-Implementation-0.06-6.el7.noarch                4/8 
  Installing : perl-Params-Validate-1.08-4.el7.x86_64                      5/8 
  Installing : perl-Config-Tiny-2.14-7.el7.noarch                          6/8 
  Installing : perl-Math-Calc-Units-1.07-9.el7.noarch                      7/8 
  Installing : perl-Monitoring-Plugin-0.38-1.el7.1.noarch                  8/8 
  Verifying  : perl-Math-Calc-Units-1.07-9.el7.noarch                      1/8 
  Verifying  : perl-Module-Implementation-0.06-6.el7.noarch                2/8 
  Verifying  : perl-Config-Tiny-2.14-7.el7.noarch                          3/8 
  Verifying  : perl-Try-Tiny-0.12-2.el7.noarch                             4/8 
  Verifying  : perl-Class-Accessor-0.34-12.el7.noarch                      5/8 
  Verifying  : perl-Monitoring-Plugin-0.38-1.el7.1.noarch                  6/8 
  Verifying  : perl-Params-Validate-1.08-4.el7.x86_64                      7/8 
  Verifying  : perl-Module-Runtime-0.013-4.el7.noarch                      8/8 

Installed:
  perl-Monitoring-Plugin.noarch 0:0.38-1.el7.1                                 

Dependency Installed:
  perl-Class-Accessor.noarch 0:0.34-12.el7                                     
  perl-Config-Tiny.noarch 0:2.14-7.el7                                         
  perl-Math-Calc-Units.noarch 0:1.07-9.el7                                     
  perl-Module-Implementation.noarch 0:0.06-6.el7                               
  perl-Module-Runtime.noarch 0:0.013-4.el7                                     
  perl-Params-Validate.x86_64 0:1.08-4.el7                                     
  perl-Try-Tiny.noarch 0:0.12-2.el7                                            

Complete!

Nachfolgender Befehl listet den Inhalt des rpm-Pakets - perl-Monitoring-Plugin auf:

# rpm -qil perl-Monitoring-Plugin
Name        : perl-Monitoring-Plugin
Version     : 0.38
Release     : 1.el7.1
Architecture: noarch
Install Date: Thu 10 Dec 2015 12:15:59 PM CET
Group       : Unspecified
Size        : 114980
License     : GPL+ or Artistic
Signature   : RSA/SHA256, Fri 27 Feb 2015 08:24:12 PM CET, Key ID 6a2faea2352c64e5
Source RPM  : perl-Monitoring-Plugin-0.38-1.el7.1.src.rpm
Build Date  : Thu 26 Feb 2015 11:51:21 PM CET
Build Host  : buildvm-05.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://search.cpan.org/dist/Monitoring-Plugin/
Summary     : Family of modules to streamline writing plugins for various monitoring systems
Description :
Monitoring::Plugin and its associated Monitoring::Plugin::* modules are a
family of perl modules to streamline writing Monitoring plugins. The main
end user modules are Monitoring::Plugin, providing an object-oriented
interface to the entire Monitoring::Plugin::* collection, and
Monitoring::Plugin::Functions, providing a simpler functional interface to
a useful subset of the available functionality.
/usr/share/doc/perl-Monitoring-Plugin-0.38
/usr/share/doc/perl-Monitoring-Plugin-0.38/Changes
/usr/share/doc/perl-Monitoring-Plugin-0.38/README
/usr/share/doc/perl-Monitoring-Plugin-0.38/notes
/usr/share/man/man3/Monitoring::Plugin.3pm.gz
/usr/share/man/man3/Monitoring::Plugin::Config.3pm.gz
/usr/share/man/man3/Monitoring::Plugin::ExitResult.3pm.gz
/usr/share/man/man3/Monitoring::Plugin::Functions.3pm.gz
/usr/share/man/man3/Monitoring::Plugin::Getopt.3pm.gz
/usr/share/man/man3/Monitoring::Plugin::Performance.3pm.gz
/usr/share/man/man3/Monitoring::Plugin::Range.3pm.gz
/usr/share/man/man3/Monitoring::Plugin::Threshold.3pm.gz
/usr/share/perl5/vendor_perl/Monitoring
/usr/share/perl5/vendor_perl/Monitoring/Plugin
/usr/share/perl5/vendor_perl/Monitoring/Plugin.pm
/usr/share/perl5/vendor_perl/Monitoring/Plugin/Config.pm
/usr/share/perl5/vendor_perl/Monitoring/Plugin/ExitResult.pm
/usr/share/perl5/vendor_perl/Monitoring/Plugin/Functions.pm
/usr/share/perl5/vendor_perl/Monitoring/Plugin/Getopt.pm
/usr/share/perl5/vendor_perl/Monitoring/Plugin/Performance.pm
/usr/share/perl5/vendor_perl/Monitoring/Plugin/Range.pm
/usr/share/perl5/vendor_perl/Monitoring/Plugin/Threshold.pm

perl-Nagios-Plugin

Nachfolgende Plugins können unter umständen das perl-Modul Nagios/Plugin.pm benötigen, welches durch Installation des rpm-Paktes

  • perl-Nagios-Plugin

durch ausführen des nachfolgenden Befehls, installiert werden kann:

# yum install perl-Nagios-Plugin
Loaded plugins: changelog, priorities
213 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package perl-Nagios-Plugin.noarch 0:0.36-7.el7 will be installed
--> Finished Dependency Resolution

Changes in packages about to be updated:


Dependencies Resolved

===============================================================================
 Package                   Arch          Version             Repository   Size
===============================================================================
Installing:
 perl-Nagios-Plugin        noarch        0.36-7.el7          epel         63 k

Transaction Summary
===============================================================================
Install  1 Package

Total download size: 63 k
Installed size: 109 k
Is this ok [y/d/N]: y
Downloading packages:
perl-Nagios-Plugin-0.36-7.el7.noarch.rpm                  |  63 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-Nagios-Plugin-0.36-7.el7.noarch                        1/1 
  Verifying  : perl-Nagios-Plugin-0.36-7.el7.noarch                        1/1 

Installed:
  perl-Nagios-Plugin.noarch 0:0.36-7.el7                                       

Complete!

Nachfolgender Befehl listet den Inhalt des rpm-Pakets - perl-Nagios-Plugin auf:

# rpm -qil perl-Nagios-Plugin
Name        : perl-Nagios-Plugin
Version     : 0.36
Release     : 7.el7
Architecture: noarch
Install Date: Thu 10 Dec 2015 12:30:24 PM CET
Group       : Development/Libraries
Size        : 111956
License     : GPL+ or Artistic
Signature   : RSA/SHA256, Thu 03 Jul 2014 04:20:43 PM CEST, Key ID 6a2faea2352c64e5
Source RPM  : perl-Nagios-Plugin-0.36-7.el7.src.rpm
Build Date  : Mon 30 Jun 2014 09:06:41 PM CEST
Build Host  : buildhw-11.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://search.cpan.org/dist/Nagios-Plugin/
Summary     : Family of perl modules to streamline writing Nagios plugins
Description :
Nagios::Plugin and its associated Nagios::Plugin::* modules are a family of
perl modules to streamline writing Nagios plugins. The main end user
modules are Nagios::Plugin, providing an object-oriented interface to the
entire Nagios::Plugin::* collection, and Nagios::Plugin::Functions,
providing a simpler functional interface to a useful subset of the
available functionality.
/usr/share/doc/perl-Nagios-Plugin-0.36
/usr/share/doc/perl-Nagios-Plugin-0.36/Changes
/usr/share/doc/perl-Nagios-Plugin-0.36/README
/usr/share/man/man3/Nagios::Plugin.3pm.gz
/usr/share/man/man3/Nagios::Plugin::Config.3pm.gz
/usr/share/man/man3/Nagios::Plugin::ExitResult.3pm.gz
/usr/share/man/man3/Nagios::Plugin::Functions.3pm.gz
/usr/share/man/man3/Nagios::Plugin::Getopt.3pm.gz
/usr/share/man/man3/Nagios::Plugin::Performance.3pm.gz
/usr/share/man/man3/Nagios::Plugin::Range.3pm.gz
/usr/share/man/man3/Nagios::Plugin::Threshold.3pm.gz
/usr/share/perl5/vendor_perl/Nagios
/usr/share/perl5/vendor_perl/Nagios/Plugin
/usr/share/perl5/vendor_perl/Nagios/Plugin.pm
/usr/share/perl5/vendor_perl/Nagios/Plugin/Config.pm
/usr/share/perl5/vendor_perl/Nagios/Plugin/ExitResult.pm
/usr/share/perl5/vendor_perl/Nagios/Plugin/Functions.pm
/usr/share/perl5/vendor_perl/Nagios/Plugin/Getopt.pm
/usr/share/perl5/vendor_perl/Nagios/Plugin/Performance.pm
/usr/share/perl5/vendor_perl/Nagios/Plugin/Range.pm
/usr/share/perl5/vendor_perl/Nagios/Plugin/Threshold.pm

Plugins: IPMI-Board

check_ipmi_sensor

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Hardware/Server-Hardware/IPMI-Sensor-Monitoring-Plugin/details
Abhängigkeiten Es ist die Installation der rpm-Pakete perl-IPC-Run und freeipmi erforderlich
Beschreibung List über einen Zugriff auf ein IPMI-Board dessen Werte aus und liefert entsprechende Rückgabewerte.
Konfiguration
object CheckCommand "my_ipmi_sensor" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_ipmi_sensor" ]
 
  arguments 			= {
    "-H" = {
      value 			= "$ipmisensor_hostname$"
      description               = "hostname or IP of the IPMI interface."
      required                  = true     
    }
    "-f" = {
      value 			= "$ipmisensor_config_file$"
      description               = "<FreeIPMI config file>"
      required                  = false
      set_if                    = "$ipmisensor_config_file$"
    }     
    "-U" = {
      value 			= "$ipmisensor_username$"
      description               = "IPMI username"
      required                  = true     
    }
    "-P" = {
      value 			= "$ipmisensor_password$"
      description               = "IPMI password"
      required                  = true     
    }
    "-L" = {
      value 			= "$ipmisensor_privilege_level$"
      description               = "IPMI privilege level"
      required                  = true     
    }
    "-O" = {
      value 			= "$ipmisensor_options$"
      description               = "<FreeIPMI options>"
      required                  = false
      set_if                    = "$ipmisensor_options$"
    } 
    "-b" = {
      value 			= "$ipmisensor_backward$"
      description               = "backward compatibility mode for FreeIPMI 0.5.*"
      required                  = false
      set_if                    = "$ipmisensor_backward$"
    }
    "-T" = {
      value 			= "$ipmisensor_type$"
      description               = "limit sensors to query based on IPMI sensor type."
      required                  = false
      set_if                    = "$ipmisensor_type$"
    }    
    "-x" = {
      value 			= "$ipmisensor_exclude_id$"
      description               = "exclude sensor matching <sensor id>."
      required                  = false
      set_if                    = "$ipmisensor_exclude_id$"
    }         
    "-v" = {
      value 			= "$ipmisensor_verbose$"
      description               = "single line output with additional details for warnings"
      required                  = false
      set_if                    = "$ipmisensor_verbose$"
    }    
    "-vv" = {
      value 			= "$ipmisensor_verbose2$"
      description               = "multi line output, also with additional details for warnings"
      required                  = false
      set_if                    = "$ipmisensor_verbose2$"
    }   
    "-vvv" = {
      value 			= "$ipmisensor_verbose3$"
      description               = "debugging output, followed by normal multi line output"
      required                  = false
      set_if                    = "$ipmisensor_verbose3$"
    }    
    "-o" = {
      value 			= "$ipmisensor_zenoss$"
      description               = "create ZENOSS compatible formatted output"
      required                  = false
      set_if                    = "$ipmisensor_zenoss$"
    }    
  }
 
} 

Plugins: Betriebssystem

check_mem

Beschreibung Externer Link / Zusätzliche Informationen
Download https://github.com/justintime/nagios-plugins/tree/master/
Download-RAW https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl
Beschreibung Überarbeitete Version von check_mem.pl welche den Speicherermittlung nach Cache-Speicher und Applikations-Speicher aufsplittet - Siehe auch dazu den externen Link: http://sysadminsjourney.com/content/2009/06/04/new-and-improved-checkmempl-nagios-plugin.
Konfiguration
object CheckCommand "my_mem" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_mem.pl" ]
 
  arguments = {
    "-f" = {
      description               = "Check FREE memory"
      required                  = false
      set_if                    = "$mem_free$"
    }
    "-u" = {
      description               = "Check USED memory"
      required                  = false
      set_if                    = "$mem_used$"
    }
    "-C" = {
      description               = "Count OS caches as FREE memory"
      required                  = false
      set_if                    = "$mem_cache$"
    }
    "-w" = {
      value                     = "$mem_warning$"
      description               = "Percent free/used when to warn"
      required                  = true
    }
    "-c" = {
      value                     = "$mem_critical$"
      description               = "Percent free/used when critical"
      required                  = true
    }
  }
 
  vars.mem_warning           = "10"
  vars.mem_critical          = "5"
 
}

check_running_kernel

Beschreibung Externer Link / Zusätzliche Informationen
Download https://github.com/dnsmichi/icinga-plugins/blob/master/scripts/check_running_kernel
Download-RAW https://raw.githubusercontent.com/dnsmichi/icinga-plugins/master/scripts/check_running_kernel
Beschreibung Überprüft, ob die Versions-Kennung des aktuell geladene und laufende kernel, mit der auf dem Datenträger /boot übereinstimmt.
Konfiguration
object CheckCommand "my_running_kernel" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_running_kernel" ]
 
  arguments 			= {}
 
} 

check_yum

Beschreibung Externer Link / Zusätzliche Informationen
Download https://github.com/calestyo/check_yum
Download-RAW https://raw.githubusercontent.com/calestyo/check_yum/master/check_yum
Beschreibung Überprüft über das „YUM Package Management System“ ob Updates verfügbar sind. Optional kann eine „Warnung“ ausgegeben werden, wenn Updates verfügbar sind, oder auch wenn nur sicherheitsrelevante Updates verfügbar sind. Die Ausgabe einer Warnung kann auch durch ein OK ersetzt werden, in diesem Fall wird nur die Verfügbarkeit von Updates angezeigt.
Konfiguration
object CheckCommand "my_yum" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_yum" ]
 
  arguments = {
    "--all-updates" = {
      description 		= "Does not distinguish between security and non-security updates, but returns critical for any available update. This may be used if the YUM security plugin is absent or you want to maintain every single package at the latest version. You may want to use --warn-on-any-update instead of this option."
      required 			= false
      set_if 			= "$yum_all_updates$"
    }
    "--warn-on-any-update" = {
      description 		= "Warns if there are any (non-security) package updates available. By default only warns when security related updates are available. If --all-updates is used, then this option is redundant as --all-updates will return a critical result on any available update, whereas using this switch still allows you to differentiate between the severity of updates."
      required 			= false
      set_if 			= "$yum_warn_on_any_update$"
    }
    "--cache-only" = {
      description 		= "Run entirely from cache and do not update the cache when running YUM. Useful if you have 'yum makecache' cronned so that the nagios check itself doesn't have to do it, possibly speeding up execution (by 1-2 seconds in tests)."
      required 			= false
      set_if 			= "$yum_cache_only$"
    }
    "--no-warn-on-lock" = {
      description 		= "Return OK instead of WARNING when YUM is locked and fails to check for updates due to another instance running. This is not recommended from the security standpoint, but may be wanted to reduce the number of alerts that may intermittently pop up when someone is running YUM interactively for package management."
      required 			= false
      set_if 			= "$yum_no_warn_on_lock$"
    }
    "--no-warn-on-updates" = {
      description 		= "Return OK instead of WARNING even when updates are available. This is not recommended from the security standpoint, but may be wanted to disable alerts while the plugin output still shows the number of available updates."
      required 			= false
      set_if 			= "$yum_no_warn_on_updates$"
    }
    "--enablerepo" = {
      value 			= "$yum_enablerepo$"
      description 		= "Explicitly enables a reposity when calling YUM. Can take a comma separated list of repositories. Note that enabling repositories can lead to unexpected results, for example when protected repositories are enabled."
      required 			= false
      set_if 			= "$yum_enablerepo$"
    }
    "--disablerepo" = {
      value 			= "$yum_disablerepo$"
      description 		= "Explicitly disables a repository when calling YUM. Can take a comma separated list of repositories. Note that disabling repositories can lead to unexpected results, for example when protected repositories are disabled."
      required 			= false
      set_if 			= "$yum_disablerepo$"
    }
    "--installroot" = {
      value 			= "$yum_installroot$"
      description 		= "Specifies another installation root directory (for example a chroot). See also --installroot in yum(8)."
      required 			= false
      set_if 			= "$yum_installroot$"
    }
    "--timeout" = {
      value 			= "$yum_timeout$"
      description 		= "Sets a timeout in seconds after which the plugin will exit (defaults to 55 seconds)."
      required 			= false
      set_if 			= "$yum_timeout$"
    }
    "-vvv" = {
      description               = "Verbose mode. Can be used multiple times to increase output. Use -vvv for debugging output. By default only one result line is printed as per Nagios standards."
      required                  = false
      set_if                    = "$yum_verbose$"
    }    
  }
 
}

:!: WICHTIG - Ab CentOS in der Version 7.3 führt die Option $yum_verbose, wenn diese auf [true] gesetzt ist, zu Fehlern in Icinga2!

check_cpu

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/System-Metrics/CPU-Usage-and-Load/check_cpu-2Esh/details
Beschreibung Überprüft die CPU Auslastung durch Auswertung der Daten aus /usr/bin/iostat
Abhängigkeiten Es wird das Paket sysstat benötigt
Konfiguration
object CheckCommand "my_cpu" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_cpu.sh" ]
 
  arguments = {
    "-w" = {
      value 			= "$cpu_global_warning$"
      description               = "Global Warning level in % for user/system/io-wait cpu"
      required                  = false
      set_if                    = "$cpu_global_warning$"
    }
    "-uw" = {
      value 			= "$cpu_user_warning$"
      description               = "Warning level in % for user cpu"
      required                  = false
      set_if                    = "$cpu_user_warning$"
    }
    "-iw" = {
      value 			= "$cpu_io_wait_warning$"
      description               = "Warning level in % for IO_wait cpu"
      required                  = false
      set_if                    = "$cpu_io_wait_warning$"
    }
    "-sw" = {
      value 			= "$cpu_system_warning$"
      description               = "Warning level in % for system cpu"
      required                  = false
      set_if                    = "$cpu_system_warning$"
    }
    "-c" = {
      value 			= "$cpu_global_critical$"
      description               = "Global Critical level in % for user/system/io-wait cpu"
      required                  = false
      set_if                    = "$cpu_global_critical$"
    }
    "-uc" = {
      value 			= "$cpu_user_critical$"
      description               = "Critical level in % for user cpu"
      required                  = false
      set_if                    = "$cpu_user_critical$"
    }
    "-ic" = {
      value 			= "$cpu_io_wait_critical$"
      description               = "Critical level in % for IO_wait cpu"
      required                  = false
      set_if                    = "$cpu_io_wait_critical$"
    }
    "-sc" = {
      value 			= "$cpu_system_critical$"
      description               = "Critical level in % for system cpu"
      required                  = false
      set_if                    = "$cpu_system_critical$"
    }
    "-i" = {
      value 			= "$cpu_interval$"
      description               = "Interval in seconds for iostat (default : 1)"
      required                  = false
      set_if                    = "$cpu_interval$"
    }      
    "-n" = {
      value 			= "$cpu_report$"
      description               = "umber report for iostat (default : 3)"
      required                  = false
      set_if                    = "$cpu_report$"
    } 
  }
 
  vars.cpu_global_warning       = 80
  vars.cpu_user_warning         = 80
  vars.cpu_io_wait_warning      = 80
  vars.cpu_system_warning       = 80
  vars.cpu_global_critical      = 90
  vars.cpu_user_critical        = 90
  vars.cpu_io_wait_critical     = 90
  vars.cpu_system_critical      = 90
  vars.cpu_interval             = 1
  vars.cpu_report               = 3
 
}

check_iptables

Beschreibung Externer Link / Zusätzliche Informationen
Download http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/nagios-plugin-check_iptables/check_iptables
Download-RAW http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/nagios-plugin-check_iptables/check_iptables?revision=1.6&view=co
Beschreibung Überprüft, ob iptables-Regeln geladen sind und die unter Angabe der chain und des tables.

Mit der Option -S kann auch ein Eintrag in /etc/sudoers erstellt werden, wobei hier der Benutzer nagios eingetragen wird, was entweder im Skript, oder nach dem Eintrag korrigiert werden muss!

:!: HINWEIS - Die Option -S sollte nicht im check verwendet werden!
Anpassungen Um nachfolgenden Warnung bei der Ausführung zu vermeiden
/usr/sbin/iptables: (4) Another app is currently holding the xtables lock.
Perhaps you want to use the -w option?

sollte die nachfolgende Zeile, wie dargestellt, um die iptables-Option: -w ergänzt werden:

list_iptables="$iptables -w -n -t $table -L $chain"
ROOT-Rechte In der Datei /etc/sudoers muss nachfolgende Konfiguration durchgeführt werden, da sonst kein Zugriff auf das Plugin und das Binary z.B. /sbin/iptables durch den Benutzer icinga erfolgen kann:

User_Alias CHECK_IPTABLES=icinga
CHECK_IPTABLES ALL=(root) NOPASSWD: /sbin/iptables -w -n -t filter -L INPUT, /sbin/iptables -w -n -t filter -L FORWARD, /sbin/iptables -w-n -t filter -L OUTPUT
Konfiguration
object CheckCommand "my_iptables" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_iptables" ]
 
  arguments 			= {
    "-C" = {
      value 			= "$iptables_chain$"
      description               = "Chain to list. Default: INPUT"
      required                  = false
    }
    "-t" = {
      value 			= "$iptables_table$"
      description               = "Table to list. Default: filter"
      required                  = false
    }
    "-v" = {
      value 			= "$iptables_verbose$"
      description               = "Enable verbose run"
      required                  = false
      set_if                    = "$iptables_verbose$"
    }       
  }
 
} 

check_log

Beschreibung Externer Link / Zusätzliche Informationen
Download Es ist nur die Installation des rpm-Pakets: nagios-plugins-log erforderlich
Beschreibung Überprüft, ob ein gewisser Eintrag query in einer zu spezifizierenden LOG-Datei gefunden wird bzw. wurde. Dazu wird eine Kopie der LOG-Datei angelegt, mit der die aktuelle LOG-Datei immer abgeglichen wird, um ein Delta feststellen zu können.
ROOT-Rechte In der Datei /etc/sudoers muss nachfolgende Konfiguration durchgeführt werden, da sonst kein Zugriff auf das Plugin und die Log-Datei z.B. /var/log/messages durch den Benutzer icinga erfolgen kann:

Defaults:icinga !requiretty
%icinga  ALL = (root) NOPASSWD: /usr/lib64/nagios/plugins/check_log, /usr/bin/setfacl -m u\:icinga\:r /var/log/messages*
Konfiguration
object CheckCommand "my_log" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_log" ]
 
  arguments 			= {
    "-F" = {
      value 			= "$log_file$"
      description               = "logfile"
      required                  = true
    }
    "-O" = {
      value 			= "$log_temp$"
      description               = "oldlog"
      required                  = true
    }
    "-q" = {
      value 			= "$log_query$"
      description               = "query"
      required                  = true
    }       
  }
 
} 

check_smartmon.py

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_smartmon/details
Beschreibung Überprüft unter Angabe des „Device“ (z.B. /dev/sda) dei S.M.A.R.T-Informationen der Festplatte und gibt de „Gesundheitsstatus“ und vorallem die Temperatur der Festplatte aus.
ROOT-Rechte In der Datei /etc/sudoers muss nachfolgende Konfiguration durchgeführt werden, da sonst kein Zugriff auf das Plugin und das Binary z.B. /usr/sbin/smartctl durch den Benutzer icinga erfolgen kann:

Defaults:icinga !requiretty
%icinga  ALL = (ALL) NOPASSWD: /usr/sbin/smartctl, /usr/lib64/nagios/plugins/check_smartmon.py
Konfiguration
object CheckCommand "my_smartmon" {
  import "plugin-check-command"
 
  command = [ "/usr/bin/sudo", PluginDir + "/check_smartmon.py" ]
 
  arguments = {
    "-d" = {
      value                     = "$smartmon_device$"
      description               = "device to check"
      required                  = true
    }
    "-v" = {
      value 			= "$smartmon_level$"
      description               = "set verbosity level to LEVEL; defaults to 0 (quiet), possible values go up to 3"
      required                  = false
      set_if                    = "$smartmon_level$"
    }
    "-w" = {
      value 			= "$smartmon_warning$"
      description               = "set temperature warning threshold to given temperature. (defaults to 55)"
      required                  = false
      set_if                    = "$smartmon_warning$"
    }
    "-c" = {
      value 			= "$smartmon_critical$"
      description               = "set temperature critical threshold to given temperature. (defaults to 60)"
      required                  = false
      set_if                    = "$smartmon_critical$"
    }    
  }
 
}

Plugin: Zeit_Server

check_time

Beschreibung Externer Link / Zusätzliche Informationen
Abhängigkeiten Es ist die Installation des rpm-Pakets nagios-plugins-time erforderlich
Beschreibung List über einen Zugriff via Netzwerk die RFC868 konforme Zeit aus.
Konfiguration
object CheckCommand "my_time" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_time" ]
 
  arguments 			= {
    "-H" = {
      value 			= "$time_hostname$"
      description               = "Host name, IP Address, or unix socket (must be an absolute path)"
      required                  = true     
    }
    "-p" = {
      value 			= "$time_port$"
      description               = "Port number (default: 37)"
      required                  = false
      set_if                    = "$time_port$"
    }
    "-u" = {
      value 			= "$time_udp$"
      description               = "Use UDP to connect, not TCP"
      required                  = false
      set_if                    = "$time_upd$"
    }
    "-w" = {
      value 			= "$time_warning$"
      description               = "Time difference (sec.) necessary to result in a warning status"
      required                  = false
      set_if                    = "$time_warning$"
    }
    "-c" = {
      value 			= "$time_critical$"
      description               = "Time difference (sec.) necessary to result in a critical status"
      required                  = false
      set_if                    = "$time_critical$"
    }
    "-W" = {
      value 			= "$time_warning_response$"
      description               = "Response time (sec.) necessary to result in warning status"
      required                  = false
      set_if                    = "$time_warning_response$"
    }
    "-C" = {
      value 			= "$time_critical_response$"
      description               = "Response time (sec.) necessary to result in critical status"
      required                  = false
      set_if                    = "$time_critical_response$"
    }
    "-t" = {
      value 			= "$time_timeout$"
      description               = "Seconds before connection times out (default: 10)"
      required                  = false
      set_if                    = "$time_timeout$"
    }      
  }
 
} 

Plugins: Netzwerk

check_tftp

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Network-Protocols/TFTP/check_tftp-2Esh/details
Abhängigkeiten Es wird das rpm-Paket tftp benötigt
Beschreibung Überprüft, ob eine Datei via tftp von einem tftp-Server heruntergalden werden kann und ob diese die entsprechende Größe aufweist.
Konfiguration
object CheckCommand "my_tftp" {
  import "plugin-check-command"
 
  command = [  PluginDir + "/check_tftp.sh" ]
 
  arguments 			= {
    "--connect" = {
      value 			= "$tftp_connect$"
      description               = "HOST - Tries to connect to tftp service on host HOST and retrieve a bogus dummy file. The server must answer with Error code 1: File not found in order for the check to succeed."
      required                  = false    
    }
    "--get" = {
      value 			= "$tftp_get$"
      description               = "HOST FILENAME SIZE - Tries to actually retrieve the file FILENAME from host HOST. The file is stored in a temporary directory and deleted afterwards. In order for the check to succeed the fetched file must exactly have the size SIZE. The FILENAME must not contain any white space characters!"
      required                  = false
    }    
  }
 
} 

check_udp_port

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Network-Protocols/*-TCP-and-UDP-%28Generic%29/check_udp_port/details
Abhängigkeiten Es wird das rpm-Paket nmap benötigt
Beschreibung Überprüft, ob ein udp-Port auf einem Host erreichbar ist und einen definierte Zeichenkette als Antwort zurück gibt. Die möglichen Stati sind open|filtered|closed.
ROOT-Rechte In der Datei /etc/sudoers muss nachfolgende Konfiguration durchgeführt werden, da sonst kein Zugriff auf das Plugin und das Programm /usr/bin/nmap durch den Benutzer icinga erfolgen kann:

Defaults:icinga !requiretty
%icinga  ALL = (root) NOPASSWD: /usr/bin/nmap, /usr/lib64/nagios/plugins/check_udp_port.sh
Konfiguration
object CheckCommand "my_udp_port" {
  import "plugin-check-command"
 
  command = [  "/usr/bin/sudo", PluginDir + "/check_udp_port.sh" ]
 
  arguments 			= {
    "-H" = {
      value 			= "$udp_port_host$"
      description               = "Name or IP of remote host"
      required                  = true     
    }
    "-p" = {
      value 			= "$udp_port_port$"
      description               = "UDP port number to check"
      required                  = true
    }
    "-s" = {
      value 			= "$udp_port_name$"
      description               = "Name of the service that should be listening on the port"
      required                  = true
    }       
  }
 
} 

check_snmp_int

Beschreibung Externer Link / Zusätzliche Informationen
Download http://nagios.manubulon.com/snmp_int.html
Abhängigkeiten Es wird das rpm-Paket perl-Net-SNMP benötigt
Beschreibung Ermittelt, via SNMP daten zu den dort verfügbaren interface auf einem Host und gibt relevante Daten und Stati zurück.
Konfiguration
object CheckCommand "my_snmp_int" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_snmp_int.pl" ]
 
  arguments 			= {
    "-H" = {
      value 			= "$snmp_int_hostname$"
      description               = "name or IP address of host to check"
      required                  = true     
    }
    "-C" = {
      value 			= "$snmp_int_community$"
      description               = "community name for the host's SNMP agent (implies v1 protocol)"
      required                  = true     
    }
    "-l" = {
      value 			= "$snmp_int_login$"
      description               = "Login and auth password for snmpv3 authentication. If no priv password exists, implies AuthNoPriv -2 : use snmp v2c"
      required                  = false
    }
    "-l" = {
      value                     = "$snmp_int_passwd$"    
      description               = "Login and auth password for snmpv3 authentication. If no priv password exists, implies AuthNoPriv -2 : use snmp v2c"
      required                  = false
    }                       
    "-2" = {
      description               = "Login and auth password for snmpv3 authentication. If no priv password exists, implies AuthNoPriv -2 : use snmp v2c"
      required                  = false
      set_if                    = "$snmp_int_v2$"
    }                     
    "-X" = {
      value                     = "$snmp_int_privpass$"     
      description               = "Priv password for snmpv3 (AuthPriv protocol)"
      required                  = false
    }
    "-L" = {
      value                     = "$snmp_int_protocols$"    
      description               = "<authproto> : Authentication protocol (md5|sha : default md5), <privproto> : Priv protocole (des|aes : default des)"
      required                  = false
    }
    "-p" = {
      value                     = "$snmp_int_port$"    
      description               = "SNMP port (Default 161)"
      required                  = false
    } 
    "-n" = {
      value 			= "$snmp_int_name$"
      description               = "Name in description OID (eth0, ppp0 ...). This is treated as a regexp : -n eth will match eth0,eth1,... Test it before, because there are known bugs (ex : trailling /)"
      required                  = true
    }
    "-r" = {
      description               = "Do not use regexp to match NAME in description OID"
      required                  = false
      set_if                    = "$snmp_int_noregexp$"
    }  
    "-i" = {
      description               = "Make critical when up"
      required                  = false
      set_if                    = "$snmp_int_inverse$"
    }
    "-a" = {
      description               = "Use administrative status instead of operational"
      required                  = false
      set_if                    = "$snmp_int_admin$"
    }
    "-o" = {
      value                    = "$snmp_int_octetlength$"    
      description               = "max-size of the SNMP message, usefull in case of Too Long responses. Be carefull with network filters. Range 484 - 65535, default are usually 1472,1452,1460 or 1440."
      required                  = false
    }
    "-f" = {
      description               = "Perfparse compatible output (no output when interface is down)."
      required                  = false
      set_if                    = "$snmp_int_perfparse$"
    }
    "-e" = {
      description               = "Add error & discard to Perfparse output"
      required                  = false
      set_if                    = "$snmp_int_error$"
    }
    "-S" = {
      description               = "include speed in performance output in bits/s"
      required                  = false
      set_if                    = "$snmp_int_intspeed$"
    }
    "-y" = {
      description               = "output performance data in % of max speed"
      required                  = false
      set_if                    = "$snmp_int_perfprct$"
    }
    "-Y" = {
      description               = "output performance data in bits/s or Bytes/s (depending on -B)"
      required                  = false
      set_if                    = "$snmp_int_perfspeed$"
    }
    "-k" = {
      description               = "check the input/ouput bandwidth of the interface"
      required                  = false
      set_if                    = "$snmp_int_perfcheck$"
    }
    "-q" = {
      description               = "also check the error and discard input/output"
      required                  = false
      set_if                    = "$snmp_int_extperfcheck$"
    } 
    "-d" = {
      value                     = "$snmp_int_delta$"    
      description               = "make an average of <delta> seconds (default 300=5min)"
      required                  = false
    }
    "-B" = {
      description               = "Make the warning and critical levels in K|M|G Bits/s instead of K|M|G Bytes/s"
      required                  = false
      set_if                    = "$snmp_int_delta$"
    } 
    "-G" = {
      description               = "Make the warning and critical levels in Gbps (with -B) or GBps"
      required                  = false
      set_if                    = "$snmp_int_giga$"
    } 
    "-M" = {
      description               = "Make the warning and critical levels in Mbps (with -B) or MBps"
      required                  = false
      set_if                    = "$snmp_int_mega$"
    } 
    "-u" = {
      description               = "Make the warning and critical levels in % of reported interface speed."
      required                  = false
      set_if                    = "$snmp_int_prct$"
    }
    "-w" = {
      value                     = "$snmp_int_warning$"    
      description               = "EXAMPLE: input,output[,error in,error out,discard in,discard out] | warning level for input / output bandwidth (0 for no warning) unit depends on B,M,G,u options warning for error & discard input / output in error/min (need -q)"
      required                  = false
    } 
    "-c" = {
      value                     = "$snmp_int_critical$"    
      description               = "EXAMPLE: input,output[,error in,error out,discard in,discard out] | critical level for input / output bandwidth (0 for no critical) unit depends on B,M,G,u options critical for error & discard input / output in error/min (need -q)"
      required                  = false
    }  
    "-s" = {
      description               = "Make the output shorter : only the first <n> chars of the interface(s). f the number is negative, then get the <n> LAST caracters."
      required                  = false
      set_if                    = "$snmp_int_short$"
    }
    "-t" = {
      value                     = "$snmp_int_timeout$"    
      description               = "timeout for SNMP in seconds (Default: 5)"
      required                  = false
    } 
    "-v" = {
      description               = "print extra debugging information (including interface list on the system)"
      required                  = false
      set_if                    = "$snmp_int_verbose$"
    }                                                                                     
  }
} 

Plugins: Webserver

check_apachestatus_auto.pl

Beschreibung Externer Link / Zusätzliche Informationen
Download http://blog.spreendigital.de/nagios/?#check_apachestatus_auto
Abhängigkeiten Es wir das rpm-Paket perl-libwww-perl benötigt.
Beschreibung Überprüft den Apache Webserver durch Auswertung der /server-status-Informationen, welche auch durch BASIC-Authentication geschützt sein kann. Es werden verschiedenen Parameter der /server-status-Informationen ausgewertet, darunter z.B. response time, idle workers, busy workers, open und total slots. Die Performacedaten liefern den status aller slots inclusive Requests/Sek., Bytes/Request und Bytes/Sek. Optional kann auch überwacht werden, wie viele slots verfügbar sein müssen.
Konfiguration
object CheckCommand "my_apachestatus_auto" {
  import "plugin-check-command"
 
  command = [  PluginDir + "/check_apachestatus_auto.pl" ]
 
  arguments 			= {
    "-H" = {
      value 			= "$apachestatus_auto_host$"
      description               = "name or IP address of host to check"
      required                  = true    
    }
    "-p" = {
      value 			= "$apachestatus_auto_port$"
      description               = "Http port"
      required                  = false    
    }
    "-u" = {
      value 			= "$apachestatus_auto_url$"
      description               = "Specific URL to use, instead of the default http://hostname/server-status"
      required                  = false    
    } 
    "-U" = {
      value 			= "$apachestatus_auto_user$"
      description               = " Username for basic auth"
      required                  = false    
    }
    "-P" = {
      value 			= "$apachestatus_auto_pass$"
      description               = "Password for basic auth"
      required                  = false    
    }
    "-r" = {
      value 			= "$apachestatus_auto_realm$"
      description               = "Realm for basic auth"
      required                  = false    
    }
    "-X" = {
      value 			= "$apachestatus_auto_proxy$"
      description               = "Proxy-URL for http and https (mandatory)"
      required                  = false    
    }
    "-t" = {
      value 			= "$apachestatus_auto_timeout$"
      description               = "timeout in seconds (Default: 15)"
      required                  = false    
    }
    "-w" = {
      value 			= "$apachestatus_auto_warning$"
      description               = "number of available slots that will cause a warning, -1 for no warning"
      required                  = false    
    }
    "-c" = {
      value 			= "$apachestatus_auto_critical$"
      description               = "number of available slots that will cause an error"
      required                  = false    
    }                                    
  }
 
} 

check_tomcat.pl

Beschreibung Externer Link / Zusätzliche Informationen
Download https://github.com/dduenasd/check_tomcat.py
Beschreibung Überprüft den Apache Tomcat durch Auswertung der /manager-webapp, welche auch durch BASIC-Authentication geschützt sein kann. Es werden verschiedenen Parameter der /manager-Informationen ausgewertet, darunter z.B. satatus, thread, mem und app.
Konfiguration
object CheckCommand "my_tomcat" {
  import "plugin-check-command"
 
  command = [  PluginDir + "/check_tomcat.pl" ]
 
  arguments 			= {
    "-H" = {
      value 			= "$tomcat_host$"
      description               = "Name or Ip of tomcat host"
      required                  = true    
    }
    "-p" = {
      value 			= "$tomcat_port$"
      description               = "Name or Ip of tomcat host"
      required                  = false    
    }
    "-u" = {
      value 			= "$tomcat_user$"
      description               = "Tomcat user"
      required                  = false    
    }
    "-a" = {
      value 			= "$tomcat_pass$"
      description               = "Tomcat authentication password"
      required                  = false    
    }
    "-U" = {
      value 			= "$tomcat_url$"
      description               = "Tomcat manager app url '/manager' by default"
      required                  = false    
    }  
    "-C" = {
      value 			= "$tomcat_connector$"
      description               = "Connector name, used in thread mode"
      required                  = false    
    }
    "-t" = {
      value 			= "$tomcat_timeout$"
      description               = "Timeout for connection (5 seconds by default)"
      required                  = false    
    }
    "-e" = {
      value 			= "$tomcat_expire_time$"
      description               = "Expire time for sessions created in tomcat manager app value in minutes (0 minutes by default)"
      required                  = false    
    }
    "-n" = {
      value 			= "$tomcat_name$"
      description               = "Name of the java application you want to check, only for app mode (required by -m | --mode app)"
      required                  = false    
    }
    "-w" = {
      value 			= "$tomcat_warning$"
      description               = "Warning value (required by -m | --mode at thread and mem)"
      required                  = false    
    }
    "-c" = {
      value 			= "$tomcat_critical$"
      description               = "Critical value (required by -m | --mode at thread and mem)"
      required                  = false    
    }
    "-m" = {
      value 			= "$tomcat_mode$"
      description               = "Tomcat monitorizacion mode: status: The status of tomcat server | mem:    Tomcat server used percentage memory status, warning and critical values. Requiered in percentage. | thread: Tomcat connectors Threads used, warning and critical values requiered. The parameter connector is optional, if not exists, all connector were shown. | app:    Application status in tomcat server, the name of the application must be defined with the parameter -n or --nameapp. This option check the status of java application running on tomcat server."
      required                  = true    
    }                                                                              
  }
 
} 

Plugins: Proxy

check_squid

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Software/check_squid_ng/details
Abhängigkeiten Es muss das rpm-Paket perl-libwww-perl installiert werden
Beschreibung Überprüft, die Verfügbarkeit des Proxy-Servers Squid
Konfiguration
object CheckCommand "my_squid" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_squid" ]
 
  arguments 			= {
    "-H" = {
      value 			= "$squid_hostname$"
      description               = "Name of the proxy to check (default: localhost)"
      required                  = false     
    }
    "-d" = {
      value 			= "$squid_data$"
      description               = "Optional data to fetch (default: Connections) available data : Connections Cache Resources Memory FileDescriptors"
      required                  = false     
    }
    "-p" = {
      value 			= "$squid_port$"
      description               = "Optional port number (default: 3128)"
      required                  = false     
    }
    "-U" = {
      value 			= "$squid_user$"
      description               = "Optional WWW user (default: root)"
      required                  = false     
    } 
    "-W" = {
      value 			= "$squid_password$"
      description               = "Optional WWW password"
      required                  = false     
    }
    "-w" = {
      value 			= "$squid_warning$"
      description               = "Warning threshold. See http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT for the threshold format."
      required                  = false     
    } 
    "-c" = {
      value 			= "$squid_critical$"
      description               = "Critical threshold. See http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT for the threshold format."
      required                  = false     
    }
    "-s" = {
      value 			= "$squid_client$"
      description               = "Path of squidclient (default: /usr/sbin/squidclient)"
      required                  = false     
    }
    "-t" = {
      value 			= "$squid_timeout$"
      description               = "Seconds before plugin times out (default: 15)"
      required                  = false     
    }                                               
  }
 
} 

Plugins: Virenscanner

check_clamav

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Anti-2DVirus/ClamAV/ClamAV-check-plugin/details
Abhängigkeiten Es wird die Installation des rpm-Paktes perl-Net-DNS erforderlich
Beschreibung Überprüft, das Alter der Virendefinitionsdatei des Viren-Scanners ClamAV und gibt bei Überschreitung entsprechende Rückgabewerte aus.
Konfiguration
object CheckCommand "my_clamav" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_clamav" ]
 
  arguments 			= {
    "-w" = {
      value 			= "$clamav_warning$"
      description               = "Number of revisions behind current daily.cvd to generate a warning state (Default: 1)"
      required                  = false     
    } 
    "-c" = {
      value 			= "$clamav_critical$"
      description               = "Number of revisions behind current daily.cvd to generate a critical state (Default: 2)"
      required                  = false     
    }
    "-v" = {
      value 			= "$clamav_verbose$"
      description               = "Enable verbose output"
      required                  = false     
    }
  }
 
} 

Plugins: Contentscanner

check_sa-update

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Email-and-Groupware/SpamAssasin/check_sa-2Dupdate/details
Beschreibung Überprüft, ob die Updates des Contentscanners SpamAssassin aktuell sind und gibt entsprechende Rückgabewerte und -meldungen aus.
Konfiguration
object CheckCommand "my_sa-update" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_sa-update" ]
 
  arguments                     = {}
 
} 

check_spamd

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Email-and-Groupware/SpamAssasin/check_spamd/details
Beschreibung Überprüft, ob der Contentscanner SpamAssassin erreichbar ist und gibt bei nicht Erreichbarkeit und Fehlverhalten eine entsprechende Rückgabewerte aus.
Konfiguration
object CheckCommand "my_spamd" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_spamd.pl" ]
 
  arguments = {
    "--host" = {
      description               = "--host (-H) Set the host on which spamd runs (default: localhost)."
      required                  = false
      set_if                    = "$spamd_host$"
    }
    "--port" = {
      description               = "--port (-p) Set TCP port number of spamd."
      required                  = false
      set_if                    = "$spamd_port$"
    }
    "--spamc" = {
      value                     = "$spamd_spamc$"    
      description               = "--spamc (-s) Set the location of the spamc executable."
      required                  = false
    }
    "--timeout" = {
      description               = "--timeout (-t) Sets the timeout, defaults to 10 seconds."
      required                  = false
      set_if                    = "$spamd_timeout$"
    }
  }
 
} 

Plugins: E-Mail

check_dovecot

Beschreibung Externer Link / Zusätzliche Informationen
Download https://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Dovecot/check_dovecot/details
Beschreibung Überprüft, ob der IMAP/POP3-Server Dovecot erreichbar ist und erlaubt weitere Prüfungen (POP3/IMAP) und gibt bei einem definierten Fehlverhalten eine entsprechende Rückgabewerte aus.
Konfiguration
object CheckCommand "my_dovecot" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_dovecot" ]
 
  arguments = {
    "-d" = {
      description               = "-d  Check dovecot general status"
      required                  = false
      set_if                    = "$dovecot_general_status$"
    }
    "-i" = {
      description               = "-i  Check dovecot IMAP status"
      required                  = false
      set_if                    = "$dovecot_imap_status$"
    }
    "-p" = {
      description               = "-p  Check dovecot POP status"
      required                  = false
      set_if                    = "$dovecot_pop_status$"
    }
    "-m" = {
      description               = "-m  Check number of IMAP login processes"
      required                  = false
      set_if                    = "$dovecot_imap_login$"
    }
    "-o" = {
      description               = "-o  Check number of POP login processes"
      required                  = false
      set_if                    = "$dovecot_pop_login$"
    }
    "-w" = {
      value                     = "$dovecot_warn$"
      description               = "-w  Number of connections at which a warning is triggered"
      required                  = false
    }
    "-c" = {
      value                     = "$dovecot_crit$"
      description               = "-c  Number of connections at which a critical is triggered"
      required                  = false
    }                      
  }
 
} 

Plugins: Ungenutzt

Nachfolgende Plugins wurden getestet, jedoch befinden sich aktuell nicht im Einsatz!

check_cpu_usage

Beschreibung Externer Link / Zusätzliche Informationen
Download https://github.com/iamcheko/check_cpu_usage
Download-RAW https://raw.githubusercontent.com/iamcheko/check_cpu_usage/master/libexec/check_cpu_usage
Beschreibung Überprüft die CPU Auslastung durch Auswertung der Daten aus /proc/stat
Abhängigkeiten Es wird das Perl-Modul perl-Data-Dumper benötigt
Konfiguration
object CheckCommand "my_cpu_usage" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_cpu_usage" ]
 
  arguments = {
    "-t" = {
      value 			= "$cpu_usage_timeout$"
      description               = "[ -t|--timeout=<timeout> ] Seconds before plugin times out (default: 15)"
      required                  = false
      set_if                    = "$cpu_usage_timeout$"
    }
    "-c" = {
      value                     = "$cpu_usage_critical$"
      description               = "[ -c|--critical=<threshold> ] a list of threshold for critical in the same order as names (default none,none,none,none,none,none,none,none,none,none,none,none,none,none)"
      required                  = false
    }     
    "-w" = {
      value                     = "$cpu_usage_warning$"
      description               = "[ -w|--warning=<threshold> ] a list of threshold for warning in the same order as names (default none,none,none,none,none,none,none,none,none,none,none,none,none,none)"
      required                  = false
    }   
    "-s" = {
      value                     = "$cpu_usage_statfile$"
      description               = "[ -s|--statfile=<file> ] name of the stat file (default /proc/stat)"
      required                  = false
    }
    "-g" = {
      value                     = "$cpu_usage_gapfile$"
      description               = "[ -g|--gapfile=<file> ] name of the gap file (default /tmp/check_cpu_usage.gap.tmp)"
      required                  = false
    }
    "-n" = {
      value                     = "$cpu_usage_names$"
      description               = "[ -n|--names=<list> ] a comma separated list of names representing the column in the stats file. See 'man proc' for details (default user,nice,system,idle,iowait,irq,softirq,steal,guest,guest_nice,nyd1,nyd2,nyd3)"
      required                  = false
    }
    "-d" = {
      description               = "[ -d|--details ] show detailed information for each core"
      required                  = false
      set_if                    = "$cpu_usage_details$"
    }         
  }
 
  vars.cpu_usage_timeout = 10
 
}

check_logfiles

Beschreibung Externer Link / Zusätzliche Informationen
Download https://labs.consol.de/nagios/check_logfiles/
Beschreibung Siehe nachfolgenden externen Link https://labs.consol.de/nagios/check_logfiles/examples/ - Example 4 und Example 10
Abhängigkeiten Es wird das Perl-Modul perl-Digest-MD5 benötigt
ROOT-Rechte In der Datei /etc/sudoers muss nachfolgende Konfiguration durchgeführt werden, da sonst kein Zugriff auf das Plugin und die Log.Datei /var/log/messages durch den Benutzer icinga erfolgen kann:

Defaults:icinga !requiretty
%icinga  ALL = (root) NOPASSWD: /usr/lib64/nagios/plugins/check_logfiles, /usr/bin/setfacl -m u\:icinga\:r /var/log/messages*
conf-Datei: /usr/lib64/nagios/plugins/check_logfiles.conf

$scriptpath = '/usr/bin';
$prescript = 'logger';
$prescriptparams = '-t icinga';
$prescriptstdin = 'check_logfiles rsyslog ($CL_DATE_YYYY$-$CL_DATE_MM$-$CL_DATE_DD$ $CL_DATE_HH$:$CL_DATE_MI$:$CL_DATE_SS$)';
$prescriptsleep = 5;
 
$postscript = 'setfacl';
$postscriptparams = '-m u:icinga:r /var/log/messages*';
$options = 'supersmartprescript';
 
@searches = (
  {
    tag => 'syslogworks',
    logfile => '/var/log/messages',
    rotation => 'logrotate',
    criticalpatterns => ['!icinga:\s+check_logfiles\s+rsyslog'],
    options => 'noprotocol,count',
  },
);
Konfiguration
object CheckCommand "my_logfiles" {
  import "plugin-check-command"
 
  command = [ PluginDir + "/check_logfiles" ]
 
  arguments = {
    "-t" = {
      value 			= "$logfiles_timeout$"
      description               = "[-t timeout]"
      required                  = false
      set_if                    = "$logfiles_timeout$"
    } 
    "-f" = {
      value                     = "$logfiles_configfile$"
      description               = "<configfile>"
      required                  = true
    }       
  }
 
  vars.logfiles_timeout = 10
 
}
Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
tachtler/icinga2_-_plugins.txt · Zuletzt geändert: 2018/04/25 13:54 von klaus