<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-GB link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Three ways to do the same thing, with 3
solutions! (1) is if the problem is the string conversion, (2) is for if
the problem is the MIB symbolic name, and (3) is if the problem is it not being
an integer. To be honest though I think (2) or possible (2)+(3) is the
way to go, but I had to include (1) as it is so pretty </span></font><font
size=2 color=navy face=Wingdings><span style='font-size:10.0pt;font-family:
Wingdings;color:navy'>J</span></font><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>1. Your device is outputting the laLoad
variable as a string rather than as an integer. You may need to set up a
Conversion Code definition with the fromstring() function to convert it to a
real number.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>In the cfg file, put a line:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Courier New"><span
style='font-size:12.0pt;font-family:"Courier New";color:black'>ConversionCode:
/usr/local/<st1:PersonName w:st="on">mrtg</st1:PersonName>/etc/conversoincode.pl<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>(you might need to put a different path
for your script, of course). Then, in the conversioncode.pl file, put the
text:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Courier New"><span
style='font-size:12.0pt;font-family:"Courier New";color:black'>sub fromstring()
{my $v = shift; if($v =~ /(\d+\.?\d*)/) { return $1; } else { return 0; } }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Finally, your Target definition should add
‘|fromstring’<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Courier New"><span
style='font-size:12.0pt;font-family:"Courier New";color:black'>Target[server.wherever_load]:
laLoad.3&laLoad.3:public@server.wherever|fromstring<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Having said all of this, though, I would
have expected Perl to Do The Right Thing when confronted with a string
containing just a number. I don’t see why this bit should be
necessary.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>2. Another possibility is that MRTG simply
doesn’t know about the symbolic laLoad name whereas snmpwalk does.
In this case you’ll need ot tell MRTG about the MIB.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Courier New"><span
style='font-size:12.0pt;font-family:"Courier New";color:black'>LoadMIBs:
/usr/share/snmp/mibs/UCD-SNMP-MIB.txt<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>3. A third possibility is to try using
laLoadInt instead. This is definitely a number, but multipled by
100. You need to divide it in the Target definition:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 color=black face="Courier New"><span
style='font-size:12.0pt;font-family:"Courier New";color:black'>Target[server.wherever_load]:
laLoadInt.3&laLoadInt.3:public@server.wherever / 100<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Note that the spaces are significant in
this definition. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Steve<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
<st1:PersonName w:st="on">mrtg</st1:PersonName>-bounces@lists.oetiker.ch
[mailto:<st1:PersonName w:st="on">mrtg</st1:PersonName>-bounces@lists.oetiker.ch]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Matt Baer<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, 28 September 2009
6:21 a.m.<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">mrtg</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [<st1:PersonName
w:st="on">mrtg</st1:PersonName>] Monitoring Load</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 color=black face=Arial><span style='font-size:
12.0pt;font-family:Arial;color:black'>Direct copy and paste output of that
command:<br>
<br>
UCD-SNMP-MIB::laIndex.1 = INTEGER: 1<br>
UCD-SNMP-MIB::laIndex.2 = INTEGER: 2<br>
UCD-SNMP-MIB::laIndex.3 = INTEGER: 3<br>
UCD-SNMP-MIB::laNames.1 = STRING: Load-1<br>
UCD-SNMP-MIB::laNames.2 = STRING: Load-5<br>
UCD-SNMP-MIB::laNames.3 = STRING: Load-15<br>
UCD-SNMP-MIB::laLoad.1 = STRING: 0.57<br>
UCD-SNMP-MIB::laLoad.2 = STRING: 0.42<br>
UCD-SNMP-MIB::laLoad.3 = STRING: 0.36<br>
UCD-SNMP-MIB::laConfig.1 = STRING: 12.00<br>
UCD-SNMP-MIB::laConfig.2 = STRING: 12.00<br>
UCD-SNMP-MIB::laConfig.3 = STRING: 12.00<br>
UCD-SNMP-MIB::laLoadInt.1 = INTEGER: 56<br>
UCD-SNMP-MIB::laLoadInt.2 = INTEGER: 41<br>
UCD-SNMP-MIB::laLoadInt.3 = INTEGER: 35<br>
UCD-SNMP-MIB::laLoadFloat.1 = Opaque: Float: 0.570000<br>
UCD-SNMP-MIB::laLoadFloat.2 = Opaque: Float: 0.420000<br>
UCD-SNMP-MIB::laLoadFloat.3 = Opaque: Float: 0.360000<br>
UCD-SNMP-MIB::laErrorFlag.1 = INTEGER: noError(0)<br>
UCD-SNMP-MIB::laErrorFlag.2 = INTEGER: noError(0)<br>
UCD-SNMP-MIB::laErrorFlag.3 = INTEGER: noError(0)<br>
UCD-SNMP-MIB::laErrMessage.1 = STRING: <br>
UCD-SNMP-MIB::laErrMessage.2 = STRING: <br>
UCD-SNMP-MIB::laErrMessage.3 = STRING:<br>
<br>
<br>
<o:p></o:p></span></font></p>
</div>
</div>
</div>
</body>
</html>