因为家中使用的树莓派意外损坏,使用NAS上的虚拟机来代替原来树莓派的工作.在配置Munin的时候出现错误,当更新网络设备数据时,munin服务器端报错

2016/12/20 17:30:05 [INFO] creating rrd-file for if_ens3->down: '/var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-down-d.rrd'
2016/12/20 17:30:05 [ERROR] Unable to create '/var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-down-d.rrd': min must be less than max in DS definition
2016/12/20 17:30:05 [ERROR] In RRD: Error updating /var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-down-d.rrd: opening '/var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-down-d.rrd': No such file or directory
2016/12/20 17:30:05 [INFO] creating rrd-file for if_ens3->up: '/var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-up-d.rrd'
2016/12/20 17:30:05 [ERROR] Unable to create '/var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-up-d.rrd': min must be less than max in DS definition
2016/12/20 17:30:05 [ERROR] In RRD: Error updating /var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-up-d.rrd: opening '/var/lib/munin/ARCHLINUX/mx.ARCHLINUX-if_ens3-up-d.rrd': No such file or directory

 

在做了一些搜索之后发现文章 https://github.com/mail-in-a-box/mailinabox/issues/896

 

执行munin-run if_ens3 config 后出现以下输出

graph_order down up
graph_title ens3 traffic
graph_args --base 1000
graph_vlabel bits in (-) / out (+) per ${graph_period}
graph_category network
graph_info This graph shows the traffic of the ens3 network interface. Please note that the traffic is shown in bits per second, not bytes. IMPORTANT: On 32-bitsystems the data source for this plugin uses 32-bit counters, which makes the plugin unreliable and unsuitable for most 100-Mb/s (or faster) interfaces, where traffic is expected to exceed 50 Mb/s over a 5 minute period.  This means that this plugin is unsuitable for most 32-bit production environments. To avoid this problem, use the ip_ plugin instead.  There should be no problems on 64-bit systems running 64-bit kernels.
down.label received
down.type DERIVE
down.graph no
down.cdef down,8,*
down.min 0
up.label bps
up.type DERIVE
up.negative down
up.cdef up,8,*
up.min 0
up.max -1000000
up.info Traffic of the ens3 interface. Maximum speed is -1 Mb/s.
down.max -1000000

 

根据文章的内容,应用munin-monitoring/munin@f982751到插件中即可修复这个问题.

 

使用以下patch可以解决问题

--- if_.orig    2016-08-02 23:52:05.691224811 +0200
+++ if_ 2016-08-02 23:52:49.563223127 +0200
@@ -91,7 +91,7 @@
     # iwlist first)
     if [[ -r /sys/class/net/$INTERFACE/speed ]]; then
             SPEED=$(cat /sys/class/net/$INTERFACE/speed 2>/dev/null)
-            if [[ -n "$SPEED" ]]; then
+            if [ -n "$SPEED" -a "$SPEED" -gt "0" ]; then
                 echo $SPEED
                 return
             fi

 

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据