<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style id="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body ocsi="0" fPStyle="1">
<div style="FONT-FAMILY: Tahoma; DIRECTION: ltr; COLOR: #000000; FONT-SIZE: 13px">
<div>I think you are misunderstanding how to specify an MRTG Target.</div>
<div> </div>
<div>The backticks `xxx` are used to specify an external program (data collection plugin) to run which will output the values to graph. </div>
<div> </div>
<div>However, the format of your Target seems to indicate that you are attempting to specify an OID this way.</div>
<div> </div>
<div>Read the MRTG manaual on the format of the Target specifier -- oid&oid:community@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.</div>
<div> </div>
<div>Steve</div>
<div><br>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px">
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px"><strong>Steve Shipway</strong></div>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px">University of Auckland ITS</div>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px"><em>UNIX Systems Design Lead</em></div>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px"><a href="mailto:s.shipway@auckland.ac.nz" target="_blank">s.shipway@auckland.ac.nz</a></div>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px">Ph: +64 9 373 7599 ext 86487</div>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px"><em></em> </div></div></div>
<hr tabindex="-1">
<div style="DIRECTION: ltr" id="divRpF901723"><font color="#000000" size="2" face="Tahoma"><b>From:</b> mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch [mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch] on behalf of Shu Hung (Koala) [koalay@gmail.com]<br><b>Sent:</b> Saturday, 4 September 2010 5:24 a.m.<br><b>To:</b> mrtg@lists.oetiker.ch<br><b>Subject:</b> [mrtg] MRTG with extend command in Net-SNMP<br></font><br></div>
<div></div>
<div>
<div>Hello,</div>
<div><br></div>
<div>I'm trying to make a custom SNMP graph with extend command and MRTG</div>
<div>I've manage to get results from snmpwalk. The command and result looks like this:</div>
<div><br></div>
<blockquote style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px">
<div><font face="'courier new', monospace">[user@foobar ~] snmpwalk -v 2c -c public somehost 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"'</font></div>
<div>
<div><font face="'courier new', monospace">NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell" = STRING: 1</font></div>
<div><font face="'courier new', monospace">2</font></div>
<div><font face="'courier new', monospace">custom 1</font></div>
<div><font face="'courier new', monospace">custom 2</font></div></div>
<div><font face="'courier new', monospace"><br></font></div></blockquote>I then try to get these figures with MRTG. My config looks like this:
<div><br></div>
<blockquote style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px" class="webkit-indent-blockquote">
<div>
<div><font class="Apple-style-span" face="'courier new', monospace">Target[testshell]: `NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"`:public@somehost:::::2</font></div></div>
<div>
<div><font class="Apple-style-span" face="'courier new', monospace">Title[testshell]: Test Shell</font></div></div>
<div>
<div><font class="Apple-style-span" face="'courier new', monospace">MaxBytes[testshell]: 5</font></div></div>
<div>
<div><font class="Apple-style-span" face="'courier new', monospace">PageTop[testshell]: <H1>Test Shell</H1></font></div></div>
<div>
<div><font class="Apple-style-span" face="'courier new', monospace">YLegend[testshell]: Test Shell</font></div></div>
<div>
<div><font class="Apple-style-span" face="'courier new', monospace">ShortLegend[testshell]: &nbsp;</font></div></div>
<div>
<div><font class="Apple-style-span" face="'courier new', monospace">Options[testshell]: nopercent, gauge</font></div></div></blockquote>
<div>
<div><br></div></div>
<div>Then when I run MRTG, the following error appears:</div>
<div><br></div>
<blockquote style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 40px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px">
<div>
<div><font face="'courier new', monospace">sh: NET-SNMP-EXTEND-MIB::nsExtendOutputFull.testshell: command not found</font></div></div>
<div>
<div><font face="'courier new', monospace">2010-09-04 01:17:21: WARNING: Could not get any data from external command 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"'</font></div></div>
<div>
<div><font face="'courier new', monospace">Maybe the external command did not even start. (Illegal seek)</font></div></div>
<div>
<div><font face="'courier new', monospace"><br></font></div></div>
<div>
<div><font face="'courier new', monospace">2010-09-04 01:17:21: WARNING: Problem with External get 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"':</font></div></div>
<div>
<div><font face="'courier new', monospace"> Expected a Number for 'in' but nothing'</font></div></div>
<div>
<div><font face="'courier new', monospace"><br></font></div></div>
<div>
<div><font face="'courier new', monospace">2010-09-04 01:17:21: WARNING: Problem with External get 'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"':</font></div></div>
<div>
<div><font face="'courier new', monospace"> Expected a Number for 'out' but nothing'</font></div></div>
<div>
<div><font face="'courier new', monospace"><br></font></div></div>
<div>
<div><font face="'courier new', monospace">2010-09-04 01:17:21: ERROR: Target[testshell][_IN_] ' $target->[5]{$mode} :public@somehost:::::2' (eval): syntax error at (eval 23) line 1, near "} :"</font></div></div>
<div>
<div><font face="'courier new', monospace"><br></font></div></div>
<div>
<div><font face="'courier new', monospace">2010-09-04 01:17:21: ERROR: Target[testshell][_OUT_] ' $target->[5]{$mode} :public@somehost:::::2' (eval): syntax error at (eval 24) line 1, near "} :"</font></div></div></blockquote>
<div><br></div>
<div><br></div>
<div>What could be the problem? Any suggestion?</div>
<div><br></div>
<div>Thanks!</div>
<div><br></div></div></div></body></html>