From c6dd6a092c3692af8434e29ad58af0bbcbc40627 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 22 Oct 2021 18:38:10 +0200 Subject: [PATCH] ITL: add check_linux_netdev --- doc/10-icinga-template-library.md | 13 ++++++++++++ itl/plugins-contrib.d/network-components.conf | 21 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index dc3ff5df7..a490c47a9 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -3198,6 +3198,19 @@ interfaces_timeout | **Optional.** Sets the SNMP timeout (in ms). interfaces_sleep | **Optional.** Sleep between every SNMP query (in ms). interfaces_names | **Optional.** If set to true, use ifName instead of ifDescr. +#### linux\_netdev + +The [check\_linux\_netdev](https://github.com/Al2Klimov/check_linux_netdev) +plugin monitors a Linux system's network device statistics via `/proc/net/dev`. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------|--------------------------------------------------------- +linux\_netdev\_duration | **Optional.** For how long to run. E.g. "10s" or "2m". Default: "1m" +linux\_netdev\_exclude | **Optional.** Which NICs to exclude. E.g. `eth0` or `eth?*`, may be an array. Default: none +linux\_netdev\_thresholds | **Optional.** Warning and critical thresholds. E.g. `eth?*:tx:bytes:persec:w=1000000000` (see [plugin documentation](https://github.com/Al2Klimov/check_linux_netdev#usage)), may be an array. Default: none + #### nwc_health The [check_nwc_health](https://labs.consol.de/de/nagios/check_nwc_health/index.html) plugin diff --git a/itl/plugins-contrib.d/network-components.conf b/itl/plugins-contrib.d/network-components.conf index c33be561b..c7bcacca8 100644 --- a/itl/plugins-contrib.d/network-components.conf +++ b/itl/plugins-contrib.d/network-components.conf @@ -488,6 +488,27 @@ object CheckCommand "interfaces" { vars.interfaces_match_aliases = false } +object CheckCommand "linux_netdev" { + command = [ PluginContribDir + "/check_linux_netdev" ] + + arguments = { + "-d" = { + value = "$linux_netdev_duration$" + description = "For how long to run. E.g. '10s' or '2m'. Default: '1m'" + } + "-e" = { + value = "$linux_netdev_exclude$" + description = "Which NICs to exclude. E.g. 'eth0' or 'eth?*', may be an array. Default: none" + } + "INTERFACE:METRIC:THRESHOLD=RANGE" = { + order = 1 + skip_key = true + value = "$linux_netdev_thresholds$" + description = "Warning and critical thresholds. E.g. 'eth?*:tx:bytes:persec:w=1000000000' (see https://github.com/Al2Klimov/check_linux_netdev#usage), may be an array. Default: none" + } + } +} + object CheckCommand "nwc_health" { import "ipv4-or-ipv6"