[mrtg] Could not get any data from external command

Steve Shipway s.shipway at auckland.ac.nz
Wed Aug 4 01:24:53 CEST 2010

> options[] : unknaszero .... does not work, as the output is -1, not unknown.
> I want the output as 0 instead of 1.

You can set the minimum and maximum values in the RRD file; by default, the valid range minimum is 0 and so a returned value of -1 would be stored as unknown.  Native-mode MRTG always have the minimum valid value set as 0.  Setting unknaszero would display unknowns as zero, rather than the MRTG-native default of whatever the previous value was (the routers2 frontend acts differently; unknowns are displayed as grey bars)

Other options for you would be using post-processing code to modify the value although this is probably more trouble than its worth.  You don't need to modify the MRTG code to do this, use the ConversionCode directive (see the MRTG manual for details).

You should also strongly consider upgrading your MRTG to 2.16.4 (the latest version) as there have been a number of bug fixes and enhancements since v2.9


More information about the mrtg mailing list