Why OID for SNMP works from CMD Line and NOT From cfg?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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..."
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.