Sujet : Re: snmp unknown object identifier
De : jj (at) *nospam* franjam.org.uk (Jim Jackson)
Groupes : comp.miscDate : 20. Feb 2025, 13:37:11
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <slrnvre8fn.6l0.jj@iridium.wf32df>
References : 1 2 3
User-Agent : slrn/1.0.3 (Linux)
Sorry for late response ....
On 2025-02-18, Adrian <
bulleid@ku.gro.lioff> wrote:
In message <slrnvr70hg.3ku.jj@iridium.wf32df>, Jim Jackson
<jj@franjam.org.uk> writes
On 2025-02-17, Adrian <bulleid@ku.gro.lioff> wrote:
I'm trying to access a TP link access point to get some basic data from
it.
>
According to TP Link, I need the rfc1213 mib, which I've downloaded and
put in my ~/.snmp/mibs directory
>
However :
>
$ snmpget -v 1 -Cf -c public $IPADDRESS rfc1213.mib::ifInOctets
rfc1213.mib::ifInOctets: Unknown Object Identifier
>
greping on the file shows that I do have entries for ifInOctets.
>
Changing ifInOctets to something else (e.g. Time ticks) gives me the
same result, but using the long number (1.3.6.1.2.1.1.3.0) works. As
I'm not sure what ifInOctets translates to, I can't readily use the
number instead.
>
Having spent half the afternoon rummaging around on the 'net with no
clear (to me) answer, I'm here.
>
Suggestions on where to continue welcomed.
>
>
Yes SNMP can be a pain. The info in that mib often is a table of values,
one per interface, and you need to know the interface table index to get
one value.
>
However you can get all the table in one go by doing an snmpwalk. It a
long time since I did snmp monitoring - I have written C-code to gather
and display interface data stats, but the numbers are not at my finger
tips any more. However I googled and got the number string
>
1.3.6.1.2.1.2.2.1.10
>
so try
>
snmpwalk -v1 -c public $IPadd 1.3.6.1.2.1.2.2.1.10
>
Here's what my VDSL router gave back ...
>
IF-MIB::ifInOctets.49 = Counter32: 0
IF-MIB::ifInOctets.50 = Counter32: 1622068159
IF-MIB::ifInOctets.51 = Counter32: 0
IF-MIB::ifInOctets.52 = Counter32: 1989775457
IF-MIB::ifInOctets.53 = Counter32: 3244444578
IF-MIB::ifInOctets.54 = Counter32: 3582643404
IF-MIB::ifInOctets.55 = Counter32: 46130557
IF-MIB::ifInOctets.56 = Counter32: 3610089600
IF-MIB::ifInOctets.1000 = Counter32: 0
IF-MIB::ifInOctets.1001 = Counter32: 0
IF-MIB::ifInOctets.1002 = Counter32: 0
IF-MIB::ifInOctets.1003 = Counter32: 0
>
and if you want the mib numbers ...
>
snmpwalk -On -v1 -c public $IPadd 1.3.6.1.2.1.2.2.1.10
.1.3.6.1.2.1.2.2.1.10.49 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.50 = Counter32: 1622073446
.1.3.6.1.2.1.2.2.1.10.51 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.52 = Counter32: 1989775457
.1.3.6.1.2.1.2.2.1.10.53 = Counter32: 3244454443
.1.3.6.1.2.1.2.2.1.10.54 = Counter32: 3582665247
.1.3.6.1.2.1.2.2.1.10.55 = Counter32: 46131353
.1.3.6.1.2.1.2.2.1.10.56 = Counter32: 3610126193
.1.3.6.1.2.1.2.2.1.10.1000 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.1001 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.1002 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.1003 = Counter32: 0
>
>
And to dump all the interface numbers is all the gory details try ...
>
snmpwalk -v1 -c public O 1.3.6.1.2.1.2.2.1
>
or add -On for the number numbers.
>
Happy playing it can be quite fun and often very frustrating!
>
Jim
>
>
Thanks for the reply.
>
Trying that I get :
>
snmpwalk -v1 -c public $IPadd 1.3.6.1.2.1.2.2.1.10
iso.3.6.1.2.1.2.2.1.10.1 = Counter32: 480
iso.3.6.1.2.1.2.2.1.10.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.10.3 = Counter32: 0
iso.3.6.1.2.1.2.2.1.10.4 = Counter32: 0
iso.3.6.1.2.1.2.2.1.10.5 = Counter32: 0
iso.3.6.1.2.1.2.2.1.10.6 = Counter32: 47834339
iso.3.6.1.2.1.2.2.1.10.7 = Counter32: 28162230
iso.3.6.1.2.1.2.2.1.10.8 = Counter32: 21747742
iso.3.6.1.2.1.2.2.1.10.9 = Counter32: 0
iso.3.6.1.2.1.2.2.1.10.10 = Counter32: 0
>
and
>
snmpwalk -On -v1 -c public $IPadd 1.3.6.1.2.1.2.2.1.10
.1.3.6.1.2.1.2.2.1.10.1 = Counter32: 480
.1.3.6.1.2.1.2.2.1.10.2 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.3 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.4 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.5 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.6 = Counter32: 47855251
.1.3.6.1.2.1.2.2.1.10.7 = Counter32: 28168496
.1.3.6.1.2.1.2.2.1.10.8 = Counter32: 21766531
.1.3.6.1.2.1.2.2.1.10.9 = Counter32: 0
.1.3.6.1.2.1.2.2.1.10.10 = Counter32: 0
>
>
If you smnpwalk these strings can get more information ...
1.3.6.1.2.1.2.2.1.1
ifIndex tells you the valid indexes - last numbers of the "tables".
1.3.6.1.2.1.2.2.1.2
ifDescr gives descriptions of the interfaces
1.3.6.1.2.1.2.2.1.3
ifType gives the types of interfaces
1.3.6.1.2.1.2.2.1.5
ifSpeed gives the interfaces speed
1.3.6.1.2.1.2.2.1.8 ifOperStatus status of interface
1.3.6.1.2.1.2.2.1.10 ifInOctets
1.3.6.1.2.1.2.2.1.16 if OutOctets
There are others. Hope you are getting results.