Nagios3.x 在CentOS6.4 x64平台部署 :监控网络设备(check_snmp)

一、安装check_snmp plugin在编译 nagios-plugins 时,如果系统支持net-snmp, 会自动编译 check_snmp 插件。如果发现nagios没有 check_snmp 插件,请安装 check_snmp 插件。1、安装net-snmpyum -y install net-snmp-libs net-snmp-devel net-snmp net-snmp-utils

2、编译 nagios-plugins-1.4.16./configuremake all注意:编译但千万别编译完后千万别make install否则会覆盖以前安装的nagios-plugins

3、安装 check_snmp 到 nagios插件目录cp ./nagios-plugins-1.4.16/plugins/check_snmp /usr/local/nagios/libexecchown nagios.nagios check_snmpchmod +x check_snmp

4、check_snmp version[root@nagios libexec]# ./check_snmp -Vcheck_snmp 1.4.16 (nagios-plugins 1.4.16)[root@nagios libexec]#如果版本过低,可能不支持 snmp v2c

二、注册check_snmp command[root@nagios objects]# vi commands.cfg# ‘check_snmp’ command definitiondefine command{command_name??? check_snmpcommand_line??? $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$}为了提高灵活性,我指定了一个参数 $HOSTADDRESS$, 其他参数在 service 里面直接写。

三、注册 services我们注册一个服务监控netscreen session的情况define host{use???????????? generic-switch????????? ; Inherit default values from a templatehost_name?????? Clab-NetScreen25??????????????? ; The name we’re giving to this switchalias?????????? Netscreen 25?????? ; A longer name associated with the switchaddress???????? x.x.x.x ???????????? ; IP address of the switchhostgroups????? FireWall??????????????? ; Host groups this switch is associated with}

define service{use???????????????????? generic-service ; Inherit values from a templatehost_name?????????????? NetScreen25service_description???? Session Allocate Statuscheck_command?????????? check_snmp!-P 2c -C ‘XXX’ -o .1.3.6.1.4.1.3224.16.3.2.0 -w 1:400}Comment:1、check_snmp 的help可以通过 ./check_snmp -h 获取2、更具实际情况定义 w c的调价。比如 -w 1:400 就是说 这个netscreen的session在 0-400是OK state。不在这个范围就返回WARNING states.3、相应的OID可以通过厂商的MIB查询;也可以在一些专业网站查询 Online MIB Database;也可以通过snmpwalk 得到。snmpwalk -v version -c community hostname4、相应的命令可以通过snmpget 测试。snmpget -c community -v 2c hostname iso.3.6.1.4.1.3224.16.3.2.0

Nagios3.x 在CentOS6.4 x64平台部署 :监控网络设备(check_snmp)

相关文章:

你感兴趣的文章:

标签云: