On 11 March 2011 12:28, Jaime Lozano <[email protected]> wrote:
> This is very simple. This works:
>>snmpget -m all -v1 -c public localhost sysUptime.0 2>/dev/null
> DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (975551) 2:42:35.51
Yes - that reports the (single) value associated with the (instance) OID
sysUpTime.0 (i.e. .1.3.6.1.2.1.1.3.0)
> But this doesnt work, and returns nothing:
>>snmpget -m all -v1 -c public localhost iso 2>/dev/null
That is correct.
You are asking for the value associated with the OID .1
There is no such value.
Two mistakes here:
- values are always associated with an *instance* of an object,
rather than the object itself. So there will *always* be at least
once more subidentifier in the OID , compared to the OID of the object.
(either the index value(s) for a table, or .0 for a scalar object)
- values are only associated with (instances of) *leaf* objects,
i.e. those defined using OBJECT-TYPE.
Objects such as .iso are purely there to describe the internal
structure of the information tree (and are defined using OBJECT
IDENTIFIER)
The simplest way to think about this is to look at the output of
an 'snmpwalk' command. The *only* OIDs that you can issue
a GET request on, are the ones that appear in that output.
If a particular OID doesn't appear in that list, then trying to
GET it, will fail.
snmpwalk .... .iso
will report lots of OIDs that *start* with '.iso',
but nothing that is *just* .iso = xxxx
Please see any book on SNMP to understand how MIBs and OIDs work.
Dave
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
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