diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 19399a110..80e9d728d 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -1500,6 +1500,24 @@ interfacetable_defaulttablesorting | **Optional.** Default table sorting can be interfacetable_tablesplit | **Optional.** Generate multiple interface tables, one per interface type. Defaults to false. interfacetable_notype | **Optional.** Remove the interface type for each interface. Defaults to false. +### iftraffic + +The plugin [check_iftraffic](https://exchange.icinga.org/exchange/iftraffic) +checks the utilization of a given interface name using the SNMP protocol. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|--------------------------------------------------------- +iftraffic_address | **Required.** Specifies the remote host. Defaults to "$address$". +iftraffic_community | **Optional.** SNMP community. Defaults to "public'" if omitted. +iftraffic_interface | **Required.** Queried interface name. +iftraffic_bandwidth | **Required.** Interface maximum speed in kilo/mega/giga/bits per second. +iftraffic_units | **Optional.** Interface units can be one of these values: `g` (gigabits/s),`m` (megabits/s), `k` (kilobits/s),`b` (bits/s) +iftraffic_warn | **Optional.** Percent of bandwidth usage necessary to result in warning status (defaults to `85%`). +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. + ## 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 2fba3162d..8345dcbb4 100644 --- a/itl/plugins-contrib.d/network-components.conf +++ b/itl/plugins-contrib.d/network-components.conf @@ -292,3 +292,50 @@ object CheckCommand "interfacetable" { vars.interfacetable_notype = false } +object CheckCommand "iftraffic" { + import "plugin-check-command" + command = [ PluginDir + "/check_iftraffic64.pl"] + + arguments = { + "-H" = { + value = "$iftraffic_address$" + description = "Check interface on the indicated host." + required = true + } + "-C" = { + value = "$iftraffic_community$" + description = "SNMP community. Defaults to 'public' if omitted." + } + "-i" = { + value = "$iftraffic_interface$" + description = "Interface name." + required = true + } + "-b" = { + value = "$iftraffic_bandwidth$" + description = "Interface maximum speed in kilo/mega/giga/bits per second." + required = true + } + "-u" = { + value = "$iftraffic_units$" + description = "g=gigabits/s,m=megabits/s,k=kilobits/s,b=bits/s." + } + "-w" = { + value = "$iftraffic_warn$" + description = "% of bandwidth usage necessary to result in warning status (default: 85%)" + } + "-c" = { + value = "$iftraffic_crit$" + description = "% of bandwidth usage necessary to result in critical status (default: 98%)" + } + "-M" = { + value = "$iftraffic_max_counter$" + description = "Max counter value of net devices in kilo/mega/giga/bytes." + } + } + + vars.iftraffic_address = "$address$" + vars.iftraffic_warn = "85%" + vars.iftraffic_crit = "98%" +} +