[mrtg] MRTG with extend command in Net-SNMP

Steve Shipway s.shipway at auckland.ac.nz
Sat Sep 4 22:59:23 CEST 2010


I think you are misunderstanding how to specify an MRTG Target.

The backticks `xxx` are used to specify an external program (data collection plugin) to run which will output the values to graph.

However, the format of your Target seems to indicate that you are attempting to specify an OID this way.

Read the MRTG manaual on the format of the Target specifier --  oid&oid:community at device .  You can use symbolic names for an OID if you have previously loaded the MIB -- you can't specify the MIB with the :: notation in the Target line.  Also, MRTG does not support the ."xxx" suffic for identifying table members, you have to use numeric syntax (I know this can cause problems with dynamic tables as produced by net-snmp; you can get around this by writing a data collection plugin to do it, see the check_ucd data collection plugin which will get data via SNMP from a net-snmp module.

Steve

Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
Ph: +64 9 373 7599 ext 86487

________________________________
From: mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch [mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] on behalf of Shu Hung (Koala) [koalay at gmail.com]
Sent: Saturday, 4 September 2010 5:24 a.m.
To: mrtg at lists.oetiker.ch
Subject: [mrtg] MRTG with extend command in Net-SNMP

Hello,

I'm trying to make a custom SNMP graph with extend command and MRTG
I've manage to get results from snmpwalk. The command and result looks like this:

[user at foobar ~] snmpwalk -v 2c -c public somehost 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"'
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell" = STRING: 1
2
custom 1
custom 2

I then try to get these figures with MRTG. My config looks like this:

Target[testshell]: `NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"`:public at somehost:::::2
Title[testshell]: Test Shell
MaxBytes[testshell]: 5
PageTop[testshell]: <H1>Test Shell</H1>
YLegend[testshell]: Test Shell
ShortLegend[testshell]: &nbsp;
Options[testshell]: nopercent, gauge

Then when I run MRTG, the following error appears:

sh: NET-SNMP-EXTEND-MIB::nsExtendOutputFull.testshell: command not found
2010-09-04 01:17:21: WARNING: Could not get any data from external command 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"'
Maybe the external command did not even start. (Illegal seek)

2010-09-04 01:17:21: WARNING: Problem with External get 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"':
   Expected a Number for 'in' but nothing'

2010-09-04 01:17:21: WARNING: Problem with External get 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"':
   Expected a Number for 'out' but nothing'

2010-09-04 01:17:21: ERROR: Target[testshell][_IN_] ' $target->[5]{$mode} :public at somehost:::::2' (eval): syntax error at (eval 23) line 1, near "} :"

2010-09-04 01:17:21: ERROR: Target[testshell][_OUT_] ' $target->[5]{$mode} :public at somehost:::::2' (eval): syntax error at (eval 24) line 1, near "} :"


What could be the problem? Any suggestion?

Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20100904/f7c2fb29/attachment-0001.htm 


More information about the mrtg mailing list