dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
1501

Fraoch
join:2003-08-01
Cambridge, ON
SmartRG SR808ac
TP-Link EAP225
Grandstream HT502

Fraoch

Member

SNMP help (IOG)

Click for full size
Hello:

Is anyone using IOG?

I used to have MRTG working but I re-installed. All I really want is total data and it looks like IOG should fit the bill nicely, it's just a 2-line configuration (I can remember playing with MRTG for days and I never could get it to display total data).

However I can't quite get it working. I think it's my confusion over MIBs and OIDs (which is very, very confusing!)

To configure IOG, you're supposed to use:

[name:hostname:community:uptimeOID:uptimedatapath]
name:hostname:community:inOID:outOID:path
 

like so:

[localhost:127.0.0.1:public:sysUpTime.0:/var/lib/iog]
localhost:127.0.0.1:public:ifInOctets.2:ifOutOctets.2:/var/lib/iog
 

So I did:

[Router:192.168.1.1:public:1.3.6.1.2.1.1.3:/var/lib/iog]
Router:192.168.1.1:public:1.3.6.1.2.1.2.2.1.10.2:1.3.6.1.2.1.2.2.1.16.2:/var/lib/iog
 

That should be right...when I got the sysUpTime OID wrong the program output was pretty specific. As soon as I corrected it I no longer got that error.

However I'm not getting graphs. Instead the program outputs:

SNMP Error:
no response received
SNMPv1_Session (remote host: "192.168.1.1" [192.168.1.1].161)
                  community: "public"
                 request ID: 325566115
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/sbin/iog line 150.
SNMP Error: no response received
SNMPv1_Session (remote host: "192.168.1.1" [192.168.1.1].161)
                  community: "public"
                 request ID: 325566115
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
SNMP Error:
no response received
SNMPv1_Session (remote host: "192.168.1.1" [192.168.1.1].161)
                  community: "public"
                 request ID: 715838355
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/sbin/iog line 125.
SNMP Error: no response received
SNMPv1_Session (remote host: "192.168.1.1" [192.168.1.1].161)
                  community: "public"
                 request ID: 715838355
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 

i.e. it's two responses to two different request IDs, and no graphs get generated.

Oddly when I was configuring things and accidentally used:

Router:192.168.1.1:public:ifInOctets.2:ifOutOctets.2:/var/lib/iog
 

in the second line, i.e. MIBs instead of OIDs, I get only two "no response received" errors for one request ID, and a graph does get generated, though the numbers look incorrect.

Incidentally I'm using this on Linux Mint 17. SNMP is enabled in my EdgeRouter Lite with the "public" community string.

This is doing my head in, I feel like I'm way over my head here. I've read and researched a lot but I'm not making much progress.

Any ideas or pointers?

Attached is a graph, when I do get one.

Thanks.
HELLFIRE
MVM
join:2009-11-25

HELLFIRE

MVM

"SNMP Error, No response recieved" is a pretty generic as heck error!

My basic troubleshooting would be this :

- ping to 192.168.1.1 from your polling station, to ensure layers 1 to 3 is present.

- telnet to 192.168.1.1 on port 161 from your polling station.

After that it's drilling into the nuances of SNMP config, namely :

- having the right version of SNMP enabled; is the Edgerouter really using SNMPv1?

- having the right community string -- this one's a real killer sometimes.

- doing an SNMPwalk of 192.168.1.1

- ensuring you are using the right MID / OID. Some MIB / OIDs are generic values, others are vendor specific.

My 00000010bits

Regards

Fraoch
join:2003-08-01
Cambridge, ON

Fraoch

Member

Thanks for the response! I'll take a look at these, but what's most mysterious is that it does work to some extent...so I am getting SNMP data of some sort.
TechMike
join:2008-06-09
Denver, CO

TechMike

Member

If it responds to some SNMP requests, but not the one you're trying, you likely don't have the OID correct.

Use snmpget to test the SNMP responses.

I.e.
$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.2.2.1.10.2

Fraoch
join:2003-08-01
Cambridge, ON
SmartRG SR808ac
TP-Link EAP225
Grandstream HT502

1 edit

Fraoch

Member

Weird, I get good responses for both OIDs.

$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.2.2.1.10.2
iso.3.6.1.2.1.2.2.1.10.2 = Counter32: 3873887749
$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.2.2.1.16.2
iso.3.6.1.2.1.2.2.1.16.2 = Counter32: 3493864378
 

I did spot an error with the sysUpTime OID:

$ snmpget -v 1 -c public 192.168.1.5 1.3.6.1.2.1.1.3
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.1.3
 

and corrected it as the config file indicated - it's either sysUpTime or sysUpTime.0:

$ snmpget -v 1 -c public 192.168.1.5 1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (7215800) 20:02:38.00
 

but to no avail - it's still giving the same errors.

Perhaps a timing issue - it's not getting responses back fast enough, or it retries too quickly?

I was trying to avoid e-mailing the developer as this is probably a newbie issue but I may have no choice as it doesn't seem there's any other support for this.
HELLFIRE
MVM
join:2009-11-25

1 edit

HELLFIRE to Fraoch

MVM

to Fraoch
I've a feeling you're using the wrong OIDs -- checking here and here as a reference

1.3.6.1.2.1.1.3 -- maps to SYSUPTIME
1.3.6.1.2.1.2.2.1.10.2 -- does not map to anything, the closest is 1.3.6.1.2.1.2.2.1.10 / IfInOctets or 1.3.6.1.2.1.2.2.1.10.1 / snmp
1.3.6.1.2.1.2.2.1.16.2 -- does not map to anything, the closest is 1.3.6.1.2.1.2.2.1.16 / IfOutOctets

I'd get a mib broswer or do an snmpwalk to confirm exactly what this sucker's got, or contact ubiquiti.

I'm like 95% sure if you change to the actual known OID values of SNMPv2-MIB this should work.

My 00000010bits

Regards

Fraoch
join:2003-08-01
Cambridge, ON
SmartRG SR808ac
TP-Link EAP225
Grandstream HT502

Fraoch

Member

said by Fraoch:

I used to have MRTG working but I re-installed. All I really want is total data and it looks like IOG should fit the bill nicely, it's just a 2-line configuration (I can remember playing with MRTG for days and I never could get it to display total data).

LOL, I just got MRTG working in 5 minutes. Still doesn't give total data though, so I still need to bash away at IOG - or figure out how to get MRTG to give totals.

Got the setup information from:

»wiki.ubnt.com/SNMP_and_M ··· nitoring

and my config lines are:

Title[test1_eth0]: EdgeRouter Lite
PageTop[test1_eth0]: EdgeRouter Lite
Target[test1_eth0]: ifInOctets.2&ifOutOctets.2:public@192.168.1.1 
MaxBytes[test1_eth0]: 10000000
 
Fraoch

Fraoch to HELLFIRE

Member

to HELLFIRE
said by HELLFIRE:

I've a feeling you're using the wrong OIDs -- checking here and here as a reference

1.3.6.1.2.1.1.3 -- maps to SYSUPTIME

That's the OID I need, but I actually needed sysUpTime.0:

$ snmpget -v 1 -c public 192.168.1.5 1.3.6.1.2.1.1.3
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.1.3
 

whereas:

$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (10183693) 1 day, 4:17:16.93
 

Comments in the config file indicate to use either sysUpTime or sysUpTime.0 - Cisco equipment uses sysUpTime.0 and it looks like that's what my EdgeRouter uses.

1.3.6.1.2.1.2.2.1.10.2 -- does not map to anything, the closest is 1.3.6.1.2.1.2.2.1.10 / IfInOctets

That's also the one I need, but I need port 2, i.e. IfInOctets.2:

$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.2.2.1.10
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.2.2.1.10
 
$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.2.2.1.10.2
iso.3.6.1.2.1.2.2.1.10.2 = Counter32: 4000694967
 

1.3.6.1.2.1.2.2.1.16.2 -- does not map to anything, the closest is 1.3.6.1.2.1.2.2.1.16 / IfOutOctets

Yes, this is also what I need - IfOutOctets on port 2, IfOutOctets.2:

$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.2.2.1.16
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.2.2.1.16
 
$ snmpget -v 1 -c public 192.168.1.1 1.3.6.1.2.1.2.2.1.16.2
iso.3.6.1.2.1.2.2.1.16.2 = Counter32: 3519081220
 

So my limited understanding of MIBs and OIDs seems to show these OIDs are OK. Should they be returning a number if not?

snmpwalk and a MIB browser both return the same data. Both show the same data as snmpget obtained above at the same OIDs.

Which is why this is so frustrating. This looks correct now, but it's still not working.

Thank you so much for the help, it's appreciated! :)
HELLFIRE
MVM
join:2009-11-25

HELLFIRE to Fraoch

MVM

to Fraoch
..okay, fair enough, and yeah, if snmpwalk's picking up some value that seems to correspond to what you're after, I'd say you're on the right track.
That's why I suggested if you're going to involve IOG, have Ubiquti there... Ubiquiti's using the standard SNMPv2-MIB here (as proven by your
snmpwalk output), now the question is why IOG isn't seeing that, or is registering that error.

Best of luck with things!

Regards

mackey
Premium Member
join:2007-08-20

mackey to Fraoch

Premium Member

to Fraoch
Use the Source, Luke!

A quick reading shows IOG is expecting "ifInOctets" / "ifOutOctets" literals (like the documentation shows) and not raw 1.3.6.... values. Using the 1.3.6... notation will royally break the split()'s and lookup table.

sub snmpget {
   my($host, $community, $inoid, $outoid) = @_;
   my($response, $bindings, $binding, $value, $oid, $session, @results);
 
   my %oidnames = qw(ifInOctets      1.3.6.1.2.1.2.2.1.10
                     ifOutOctets     1.3.6.1.2.1.2.2.1.16
                     ifHCInOctets    1.3.6.1.2.1.31.1.1.1.6
                     ifHCOutOctets   1.3.6.1.2.1.31.1.1.1.10);
 
   my ($inoidname,$inoidport) = split(/\./, $inoid);
   my ($outoidname,$outoidport) = split(/\./, $outoid);
 
   $inoid = encode_oid(split(/\./, ($oidnames{$inoidname} . ".$inoidport")));
   $outoid = encode_oid(split(/\./, ($oidnames{$outoidname} . ".$outoidport")));
 

Use "ifInOctets.2" not "1.3.6.1.2.1.2.2.1.10.2"

/M

Fraoch
join:2003-08-01
Cambridge, ON
SmartRG SR808ac
TP-Link EAP225
Grandstream HT502

1 edit

Fraoch

Member

WOW thanks!!

That's exactly what was required, I think! It ran for the first time without errors.

I feel quite stupid. Actually I was overthinking it, it's right there in the config file to use "sysUpTime" or "sysUpTime.0", "ifInOctets" and "ifOutOctets".

My first errors were because I used sysUpTime rather than sysUpTime.0 - that led to only two errors. When I used OIDs (trying to solve that), it led to 4 errors. Should have been a clue...

It's not giving any data yet, but at least it's not giving errors.

Thanks again!
Fraoch

Fraoch

Member

said by Fraoch:

It's not giving any data yet, but at least it's not giving errors.

Just had to make symlinks to some images and make sure the directory had appropriate permissions and all running well.

Thanks.
HELLFIRE
MVM
join:2009-11-25

HELLFIRE to Fraoch

MVM

to Fraoch
said by Fraoch:

I feel quite stupid. Actually I was overthinking it

...sometimes when looking at a tree we forget there's a whole forest. *sighs*

Glad it's working for you now!

Regards

Fraoch
join:2003-08-01
Cambridge, ON
SmartRG SR808ac
TP-Link EAP225
Grandstream HT502

Fraoch

Member

said by HELLFIRE:

said by Fraoch:

I feel quite stupid. Actually I was overthinking it

...sometimes when looking at a tree we forget there's a whole forest. *sighs*

Yup, I knew it was something stupid like that, I just didn't know where I was being stupid.

Playing around with MIBs and OIDs I'm starting to realize that some programs that deal with them don't use them directly. They're not exactly human-friendly. So a lot of programs use shortcuts and aliases when dealing with them. Both IOG and MRTG use shortcuts and it looks like some others do too - I found a couple of Cacti configuration screenshots showing the same thing.

Glad it's working for you now!

Thanks for your help.