LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Why OID for SNMP works from CMD Line and NOT From cfg? (https://www.linuxquestions.org/questions/linux-networking-3/why-oid-for-snmp-works-from-cmd-line-and-not-from-cfg-912698/)

mrm5102 11-09-2011 02:47 PM

Why OID for SNMP works from CMD Line and NOT From cfg?
 
Hey All,

I am using MRTG to monitor some 4500 series routers for Traffic, CPU Load, Errors, etc...
Now I am trying to monitor Memory Utilization and am experiencing some problems.

If I run the following snmpget commands from the command line I get back the correct data.
Code:

#The folloing 2 commands returns used memory on the router. First is for processor and Second for I/O.

> snmpget -v1 -c commName 192.168.1.1 1.3.6.1.4.1.9.9.48.1.1.1.5.1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.1 = Gauge32: 151235224

> snmpget -v1 -c commName 192.168.1.1 1.3.6.1.4.1.9.9.48.1.1.1.6.1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.1 = Gauge32: 344027012

The above is all well and good but the following cfg file for MRTG is NOT working and it's driving me nuts because it's not returning any data to RRD??

cfg File:
Code:

Target[Memory-use]: 1.3.6.1.4.1.9.9.48.1.1.1.5.1&1.3.6.1.4.1.9.9.48.1.1.1.5.1:commName@192.168.1.1
Title[Memory-use]: Memory-Usage USED on 192.168.1.1
LegendI[Memory-use]: Used
Legend1[Memory-use]: Total-RAM
MaxBytes[Memory-use]: 536870912
UnScaled[Memory-use]: ymwd
YLegend[Memory-use]: Total Ram
ShortLegend[Memory-use]: bytes
routers.cgi*Options[Memory-use]: gauge, growright, nototal, noo
routers.cgi*GraphStyle[Memory-use]: stack
PageTop[Memory-use]: <h1>192.168.1.1 Memory-Usage TOTAL</h1>

If anyone can see why this isn't working please let me know... Any suggestion would be great!

Thanks in Advance,
Matt

jlinkels 11-11-2011 06:51 AM

I can't read the code in the second code window. Most important, the error message is missing. Can you check and repost?

jlinkels

mrm5102 11-11-2011 08:15 AM

jlinkels, thanks for the reply.

That's weird I can see it, hummm.....

Ok here's the cfg file that was in that second "code" window:
_________________________________________________________________________________________________
Target[Memory-use]: 1.3.6.1.4.1.9.9.48.1.1.1.5.1&1.3.6.1.4.1.9.9.48.1.1.1.5.1:commName@192.168.1.1
Title[Memory-use]: Memory-Usage USED on 192.168.1.1
LegendI[Memory-use]: Used
Legend1[Memory-use]: Total-RAM
MaxBytes[Memory-use]: 536870912
UnScaled[Memory-use]: ymwd
YLegend[Memory-use]: Total Ram
ShortLegend[Memory-use]: bytes
routers.cgi*Options[Memory-use]: gauge, growright, nototal, noo
routers.cgi*GraphStyle[Memory-use]: stack
PageTop[Memory-use]: <h1>192.168.1.1 Memory-Usage TOTAL</h1>
_________________________________________________________________________________________________

Not sure what error message you mean. But as far as I know I don't get any errors. If I run "mrtg check" I get back "Configs OK. No Errors Found..."


Thanks,
Matt

jlinkels 11-11-2011 08:45 AM

I expected to see some SNMP related error message.

I am familiar with SNMP, not so much with MRTG. But I see you ask for the same OID twice:
1.3.6.1.4.1.9.9.48.1.1.1.5.1&1.3.6.1.4.1.9.9.48.1.1.1.5.1 while I somehow expect that you ask for both used and total memory, like in your snmp example. 1.3.6.1.4.1.9.9.48.1.1.1.6.1

Maybe MRTG keeps on waiting indefinitely on one of those values?

If not, sorry I am out.

jlinkels

mrm5102 11-11-2011 03:29 PM

Sorry it's there twice because MRTG has to take a minimum of 2 OIDs, basically one for IN and one for OUT (doesn't have to be exactly In/Out). So when you want just one value you enter it twice then suppress the output of the Out variable.

But don't worry about this I'll figure it out eventually.

Thanks for your replies.


Thanks,
Matt


All times are GMT -5. The time now is 12:52 AM.