I can think of two ways.

First, the best way requires you to be using MRTG with RRDTool and some 
frontend (Routers2, mrtg-rrd, 14all, etc).
In this case, you can manually tune the RRD files to have a minimum value of 
(eg) 1, so zeros are recorded as Unknowns.  See the rrdtool documentation on 
how to use rrdtune to achieve this, but it would be similar to:

$ rrdtool tune targetname.rrd --minimum ds0:1 --minimum ds1:1

and you would need to do this for all the targetnames in question, but only 
once.

Secondly, you could use either a data collection plugin or a post-processing 
plugin to convent retrieved zero values to unknowns.  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.
This would require you to first create a file called (eg) conversioncode.pl 
containing something like this:

sub nozeros {
  my $value = shift;
  return ($value?$value:undef);
}

then define the file to MRTG in the .cfg file:

ConversionCode: /path/conversioncode.pl

and finally use it in your Target definition:

Target[something]: oid&oid:commun...@host|nozeros

Hope this helps...

Steve

________________________________
From: [email protected] [[email protected]] On Behalf 
Of Ufuk Eskici [[email protected]]

I want to use a function in MRG. I want to discard zero values.


_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Reply via email to