赞
踩
2、插件使用perl开发,确定已安装perl
安装:yum install -y perl*
使用 check_snmp_int.pl -h 查看帮助,如果出现以下问题:
“Can‘t locate Net/SNMP.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_prl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_snmp_int.pl line 16.”
解决: perl -MCPAN -e ‘install Net::SNMP‘
3、定义command
define command{ command_name check-snmp-int command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG1$ $ARG2$ }
4、定义主机和服务:
define host{ use generic-switch host_name cisco3560 alias cisco3560 address 192.168.6.254 hostgroups switches }
define service{ use generic-service host_name cisco3560 service_description GigabitEthernet0/24 check_command check-snmp-int!public!-n ‘^GigabitEthernet0/24$‘ -k -f -w 20000,50000 -c 100000,200000 } define service{ use generic-service host_name cisco3560 service_description Vlan100 check_command check-snmp-int!public!-n ‘^Vlan100$‘ -k -f -w 20000,50000 -c 100000,200000 }
注: 定义服务是: max_check_attempts 参数建议修改为6(默认为4),因为此插件至少要运行3到4次甚至以上才能正常,每次读取一次数据并记录在临时文件中,如下:
检查并重新加载配置文件:
service nagios checkconfig 或:/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg service nagios reload
检查演示:
本文出自 “逆行者” 博客,请务必保留此出处http://lingyi.blog.51cto.com/2837715/1766186
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。