I tried this configuration in my snmpd.conf<br><br><div style="margin-left: 40px;"><font size="1"><span style="font-family: courier new,monospace;">extend 1.3.6.1.4.1.1.2.3.4.5.6 /usr/local/snmpd-5.5/etc/snmp/scripts/test.sh</span></font><br>
</div><br>After restarting snmpd, I use snmpwalk to test it:<br><br><div style="margin-left: 40px;"><font face="'courier new', monospace">[user@foobar ~] snmpwalk -v 2c
-c public somehost </font><font size="1"><span style="font-family: courier new,monospace;">1.3.6.1.4.1.1.2.3.4.5.6</span></font></div><br>It gives me this error:<br><br><div style="margin-left: 40px;"><font size="1"><span style="font-family: courier new,monospace;">SNMPv2-SMI::enterprises.1.2.3.4.5.6 = No Such Object available on this agent at this OID</span></font><br>
</div><br>I tried to run mrtg right the way. It gives me this error:<br><br><div style="margin-left: 40px;"><font size="1"><span style="font-family: courier new,monospace;">2010-09-17 17:58:01: ERROR: Target[testshell][_IN_] '1.3.6.1.4.1.1.2.3.4.5. $target->[5]{$mode} ' (warn): Use of uninitialized value in concatenation (.) or string at (eval 23) line 1.</span></font><br style="font-family: courier new,monospace;">
<font size="1"><span style="font-family: courier new,monospace;">2010-09-17 17:58:01: ERROR: Target[testshell][_OUT_] '1.3.6.1.4.1.1.2.3.4.5. $target->[5]{$mode} ' (warn): Use of uninitialized value in concatenation (.) or string at (eval 24) line 1.</span></font><br>
</div><br>What should I do?<br><br><br><br>Koala Yeung<br><br><br><br><div class="gmail_quote">On Wed, Sep 8, 2010 at 06:15, Steve Shipway <span dir="ltr"><<a href="mailto:steve@steveshipway.org">steve@steveshipway.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-NZ">
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">You are not allowed to specify an OID to MRTG like this: </span></p>
<p class="MsoNormal"><span style="font-size: 7.5pt; font-family: "Courier New";">NET-SNMP-EXTEND-MIB::nsExtendOutputFull.”testshell”</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">You can use dotted numeric notation:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">1.3.6.1.4.1.1.2.3.4.5.6</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Or symbolic notation (with suffix) if the MIB has been
previously loaded:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: black;">ifInErrors.6</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">However you cannot specify an OID using the ‘<i>MIBNAME</i>::<i>symbolicname</i>
format, and you cannot use the .”textindex” suffix, only a numeric suffix. The
output of snmpwalk is not necessarily compatible with MRTG as it can use these
additional two notation formats.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">The ‘:::::2’ suffix is a collapsed form of the Extended Hostname
Syntax for specifying a Target in MRTG and is separate from the OID
specification.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">See <a href="http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html" target="_blank">http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html</a>
for documentation on the Target syntax, and how you can specify an OID.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Steve</span></p>
<div class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">
<hr align="center" width="100%" size="2">
</span></div>
<p class="MsoNormal"><b><span style="font-size: 11pt; color: rgb(31, 73, 125);">Steve Shipway</span></b></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);"><a href="mailto:steve@steveshipway.org" target="_blank">steve@steveshipway.org</a></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);"><a href="http://www.steveshipway.org/software" target="_blank"><span style="color: blue;">http://www.steveshipway.org/software</span></a></span></p>
<p class="MsoNormal"><span style="font-size: 18pt; font-family: Webdings; color: green;" lang="EN-GB">P</span><span style="font-size: 11pt; color: blue;" lang="EN-GB"> </span><span style="font-size: 10pt; color: green;" lang="EN-GB">Please consider the environment before printing this e-mail</span><span style="font-size: 11pt; color: blue;" lang="EN-GB"> </span><span style="font-size: 7.5pt; color: navy;" lang="EN-GB"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-width: medium medium medium 1.5pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; padding: 0cm 0cm 0cm 4pt;">
<div>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> Shu Hung (Koala) [mailto:<a href="mailto:koalay@gmail.com" target="_blank">koalay@gmail.com</a>] <br>
<b>Sent:</b> Tuesday, 7 September 2010 9:28 p.m.<br>
<b>To:</b> Steve Shipway<br>
<b>Cc:</b> <a href="mailto:mrtg@lists.oetiker.ch" target="_blank">mrtg@lists.oetiker.ch</a><br>
<b>Subject:</b> Re: [mrtg] MRTG with extend command in Net-SNMP</span></p>
</div>
</div><div class="im">
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom: 12pt;">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:</p>
<div style="margin-left: 30pt;">
<p class="MsoNormal"><span style="font-size: 7.5pt; font-family: "Courier New";">NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"</span><span style="font-family: "Courier New";"></span></p>
</div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><br>
And the <span style="font-family: "Courier New";">snmpwalk</span> result seems to
indicate that my script works with snmpd as expected. This is the result:</p>
<div style="margin-left: 30pt;">
<div>
<div>
<p class="MsoNormal"><span style="font-size: 7.5pt; font-family: "Courier New";">NET-SNMP-EXTEND-MIB::nsExtendOutputFull."testshell"
= STRING: 1</span><span style="font-family: "Courier New";"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 7.5pt; font-family: "Courier New";">2</span><span style="font-family: "Courier New";"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 7.5pt; font-family: "Courier New";">custom
1</span><span style="font-family: "Courier New";"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 7.5pt; font-family: "Courier New";">custom
2</span><span style="font-family: "Courier New";"></span></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><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>
<span style="font-size: 10pt; color: black;"></span></p>
<p class="MsoNormal"> </p>
</div></div>
</div>
</div>
</blockquote></div><br>