snmp

SNMP: Create custom OID

本秂侑毒 提交于 2019-12-06 01:47:53
问题 I need custom OIDs for monitoring some of my software states. But I just can't understand: how can I create custom OID (like .1.3.6.1.4.1.30891.100.103) in Windows XP system? I need few of them to write there some info and read it when needed but I have no idea how to create them in the system. 回答1: You should do this by writing an extension of Windows SNMP agent. The following article shows how, http://www.codeproject.com/KB/IP/SNMP_Agent_DLL__Part1_.aspx 回答2: There are a few options to

SNMP - Getting information from a process

我与影子孤独终老i 提交于 2019-12-05 23:17:12
I need to setup a process monitor on a number of servers using a monitoring tool called Zenoss. The problem I'm facing is how can I get information on a specific process via SNMP? I'm not familiar with SNMP at all and I'm having trouble finding out what I need. I've been trying to use a tool called SNMP-Probe but it only seems to give basic system information, nothing that I need or can use. Any help here is appreciated. What you need is to query the hrSWRunTable in order to gather the information you need. This MIB gives you a lot of information such as process name, path, type, status,

SNMP error with port already in use

僤鯓⒐⒋嵵緔 提交于 2019-12-05 23:00:05
I have created a SNMP agent simulator application which use the port number 161 for the simulated devices. sometimes it occurs the port alredy in use exception. how can i know if the 161 port is busy or not? By using netstat command. Specifically, netstat -s [PORT_NO] For example, netstat -s 161 http://www.techrepublic.com/blog/security/list-open-ports-and-listening-services/443 http://www.speedguide.net/faq_in_q.php?qid=115 By just starting your application. If it gets a BindException, the port is in use. If it doesn't, your application can run. Knowing that ahead of time doesn't really buy

How to get SNMP data using pysnmp?

馋奶兔 提交于 2019-12-05 22:12:02
I want to get snmp data by using python pysnmp module. I was using command line to get SNMP data but now I want to read it using pysnmp module. SNMP command - snmpwalk -v 1 -c public <ip address>:<port> xyz::pqr I was using command like above. Now I tried something like below - import netsnmp def getmac(): oid = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.2.1.17.7.1.2.2.1.2')) res = netsnmp.snmpgetbulk(oid, Version = 1, DestHost='ip', Community='pub') return res print getmac() I'm facing error - import netsnmp. No module netsnmp Anyone can give me suggestion how I can get snmp data from the snmp

net-snmp parse code, How to parse MIB?

允我心安 提交于 2019-12-05 21:55:56
I am learning net-snmp code-base. To parsing MIB. In parse.c and parse.h code keeps a hash bucket. (indexed bucket (tree list)) . There is also a tree structure, Which contains a next pointer pointing to Next node in hashed list of names. struct tree{ . . struct tree *next; // Next node in hashed list of names int modid; // The module containing this node } I printed the MIB, SNMP-FRAMEWORK-MIB:snmpFrameworkMIB(10) type=24 Next-> ' ipSystemStatsHCOctetGroup ipSystemStatsOutFragReqds ifStackGroup2 ifOutErrors ' I couldn't understand what is the relation among the name of objects appears after

SNMP v1,v2c and v3 trap difference

谁都会走 提交于 2019-12-05 17:42:53
问题 Explain the difference between v1, v2c and v3 Traps PDU/format. 回答1: This requires you to go through the RFC documents, which means this is not programming related, and probably belongs to ServerFault. Give you some hints: SNMP v1 defines a special TRAP message format, different from other messages (such as GET). http://tools.ietf.org/html/rfc1157#page-27 This message format is not used any more in SNMP v2 and v3. If an SNMP agent sends out such TRAP messages for v2 or v3, that can be a bug.

Linux snmp导入MIB库

柔情痞子 提交于 2019-12-05 17:33:56
Linux 中所使用的net-snmp自带了一些标准的MIB,但是世界上支持snmp的设备有无数种,各厂家都有自己的定义,这些定义不可能都包含在net-snmp自带的MIB中,因此,想要正确轮询一个这样的设备,必须载入厂家自己的MIB文件。 一般我们下载回来的MIB文件可能后缀名为.mib,为了清晰起见,一般改成 MIB_NAME.txt这样的形式,当然不改也可以,这个MIB文件叫什么名字无关紧要。 系统要载入一个MIB文 件,net-snmp必须知道从哪里载入。默认情况下是下边两个目录: 1. $HOME/.snmp/mibs 2. /usr/local/share/snmp/mibs 不过也有些发行版会改变这个默认路径,那么可以用下边两种方法之一获取它所使用的路径。 1.如果系统安装了net-snmp-config: # net-snmp-config --default-mibdirs 2.如果未安装net-snmp-config: # snmptranslate -Dinit_mib .1.3 2>&1 |grep MIBDIR init_mib: Seen MIBDIRS: Looking in '/root/.snmp/mibs:/usr/share/snmp/mibs' for mib dirs ... 二、net-snmp加载MIB文件方法

registering OIDs with snmp agent

会有一股神秘感。 提交于 2019-12-05 16:21:16
I am trying to simulate SNMP agent using snmp4j. I am trying to register MOs to the agent. Below is code snippet: static final OID mo1= new OID("1.3.6.1.4.1.1234.1.104"); static final OID mo2= new OID("1.3.6.1.4.1.1234.1.104.1"); static final OID mo3= new OID("1.3.6.1.4.1.1234.1.104.1.1"); agent.registerManagedObject(MOCreator.createReadOnly(mo1,"m1")); agent.registerManagedObject(MOCreator.createReadOnly(mo2,"m2")); agent.registerManagedObject(MOCreator.createReadOnly(mo3,"m3")); public class MOCreator { public static MOScalar createReadOnly(OID oid,Object value ){ return new MOScalar(oid,

Simple self-contained SNMP Agent example? (java/c# ideal)

百般思念 提交于 2019-12-05 15:53:49
After not having a whole bunch of luck finding any SNMP libraries for .NET that can act as SNMP agents (that can be used in an OSS project - meaning proprietary libs are out), I am now looking at implementing a simple SNMP agent class in C#. Can anyone provide any good examples or reference implementations of an SNMP agent (ideally nice & self contained), that I can use as a porting reference? Language isnt too important - but the simpler the better. Thanks! My open source project #SNMP Suite has a tiny project named "TestAgent". It is a WinForms based small utility to test out very basic SNMP

Get OID's type (syntax) from MIB using Net-SNMP API

故事扮演 提交于 2019-12-05 15:36:46
How can I get the syntax type and read/write access for an OID using NET-SNMP API? I am writing an SNMP tool that reads and sets values on a remote machine using SNMP protocol. Before setting the value, I need to check its type and access permissions (whether it is allowed to write this value on the server or not) from the MIB file. Unfortunately, I could not find any mention regarding how to do this in the Net-SNMP documentation. Roughly speaking: oid name[128]; size_t name_length = OID_LENGTH(name); strict tree *tp; read_objid("sysContact.0", &name, &name_length); tp = get_tree(name, name