oid

Is there a simple way to map snmp(MIB) strings to OIDs in Perl?

Deadly 提交于 2020-01-15 02:37:51
问题 Is there a simple way/module to map snmp(MIB) strings to OIDs in Perl? E.g. I start with "sysUpTime.0" and get "1.3.6.1.2.1.1.3.0". As far as I can see, Net::SNMP expects you to have them already mapped. 回答1: You can use NetSNMP::OID to do the conversion. use NetSNMP::OID; my $oid = NetSNMP::OID->new('sysUpTime.0'); NetSNMP::OID is part of the Net-SNMP project, not to be confused with the Net::SNMP module. 来源: https://stackoverflow.com/questions/2433187/is-there-a-simple-way-to-map-snmpmib

PostgreSQL: from OID to Bytea

瘦欲@ 提交于 2020-01-01 14:20:41
问题 We have decided to move from OID s in our PostgreSQL 9.0 database and use bytea columns instead. I'm trying to copy the data from one column to the other, but I can't figure out the right query. This is the closest I've gotten to: update user as thistable set pkcs_as_bytea = (select array_agg(mylargeobject.data) from (select * from pg_largeobject where loid = thistable.pkcs12_as_oid order by pageno) as mylargeobject) where thistable.pkcs12 is not null And that gives me the following error

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

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

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

自作多情 提交于 2019-12-12 09:43:08
问题 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. 回答1: Roughly speaking: oid name[128]; size_t name_length = OID

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

How do you convert a JCE algorithm name into an AlgorithmIdentifier object?

烈酒焚心 提交于 2019-12-11 04:23:23
问题 I'm using BouncyCastle 1.54. I have a JCE algorithm string - like "ECDSAwithSHA256" (for example). I need an org.bouncycastle.asn1.x509.AlgorithmIdentifier object. Alternatively, I could create an AlgorithmIdentifier object from an OID, but that begs the question of how to translate an algorithm string into an OID instead. I could create a giant if/else, but there's got to be a standard way to do this. 回答1: You can use the algorithm finders of BouncyCastle (see javadoc) import org

Reading SNMP Object index of type IPAddress

与世无争的帅哥 提交于 2019-12-06 11:29:53
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 to read ifIndex.0.0.0.0 to get to the value. So how does one know how to find the value when it's not a

Does the order of attributes in SNMP Traps matter

 ̄綄美尐妖づ 提交于 2019-12-06 04:58:00
问题 I am using some SNMP traps for monitoring of applications. Now I was told that some monitoring systems might have problems if the order of the attributes within the the traps was not the same as defined in the MIB. From the Complexity of the OIDs that could easily be used to re-order the attributes I was surprised by this, so I tried to find the relevant section of the RFC, but I could neither find something that said any ordering is allowed nor anything that said it is important. In other

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