]> granicus.if.org Git - icinga2/commitdiff
ITL: Add check command check_interfaces
authorLennart Betz <lennart.betz@netways.de>
Sun, 2 Aug 2015 05:36:08 +0000 (07:36 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 17 Aug 2015 06:58:14 +0000 (08:58 +0200)
fixes #9527

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
doc/7-icinga-template-library.md
itl/plugins-contrib.d/network-components.conf

index 2f28036f5885c95e58a8ddabd4eac74a0844f022..025a2032f91108d2bb421d7e8bbc59c124d972db 100644 (file)
@@ -1698,6 +1698,38 @@ iftraffic_warn           | **Optional.** Percent of bandwidth usage necessary to result i
 iftraffic_crit         | **Optional.** Percent of bandwidth usage necessary to result in critical status (defaults to `98%`).
 iftraffic_max_counter  | **Optional.** Maximum counter value of net devices in kilo/mega/giga/bytes.
 
+### <a id="plugins-contrib-command-interfaces"></a> interfaces
+
+The plugin [check_interfaces](https://www.netways.org/projects/check-interfaces)
+Check interfaces and utilization.
+
+Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
+
+Name                      | Description
+--------------------------|---------------------------------------------------------
+interfaces_address        | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
+interfaces_regex          | **Optional.** Interface list regexp.
+interfaces_exclude_regex  | **Optional.** Interface list negative regexp.
+interfaces_errors         | **Optional.** Number of in errors (CRC errors for cisco) to consider a warning (default 50).
+interface_out_errors      | **Optional.** Number of out errors (collisions for cisco) to consider a warning (default same as in errors).
+interfaces_perfdata       | **Optional.** perfdata from last check result.
+interfaces_prefix         | **Optional.** Prefix interface names with this label.
+interfaces_lastcheck      | **Optional.** Last checktime (unixtime).
+interfaces_bandwidth      | **Optional.** Bandwidth warn level in percent.
+interfaces_speed          | **Optional.** Override speed detection with this value (bits per sec).
+interfaces_trim           | **Optional.** Cut this number of characters from the start of interface descriptions.
+interfaces_mode           | **Optional.** Special operating mode (default,cisco,nonbulk,bintec).
+interfaces_auth_proto     | **Optional.** SNMPv3 Auth Protocol (SHA|MD5)
+interfaces_auth_phrase    | **Optional.** SNMPv3 Auth Phrase
+interfaces_priv_proto     | **Optional.** SNMPv3 Privacy Protocol (AES|DES)
+interfaces_priv_phrase    | **Optional.** SNMPv3 Privacy Phrase
+interfaces_user           | **Optional.** SNMPv3 User
+interfaces_down_is_ok     | **Optional.** Disables critical alerts for down interfaces.
+interfaces_aliases        | **Optional.** Retrieves the interface description.
+interfaces_match_aliases  | **Optional.** Also match against aliases (Option --aliases automatically enabled).
+interfaces_timeout        | **Optional.** Sets the SNMP timeout (in ms).
+interfaces_sleep          | **Optional.** Sleep between every SNMP query (in ms).
+
 ## <a id="plugins-contrib-web"></a> Web
 
 This category includes all plugins for web-based checks.
index 1d7268942fee9a1792c440d1bf3d2f25c43c900b..391b37fc28917a04a92abb8984fb32374c987a21 100644 (file)
@@ -341,3 +341,102 @@ object CheckCommand "iftraffic" {
        vars.iftraffic_crit = "98%"
 }
 
+object CheckCommand "interfaces" {
+       import "plugin-check-command"
+       import "ipv4-or-ipv6"
+
+       command = [ PluginContribDir + "/check_interfaces" ]
+
+       arguments = {
+               "--hostname" = "$interfaces_address$"
+               "--community" = {
+                       value = "$interfaces_community$"
+                       description = "The community string (default public)."
+               }
+               "--regex" = {
+                       value = "$interfaces_regex$"
+                       description = "Interface list regexp."
+               }
+               "--exclude-regex" = {
+                       value = "$interfaces_exclude_regex$"
+                       description = "Interface list negative regexp."
+               }
+               "--errors" = {
+                       value = "$interfaces_errors$"
+                       description = "Number of in errors (CRC errors for cisco) to consider a warning (default 50)."
+               }
+               "--out-errors" = {
+                       value = "$interface_out_errors$"
+                       description = "Number of out errors (collisions for cisco) to consider a warning (default same as in errors)."
+               }
+               "--perfdata" = {
+                       value = "$interfaces_perfdata$"
+               }
+               "--prefix" = {
+                       value = "$interfaces_prefix$"
+                       description = "Prefix interface names with this label."
+               }
+               "--lastcheck" = {
+                       value = "$interfaces_lastcheck$"
+                       description = "Last checktime (unixtime)."
+               }
+               "--bandwidth" = {
+                       value = "$interfaces_bandwidth$"
+                       description = "Bandwidth warn level in percent."
+               }
+               "--speed" = {
+                       value = "$interfaces_speed$"
+                       description = "Override speed detection with this value (bits per sec)."
+               }
+               "--trim" = {
+                       value = "$interfaces_trim$"
+                       description = "Cut this number of characters from the start of interface descriptions."
+               }
+               "--mode" = {
+                       value = "$interfaces_mode$"
+                       description = "Special operating mode (default,cisco,nonbulk,bintec)."
+               }
+               "--auth-proto" = {
+                       value = "$interfaces_auth_proto$"
+                       description = "SNMPv3 Auth Protocol (SHA|MD5)"
+               }
+               "--auth-phrase" = {
+                       value = "$interfaces_auth_phrase$"
+                       description = "SNMPv3 Auth Phrase"
+               }
+               "--priv-proto" = {
+                       value = "$interfaces_priv_proto$"
+                       description = "SNMPv3 Privacy Protocol (AES|DES)"
+               }
+               "--priv-phrase" = {
+                       value = "$interfaces_priv_phrase$"
+                       description = "SNMPv3 Privacy Phrase"
+               }
+               "--user" = {
+                       value = "$interfaces_user$"
+                       description = "SNMPv3 User"
+               }
+               "--down-is-ok" = {
+                       set_if = "$interfaces_down_is_ok$"
+                       description = "Disables critical alerts for down interfaces."
+               }
+               "--aliases" = {
+                       set_if = "$interfaces_aliases$"
+                       description = "Retrieves the interface description."
+               }
+               "--match-aliases" = {
+                       value = "$interfaces_match_aliases$"
+                       description = "Also match against aliases (Option --aliases automatically enabled)."
+               }
+               "--timeout" = {
+                       value = "$interfaces_timeout$"
+                       description = "Sets the SNMP timeout (in ms)."
+               }
+               "--sleep" = {
+                       value = "$interfaces_sleep$"
+                       description = "Sleep between every SNMP query (in ms)."
+               }
+       }
+
+       vars.interfaces_address = "$check_address$"
+}