mib

SNMP MIB Table complex data object

不羁岁月 提交于 2019-12-24 12:37:11
问题 Can a table entry include a complex data object? For example can a table entry look like this? ExampleTableEntry ::= SEQUENCE { simpleDataObject1 INTEGER, complexDataObject2 ComplexType, SimpleDataObject3 TruthValue } ComplexType OBJECT-IDENTITY STATUS current DESCRIPTION " What ever " ::= { parent 1 } subObject1 OBJECT-TYPE SYNTAX DisplayString (SIZE (0..255)) MAX-ACCESS read-create STATUS current DESCRIPTION " Diameter peer's host name. Reference: RFC 3588 " ::= { ComplexType 1 } subObject2

How to set BITS data type in SNMPSET command?

ぃ、小莉子 提交于 2019-12-23 21:24:28
问题 the MIB OID object have data type 'Bits': object_OID Composed Type: Bits Base Type: BITS Access: read-write Kind: Scalar SMI Type: OBJECT-TYPE Value List: doc (0) emta (1) cpe (2) From MIB description, default is DEFVAL { '00'h }. I want set value 2 (cpe). I tried to set the value with command snmpset -v2c -c public 192.168.100.1 [object_OID] b 2 but got Error in packet. Reason: wrongValue (The set value is illegal or unsupported in some way) tried also snmpset -v2c -c public 192.168.100.1

How to add row in a MIB table with snmpset?

时光怂恿深爱的人放手 提交于 2019-12-23 15:27:17
问题 I changed recently my custom MIB file to include tables and not only scalars, it validates, I can create sub-agent etc. but if I try to read it, it says no entries: snmptable -v1 -c public hostname:10161 myMibName::myTable myMibName::myTable: No entries Well, I didn't add any default/sample rows to that table in my agent code. If I try to set some values of the table with snmpset similar to how I did it on scalars, it always fails so table requires its own syntax. How can I add a row to a

Reading SNMP Object index of type IPAddress

故事扮演 提交于 2019-12-22 11:28:12
问题 In a simple SNMP table like mib-2.interfaces.ifTable , ifIndex is the index for the table, so you read ifIndex .1 (i.e. read value from direct child nodes of ifIndex ) to get the index for the first row of the table. Simple enough. But it's not as obvious with something like mib-2.ip.ipRouteTable . In that case ipRouteIfIndex is the index column. It's defined as INTEGER just like ifIndex was. However, you can't read the direct child nodes (i.e. ifIndex .0 is a direct child), but instead need

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,

net-snmp sample code to parse MIB file and extract trap related information from it

北城余情 提交于 2019-12-18 16:59:42
问题 I am using the net-snmp C library on Windows. I want to parse trap-related information from the MIB files. I need some sample code to do this. I didn't find anything useful on http://www.net-snmp.org/ 回答1: Here is some sample code to parse MIB files using the net-snmp library. Before you use this code you need to refer or add the Include and Lib directories of net-snmp in your project properties: #include "stdafx.h" #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h>

Definition of SNMP Gauge32 vs Counter32

风格不统一 提交于 2019-12-17 19:35:32
问题 Can someone point me to a good definition of Gauge32 vs Counter32? I understand that Counter32 can wrap, but Gauge32 can't. I'm trying to understand their semantics. For example, I've heard you should take the difference between two Counter32 readings to get a value/second. Is there something like that for a Gauge32 value? Thanks for any insight. 回答1: Yes, for Gauge32 you can also use that. Deep down inside, Gauge32 and Counter32 are the same, except that data stored in Counter32 keeps

Multiple sub-agents for one table in Net-SNMP

冷暖自知 提交于 2019-12-11 15:22:36
问题 I'm writing a custom MIB to expose a table over SNMP. There will be one table with set columns, but a variable numbers of rows. Is it possible, with Net-SNMP , to add multiple rows to the table from multiple processes (e.g. process A creates row 1, process B creates row 2, etc...)? I would like to avoid having one "master sub-agent" if possible (other then something that is a part of Net-SNMP , like snmpd / snmptrapd /etc). I would like to use mib2c to help generate code if possible, but I

c# get page count for all printers with snmp

喜欢而已 提交于 2019-12-11 10:57:14
问题 I have a c# program that need to take the black, color, scan page counts (the total). I'm using at the moment SNMP with OID to get it but it is very difficult becuase each printer has its own OID. The problem is that each printer has its own MIB numbers to get the black,color,scan page counts. I'm looking for a generic solution that will work on most (if not all). Any thoughts and examples on how do I do that? 来源: https://stackoverflow.com/questions/14559727/c-sharp-get-page-count-for-all

Using pySNMP to write an SNMP agent (for OpenNMS)

北城以北 提交于 2019-12-10 05:31:52
问题 I'm trying to write a python SNMP agent that I can embed within my python application so that the application can be monitored remotely by OpenNMS. OpenNMS expects the Agent to implement the HOST-RESOURCES-MIB querying two fields hrSWRunName and hrSWRunStatus . I took a pysnmp example as the basis of my code and edited it as I believed necessary. The resulting code looks like this: import logging from pysnmp import debug from pysnmp.carrier.asyncore.dgram import udp from pysnmp.entity import