Page 1 of 1

[Solved] MRTG for CPU monitoring v4only error

Posted: Thu Apr 03, 2014 11:12 am
by jbruyet
Hey all, I'm trying to get MRTG configured to monitor some server resources. I've configured a .cfg file for CPUs on one server but I'm getting the following error message when I run the file:

Code: Select all

root@FreeNag:/usr/home/jobee/Config # /usr/local/bin/mrtg /usr/home/jobee/Config/mrtg_1.1.1.1.cfg
Argument "v4only" isn't numeric in int at /usr/local/lib/perl5/site_perl/5.12.4/SNMP_Session.pm line 197.
backoff (v4only) must be a number >= 1.0 at /usr/local/lib/perl5/site_perl/5.12.4/SNMP_util.pm line 467
root@FreeNag:/usr/home/jobee/Config #
I've looked at those lines and I don't see where I should enter a number (I'm not a Perl guy so maybe it's me):

Line 197= croak ("backoff ($backoff) must be a number >= 1.0")
Line 467= $SNMP_util::Session->set_backoff($backoff)

I'm following the file creation instructions from here: http://www.sans.edu/student-files/prese ... _notes.pdf

Googling this error brings up a "did not match any documents" message. I've searched here on the Nagios site and I can't find anything here either.

I even added an "EnableIPv4: yes" line but that's throwing up its own error. Any ideas? Suggestions? Recommendations?

Thanks,

Joe B

Re: MRTG for CPU monitoring v4only error

Posted: Thu Apr 03, 2014 2:29 pm
by sreinhardt
Could you post /usr/home/jobee/Config/mrtg_1.1.1.1.cfg so that we may have a look?

Re: MRTG for CPU monitoring v4only error

Posted: Fri Apr 04, 2014 1:10 pm
by jbruyet
Here's my config file:

Code: Select all

# Created by Jobee 1 Kenobi
# 4/2/14

EnableIPv6: no
WorkDir: /usr/home/jobee/MRTG
# Options[_]: bits,growright

Target[cpuDictum2]:HOST-RESOURCES-MIB::hrProcessorLoad.2&HOST-RESOURCES-MIB::hrProcessorLoad.3:[email protected]
MaxBytes[cpuDictum2]: 100
Options[cpuDictum2]: growright, gauge, nopercent
YLegend[cpuDictum2]: Dictum2 CPU Usage
ShortLegend[cpuDictum2]: %
Legend1[cpuDictum2]: CPU 2 Utilization
Legend2[cpuDictum2]: CPU 3 Utilization
Legend3[cpuDictum2]:
Legend4[cpuDictum2]:
LegendI[cpuDictum2]: CPU 2
LegendO[cpuDictum2]: CPU 3
Title[cpuDictum2]: Dictum2 CPU Utilization
PageTop[cpuDictum2]: <H1>Dictum2 CPU Utilization</H1>

Target[cpu2Dictum2]:HOST-RESOURCES-MIB::hrProcessorLoad.4&HOST-RESOURCES-MIB::hrProcessorLoad.5:[email protected]
MaxBytes[cpu2Dictum2]: 100
Options[cpu2Dictum2]: growright, gauge, nopercent
YLegend[cpu2Dictum2]: Dictum2 CPU Usage
ShortLegend[cpu2Dictum2]: %
Legend1[cpu2Dictum2]: CPU 4 Utilization
Legend2[cpu2Dictum2]: CPU 5 Utilization
Legend3[cpu2Dictum2]:
Legend4[cpu2Dictum2]:
LegendI[cpu2Dictum2]: CPU 4
LegendO[cpu2Dictum2]: CPU 5
Title[cpu2Dictum2]: Dictum2 CPU Utilization
PageTop[cpu2Dictum2]: <H1>Dictum2 CPU Utilization</H1>
Thanks,

Joe B

Re: MRTG for CPU monitoring v4only error

Posted: Fri Apr 04, 2014 2:09 pm
by sreinhardt
I believe the error here, is that you need to use numeric oids instead of shortnames. So where you have:

Code: Select all

HOST-RESOURCES-MIB::hrProcessorLoad.4
HOST-RESOURCES-MIB::hrProcessorLoad.5
You should change them to the numeric oids, which I don't happen to have off hand.

Re: MRTG for CPU monitoring v4only error

Posted: Fri Apr 04, 2014 3:58 pm
by jbruyet
Thanks! I'll give it a shot and let you know how it works out.

Thanks,

Joe B

Re: MRTG for CPU monitoring v4only error

Posted: Fri Apr 04, 2014 5:59 pm
by jbruyet
Thank you sreinhardt! Using the numeric OIDs did the trick! I couldn't find any way to convert my original OIDs to numeric OIDs so I ran the following command: snmpwalk -v 2c -On -c public 1.1.1.1 > Server.txt (notice the -On) and then grep'ed COM1 as a landmark and counted down to my ProcessorLoad OIDs. Is there a program or a utility that will convert my OIDs to numeric OIDs and save me some time?

Again, thank you,

Joe B

Re: [Solved] MRTG for CPU monitoring v4only error

Posted: Mon Apr 07, 2014 10:07 am
by abrist
jbruyet wrote: Is there a program or a utility that will convert my OIDs to numeric OIDs and save me some time?
My suggestion would be to do one of the following:
1) Use google. Just search for the mib name and you should find a few website wit hthe numeric oid mentioned.
2) Use a mib browser.
3) Check your device vendor's mib documentation for the device.