<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="MSHTML 8.00.6001.18876">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">I can think of two ways.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">First, the best way requires you to be using MRTG with RRDTool and some frontend (Routers2, mrtg-rrd, 14all, etc).</font></div>
<div dir="ltr"><font size="2" face="tahoma">In this case, you can manually tune the RRD files to have a minimum value of (eg) 1, so zeros are recorded as Unknowns.&nbsp; See the rrdtool documentation on how to use rrdtune to achieve this, but it would be similar
 to:</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">$ rrdtool tune <em>targetname</em>.rrd --minimum ds0:1 --minimum ds1:1</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">and you would need to do this for all the targetnames in question, but only once.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Secondly, you could use either a data collection plugin or a post-processing plugin to convent retrieved zero values to unknowns.&nbsp; This would work for Native-mode MRTG as well as for RRD-mode, but would require a
 small amount of perl coding knowledge in order to write the plugin.</font></div>
<div dir="ltr"><font size="2" face="tahoma">This would require you to first create a file called (eg) conversioncode.pl containing something like this:</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">sub nozeros {</font></div>
<div dir="ltr"><font size="2" face="tahoma">&nbsp; my $value = shift;</font></div>
<div dir="ltr"><font size="2" face="tahoma">&nbsp; return ($value?$value:undef);</font></div>
<div dir="ltr"><font size="2" face="tahoma">}</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">then define the file to MRTG in the .cfg file:</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma"><strong>ConversionCode:</strong> /<em>path</em>/conversioncode.pl</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">and finally use it in your Target definition:</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Target[<em>something</em>]: <em>oid</em>&amp;<em>oid</em>:<em>community</em>@<em>host</em><strong>|nozeros</strong></font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Hope this helps...</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Steve</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div style="DIRECTION: ltr" id="divRpF582972">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>From:</b> mrtg-bounces@lists.oetiker.ch [mrtg-bounces@lists.oetiker.ch] On Behalf Of Ufuk Eskici [ufukeskici@gmail.com]<br>
</font></div>
<div>
<div>&nbsp;</div>
<div>I want to use a function in MRG. I want to discard zero values.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
</div>
</body>
</html>