snmp

Implementing a custom MIB in a PySNMP agent

随声附和 提交于 2019-12-21 03:22:08
问题 I'm having difficulty implementing a custom MIB in a PySNMP agent. I've started with: http://pysnmp.sourceforge.net/examples/4.x/v3arch/agent/cmdrsp.html created my own MIB file, used build-pysnmp-mib to make a Python module and successfully imported the symbol. I can't see where to go next. I need to somehow mount the imported symbol on the list of served MIBs and provide an implementation. (It's currently a MIB with one read-only INTEGER property.) The MIB file passes smilint without

使用snmp4j通过snmpv3协议获取指标

↘锁芯ラ 提交于 2019-12-21 03:19:15
参考: https://blog.csdn.net/zhouzhiwengang/article/details/46816371 ,本文对此又做了精进 先说一下参考链接中没提到的点: 1、通过snmp.getUSM()获取到的USM实例是同一个,因此不要在多线程并发中去往USM中添加用户或修改,否则有时会报找不到securityName的异常,在stackoverflow上有相关问题 2、USM有三种添加用户的方法,其中通过engineID的方式添加的时候,再获取时候也要通过engineID+name去获取,在参考中体现在,设置target的时候要设置AuthoritativeEngineID,否则在执行时查询USM会报找不到securityName //加上这句 target.setAuthoritativeEngineID(new OctetString("0002651100").getValue()); 下面是我自己测试时用到代码段,可以修改调试一下,加深理解: package com.moon.test3; import java.io.IOException; import java.util.List; import java.util.Vector; import java.util.concurrent.TimeUnit; import org.snmp4j

Send trap v2 in Java

瘦欲@ 提交于 2019-12-21 01:27:20
问题 How can I send snmpv2 traps from Java application. I tried to do example on snmp4j, but it didn't work. 回答1: I use SNMP4J for this. This javadoc might help you write your code. You can use the Snmp.trap() method Edit: Well, I dont have code of my own at this moment, but you may refer this one . You have to use Snmp.notify() for sending V2 trap instead of Snmp.trap() as trap() only supports sending V1 traps. 回答2: It took me some time but I finally figured out how to use SNMP4J to send a trap:

H3C SNMP配置解析

早过忘川 提交于 2019-12-20 09:11:47
华为交换机snmp配置 snmp-agent /使能snmp服务/ snmp-agent local-engineid 000007DB7F000001000049DD /系统自动生成,无需配置/ snmp-agent community read public /设置读团体名:public/ snmp-agent community write private /设置写团体名:private/ snmp-agent sys-info contact Mr.Wang-Tel:3306 /设置联系方式/ snmp-agent sys-info location 3rd-floor /设置设备位置/ snmp -agent sys-info version v1 v3 / 配置 snmp 版本允许V1(默认只允许 v3 )/ snmp-agent target-host trap address udp-domain 129.102.149.23 udp-port 5000 par ams securityname public /允许向网管工作站(NMS)129.102.149.23发送Trap报文,使用的团体名为public/ (1) snmp-agent sys-info contact <string>设置管理员的标识及联系邮箱方法,请把替换为你要设置成的值,下同

Implementing SNMP SendTrap using Indy components

假装没事ソ 提交于 2019-12-20 07:23:30
问题 I need to report errors from my application on C++Builder via SNMP. I started implementing SNMP SendTrap using Indy components. void __fastcall TMainForm::btSendTrapClick(TObject *Sender) { UnicodeString myEnterprise = "1.5.5.5.5.5.5.5"; UnicodeString eventType = "1.5.5.5.5.5.5.5.1"; UnicodeString eventDistance = "1.5.5.5.5.5.5.5.2"; TIdSNMP * idSnmp = 0; TSNMPInfo * infoSnmp = 0; idSnmp = new TIdSNMP(NULL); infoSnmp = new TSNMPInfo(idSnmp); idSnmp->Host = edHost->Text; idSnmp->Community =

ASN.1 compiler error token “SYNTAX” unexpected

ⅰ亾dé卋堺 提交于 2019-12-20 07:21:24
问题 I'm currently trying to compile a snippet of ASN.1 code. It looks as follows: RFC1213-MIB DEFINITIONS ::= BEGIN IMPORTS experimental FROM RFC1155-SMI OBJECT-TYPE FROM RFC-1212; mypersonaltest OBJECT IDENTIFIER ::= { experimental 1 } tester OBJECT-TYPE SYNTAX INTEGER ACCESS read-write STATUS optional DESCRIPTION "This is a test" ::= { mypersonaltest 1 } END Now I'm always getting an error on the line SYNTAX INTEGER : ASN.1 grammar parse error near line 9 (token "SYNTAX"): syntax error,

SNMPv3 Discovery

喜你入骨 提交于 2019-12-19 12:06:08
问题 I have use SNMP v1 and 2c for network discovery of printers by sending broadcast message with community "public" and it works just fine, but when I send broadcast message with version 3 of the protocol I got timeout error. Do somebody share example of SNMPv3 device discovery? Thank you. 回答1: Two things: 1) Doing a broadcast SNMPv1/v2c is actually not defined to work in the protocol. Cheap implementations will simply respond, as you've found, to any packet it sees that the kernel accepts to

SNMPv3 Discovery

前提是你 提交于 2019-12-19 12:06:06
问题 I have use SNMP v1 and 2c for network discovery of printers by sending broadcast message with community "public" and it works just fine, but when I send broadcast message with version 3 of the protocol I got timeout error. Do somebody share example of SNMPv3 device discovery? Thank you. 回答1: Two things: 1) Doing a broadcast SNMPv1/v2c is actually not defined to work in the protocol. Cheap implementations will simply respond, as you've found, to any packet it sees that the kernel accepts to

How do I collect bandwidth utilization data on remote devices/switches/servers?

人走茶凉 提交于 2019-12-19 10:46:20
问题 How do I collect bandwidth usage/utilzation on devices/switches. From what I understand there are systems that do something like this. They seem to all have snmp in common. I am looking for imformation on possibly rolling my own system for collecting this data that will be later used on a web-based front-end. For a real-world but perhaps a bit over complicated example of what I'm talking about take a look at ubersmith de. Most of it will be in a LAMP environment. Thanks. 回答1: On pure SNMP

Zabbix实战-简易教程--监控OSPF

坚强是说给别人听的谎言 提交于 2019-12-19 05:04:06
一、需求背景 网络工程师需要对OSPF进行监控,需求如下: 1、状态展示 OSPF区域状态 OSPF接口状态 OSPF邻居状态 2、问题报警 触发器设置: a、OSPF区域状态 b、OSPF接口状态 c、OSPF邻居状态 不是full状态就报警 二、准备工作 1、新建mapping(3个:SNMP OSPF Admin Status、SNMP OSPF Area Status、SNMP OSPF Neighbor State (ospfNbrState)) 2、导入模板(Template SNMP Router OSPF) 3、server上提供OSPF mib文件(OSPF-MIB.mib ),存放路径 /usr/share/snmp/mibs http://www.oidview.com/mibs/0/OSPF-MIB.html 三、故障排错 1、自动发现不支持Invalid SNMP OID:cannot parse expression. 原因1、zabbix3.0版本的lld有变化 原因2、server(proxy)上没有OSPF mib文件 解决办法: 因为3.0版本LLD有变化,The OIDs to discover are defined in SNMP OID field in the following format: discovery[{#MACRO1},