From baf24f9c94e760798e38bc7b1d5a2c4e294f34e5 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Thu, 6 Jan 2022 22:32:10 +1100 Subject: [PATCH] snmp__if_combined: don't set max speed if reported as 0 Some SNMP implementations actively report the interface speed as 0 (e.g., when disconnected). This led the plugin to report both min and max to be 0, which later confuses RRDTool, with errors such as [ERROR] Unable to create '/var/lib/munin/example.net/192.2.0.1-snmp_if_combined_vlan-37-send-d.rrd': failed to parse data source 600:0:0: min must be less than max in DS definition when trying to creates the RRDs. Ultimately, this would prevent the graph creation from suceeding with errors such as [ERROR] In RRD: Error updating /var/lib/munin/example.net/192.2.0.1-snmp_if_combined_vlan-37-send-d.rrd: opening '/var/lib/munin/example.net/192.2.0.1-snmp_if_combined_vlan-37-send-d.rrd': No such file or directory Signed-off-by: Olivier Mehani --- plugins/snmp/snmp__if_combined | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/snmp/snmp__if_combined b/plugins/snmp/snmp__if_combined index 7b6e3cb1..92105d9c 100755 --- a/plugins/snmp/snmp__if_combined +++ b/plugins/snmp/snmp__if_combined @@ -806,7 +806,7 @@ send.negative recv send.min 0 END - if ( defined($speed) ) { + if ( defined($speed) && $speed > 0) { printf("recv.max %s\nsend.max %s\n", $speed, $speed); }