SNMP Monitor

来源:互联网 发布:vue.js 给span赋值 编辑:程序博客网 时间:2024/05/22 03:51

转自http://www.opennms.org/index.php/SNMP_Monitor

In order to use the SNMP monitor to check out values for particular SNMP OIDs, you'll need to first configure capsd-configuration.xml to discover the service, and then configure the poller to monitor the service.

为了利用SNMP监视功能来检测SNMP OID对象的实际数值,你需要首先配置capsd-configuration.xml,然后配置要被监测的端口.

The normal SNMP plugin looks like this:

通常的SNMP插件如下所示:

        <protocol-plugin protocol="SNMP" class-name="org.opennms.netmgt.capsd.SnmpPlugin" scan="on" user-defined="false">                <property key="timeout" value="2000"/>                <property key="retry" value="2"/>        </protocol-plugin>

Suppose you wanted to make sure at least one user was logged into a system at an time. You could use hrSystemNumUsers (.1.3.6.1.2.1.25.1.5.0) to test this:

假设你想要明确在某一时刻最后一个登录系统的用户,你可以使用hrSystmNumUsers(.1.3.6.1.2.1.25.1.5.0)进行如下的测试:

        <protocol-plugin protocol="NumUsers" class-name="org.opennms.netmgt.capsd.SnmpPlugin" scan="on" user-defined="false">                <property key="timeout" value="2000"/>                <property key="retry" value="2"/><property key="vbname" value=".1.3.6.1.2.1.25.1.5.0"/>        </protocol-plugin>

This plugin will test if the OID exists, and if so it will assign the NumUsers service to the IP address. You can also test for a specific value (vbvalue). This would be useful if there is an OID that indicates if a service is active, such as ipForwarding that indicates a device is a Router:

        <protocol-plugin protocol="Router" class-name="org.opennms.netmgt.capsd.SnmpPlugin" scan="on" user-defined="false">                <property key="vbname" value=".1.3.6.1.2.1.4.1.0"/>                <property key="vbvalue" value="1"/>                <property key="timeout" value="2000"/>                <property key="retry" value="2"/>        </protocol-plugin>

Once the service has been discovered, a monitor can be added to poller-configuration.xml. Again, the default monitor looks like this:

                <service name="SNMP" interval="300000" user-defined="false" status="on">                        <parameter key="retry" value="2"/>                        <parameter key="timeout" value="3000"/>                        <parameter key="port" value="161"/>                        <parameter key="oid" value=".1.3.6.1.2.1.1.2.0"/>                </service>

For the NumUsers service to see if at least one person is logged in:

                <service name="NumUsers" interval="300000" user-defined="false" status="on">                        <parameter key="retry" value="2"/>                        <parameter key="timeout" value="3000"/>                        <parameter key="port" value="161"/>                        <parameter key="oid" value=".1.3.6.1.2.1.25.1.5.0"/>                        <parameter key="operator" value="&gt;="/>                        <parameter key="operand" value="1"/>                </service>

Note that there are two new parameters: operator and operand. The operator can be one of:

  • Less than: "<" (you will need to use an entity &lt;)
  • Greater than: ">" (&gt;)
  • Less than or equals: "<=" (&lt;)
  • Greater than or equals: ">=" (&gt;=)
  • Equals: "="
  • Does not equal: "!="
  • Matches regular expression: "~"

The last value is used when the OID returns a string.

Be sure to add the monitor line at the bottom of the poller-configuration.xml file when adding new monitors:

        <monitor service="NumUsers"         class-name="org.opennms.netmgt.poller.monitors.SnmpMonitor"/>
 
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 1岁宝宝太老实了怎么办 上课小孩很调皮不听话怎么办 初中学生上课爱说话调皮怎么办 8个月婴儿疝气怎么办 头部疤痕不长发怎么办呢 有纹身想去当兵怎么办 在部队干活的钱怎么办 新兵5公里超过标准时间怎么办 17个月婴儿裹手怎么办 7个月婴儿裹手怎么办 俩月孩子裹手怎么办 婴儿 3个月 裹手怎么办 一岁宝宝裹手怎么办 5个月宝宝裹手怎么办 不想让孩子裹手怎么办 四个月宝宝裹手怎么办 开车撞狗了跑了怎么办 母螃蟹抱卵了怎么办 我能怎么办我也想睡觉 一个人的微信群找不到了怎么办 一个人的微信被删了找不到了怎么办 不想回对方微信怎么办 喜欢我的人太多怎么办 假如战争今夜打响我们该怎么办 约客户客户说忙怎么办 第一天来姨妈痛怎么办 痛经痛的很厉害怎么办 工作第一天被辞怎么办 第一天练车紧张怎么办 到新公司第一天怎么办 我妈上班别人欺负怎么办 欺负别人他妈来找了怎么办 家人都欺负我妈怎么办 人老了日不动了怎么办? 日照职业技术学院公租房怎么办留宿 眼镜上沾了胶水怎么办 近视镜片刮花了怎么办 墨镜镜片磨花了怎么办 邻居养狗味道大怎么办 邻居不让养狗了怎么办 养狗地板有味道怎么办