From 49cf0bb644b86b42dd0f0051241ad95937f78fba Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Sun, 2 Aug 2015 07:36:08 +0200 Subject: [PATCH] ITL: Add check command check_interfaces fixes #9527 Signed-off-by: Michael Friedrich --- doc/7-icinga-template-library.md | 32 ++++++ itl/plugins-contrib.d/network-components.conf | 99 +++++++++++++++++++ 2 files changed, 131 insertions(+) diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 2f28036f5..025a2032f 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -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. +### 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). + ## Web This category includes all plugins for web-based checks. diff --git a/itl/plugins-contrib.d/network-components.conf b/itl/plugins-contrib.d/network-components.conf index 1d7268942..391b37fc2 100644 --- a/itl/plugins-contrib.d/network-components.conf +++ b/itl/plugins-contrib.d/network-components.conf @@ -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$" +}