[Solved] MRTG for CPU monitoring v4only error

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

[Solved] MRTG for CPU monitoring v4only error

Post 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
Last edited by jbruyet on Fri Apr 04, 2014 6:02 pm, edited 1 time in total.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: MRTG for CPU monitoring v4only error

Post by sreinhardt »

Could you post /usr/home/jobee/Config/mrtg_1.1.1.1.cfg so that we may have a look?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: MRTG for CPU monitoring v4only error

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: MRTG for CPU monitoring v4only error

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: MRTG for CPU monitoring v4only error

Post by jbruyet »

Thanks! I'll give it a shot and let you know how it works out.

Thanks,

Joe B
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

Re: MRTG for CPU monitoring v4only error

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [Solved] MRTG for CPU monitoring v4only error

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked