I'm not quite sure I get you.<br><br>As far as I know, the '::::2' suffix is to set the SNMP version number that MRTG would use. It's not a part of OID at all. To my understanding, I'm using this text OID for my script:<br>
<br><div style="margin-left: 40px; font-family: courier new,monospace;"><font size="1">NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"</font></div><br>And the <span style="font-family: courier new,monospace;">snmpwalk</span> result seems to indicate that my script works with snmpd as expected. This is the result:<br>
<font size="1"><br></font><div style="margin-left: 40px; font-family: courier new,monospace;"><div><div><font size="1">NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell" = STRING: 1</font></div><div><font size="1">2</font></div>
<div><font size="1">custom 1</font></div><div><font size="1">custom 2</font></div></div></div><br>How can I plot a graph with MRTG?<br>Or which part did I get wrong?<br><br><br>Koala Yeung<br><br><br><br><div class="gmail_quote">
On Sun, Sep 5, 2010 at 04:59, Steve Shipway <span dir="ltr"><<a href="mailto:s.shipway@auckland.ac.nz">s.shipway@auckland.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<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"><b>Steve Shipway</b></div>
<div style="font-family:Tahoma;font-size:13px">University of Auckland ITS</div>
<div style="font-family:Tahoma;font-size:13px"><i>UNIX Systems Design Lead</i></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"><i></i> </div></div></div>
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> mrtg-bounces+s.shipway=<a href="http://auckland.ac.nz" target="_blank">auckland.ac.nz</a>@<a href="http://lists.oetiker.ch" target="_blank">lists.oetiker.ch</a> [mrtg-bounces+s.shipway=<a href="http://auckland.ac.nz" target="_blank">auckland.ac.nz</a>@<a href="http://lists.oetiker.ch" target="_blank">lists.oetiker.ch</a>] on behalf of Shu Hung (Koala) [<a href="mailto:koalay@gmail.com" target="_blank">koalay@gmail.com</a>]<br>
<b>Sent:</b> Saturday, 4 September 2010 5:24 a.m.<br><b>To:</b> <a href="mailto:mrtg@lists.oetiker.ch" target="_blank">mrtg@lists.oetiker.ch</a><br><b>Subject:</b> [mrtg] MRTG with extend command in Net-SNMP<br></font><br>
</div><div><div></div><div class="h5">
<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">
<div>
<div><font face="'courier new', monospace">Target[testshell]: `NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"`:public@somehost:::::2</font></div></div>
<div>
<div><font face="'courier new', monospace">Title[testshell]: Test Shell</font></div></div>
<div>
<div><font face="'courier new', monospace">MaxBytes[testshell]: 5</font></div></div>
<div>
<div><font face="'courier new', monospace">PageTop[testshell]: <H1>Test Shell</H1></font></div></div>
<div>
<div><font face="'courier new', monospace">YLegend[testshell]: Test Shell</font></div></div>
<div>
<div><font face="'courier new', monospace">ShortLegend[testshell]: &nbsp;</font></div></div>
<div>
<div><font 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></div></div></div>
</blockquote></div><br>