我在Nagios XI上,我使用了Vmware .ova来完成安装
我使用下面的命令来检索通过路由器接口的实际带宽
/usr/local/nagios/libexec/check_snmp_int.pl -H xxxx -C community -2 -n eth -f -k -w 1000,1000 -c 1200,1200 eth0:UP (552.9KBps/CRIT 2507.9KBps), eth1:UP (CRIT 2466.9KBps/CRIT 8087.0KBps), eth2:UP (93.0KBps/619.8KBps):(3 UP): CRITICAL | 'eth0_in_octet'=3151058755c 'eth0_out_octet'=2254878312c 'eth1_in_octet'=626765302c 'eth1_out_octet'=634153554c 'eth2_in_octet'=1137408010c 'eth2_out_octet'=160432245c
该命令正在工作。
但perfdata使图烦人阅读: eth2_out_octet'=160432245c等…
所以我想这些值在MB / S
我试图使用-B -M -Y标志来调整这些值。
我可以以字节或者比特来得到结果,但是我不可能以mb / s为单位
做一个有经验的人之前,有一个解决scheme?
好的,我在Nagios XI论坛上提问。
我不得不做的是修改check_snmp_int perl脚本
并将variables除以1024两次:
$perf_out .= sprintf("%.0f",($checkperf_out_raw[0] * 8)/1024/1024) .";"; $perf_out .= ($o_warn[0]!=0) ? $o_warn[0]*$warn_factor . ";" : ";"; $perf_out .= ($o_crit[0]!=0) ? $o_crit[0]*$warn_factor . ";" : ";"; $perf_out .= "0;". $$resultf{$oid_speed[$i]} ." "; $perf_out .= "'" . $descr[$i] ."_out_Mbps'="; $perf_out .= sprintf("%.0f",($checkperf_out_raw[1] * 8)/1024/1024) .";"; $perf_out .= ($o_warn[1]!=0) ? $o_warn[1]*$warn_factor . ";" : ";"; $perf_out .= ($o_crit[1]!=0) ? $o_crit[1]*$warn_factor . ";" : ";"; $perf_out .= "0;". $$resultf{$oid_speed[$i]} ." ";