Re: Design new SNMP MIB
"Dave Shield" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On 24/08/06, Michal Ludvig <[email protected]> wrote: > I have a software package for which I need to report some status / > configuration tables via SNMP/AgentX. Each table has a bunch of > key=value pairs, where the list of keys could change in time (e.g. with > new version), so I prefer not to hardcode them to the MIB directly. > > 1) My idea is to have some simple tables: [snip] > So this is the basic. Drawback is it could be a bit of pain to do GET/ > SET as I'll need to query the whole list of names from > myDevice.tabStatus.varName, get the index of what I want and only then > in another query get the actual variable. OK - Why not use the variable name as the index to the table? So you'd end up with something like: myDevice.tabStatus.varValue."num_connections" = STRING: 123 myDevice.tabStatus.varValue."mem_used" = STRING: 98765 The other read-write for setting system variables: myDevice.tabConfig.varValue."max_connections" = STRING: 999 myDevice.tabConfig.varValue."max_mem" = STRING: 99999 > Another thing is that I'll need to return all varValue.X as STRINGs even > if some of them are actually integers. Or can I have each index in a > table of a different type? Each column of a table is a fixed type, so you couldn't have one "varValue" returning a string, and another returning an integer. But you *could* define several value columns to cover the different syntaxes, and have a "sparse" table - with only one value column valid for any particular row. e.g. $ snmpwalk myDevice varType."num_connections" = integer(1) varType."current_time" = string(2) varType."mem_used" = integer(1) varValueInt."num_connections" = 99999 varValueInt."mem_used" = 2 varType."current_time" = "Later than you think" See the DISMAN-EXPRESSION-MIB::expValueTable for an example of this. That's a bit more complex than you'd need, due to the need to handle wildcarded expressions, but the basic idea is the same. > Is is OK to have one variable accessible in two ways Yes. It's not ideal, but it's perfectly common - and a very reasonable response to the realities of modelling an imperfect world! The most important thing is to ensure that the values reported are consistent - you shouldn't get a different answer depending on which object you query. (Something that our current agent isn't always very good at :-( ) > BTW How should I assign OID to my MIB? Do I need to apply for an > Enterprise ID with IANA? Long term - yes. > Is there an OID reserved for testing / development? NET-SNMP-MIB::netSnmpPlaypen That's fine if you're just working internally. But if this code is ever likely to see a wider audience (e.g. the rest of your company, or particularly the wider world), then you really must obtain your own Enterprise number from IANA. > I don't know yet much about designing and writing MIBs so I'm seeking > some advices here. Any thoughts and pointers are highly appreciated! "Understanding SNMP MIBs" is the canonical work on the subject. Dave ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users