[mrtg] Can rrd files be tuned for negative numbers at creation?

McDonald, Dan Dan.McDonald at austinenergy.com
Wed Aug 13 00:33:14 CEST 2008


On Wed, 2008-08-13 at 09:57 +1200, Steve Shipway wrote:
> >Glancing through the mrtg reference, there doesn't seem to be any hooks
> >that would allow me to set up the rrdfiles to be tunes properly from the
> >git-go.  Does anyone have a suggestion about how I might add that?
> 
> As far as I know, there is no 'MinBytes[]' directive in MRTG (yet) -
> the minimum always defaults to zero and you have to rrdtune to change
> it.

Bummer.  Guess I've got to write it...  I'll see what I can generate.
It shouldn't be terribly hard.  But I think I'm a version or two
behind...  And then there is the whole "busy" thing....

> 
> >Also, for this particular monitor, percentage is pretty much irrelevant.
> >Is there a routers2.cgi directive that will remove percentages from one
> >particular graph?
> 
> Yes.  See the documentation in doc/MRTG_INFO with the routers2 software.
>     routers.cgi*Options[]: nopercent
> There is also a 'nopercent' option in the standard MRTG options which is supported.
> There are also the routers.cgi*UpperLimit[] and
> routers.cgi*LowerLimit[], and the extended option 'rigid', which might
> be useful when you have a value that extends below zero.

Looks like it works fairly well by itself when I just use options[]:
gauge noi nopercent  It seems to be auto-scaling nicely with my -20.20dB
circuit.

For anyone who wants to try this at home, here is the salient cut from
my host template.  $maxsize is a total hack, and I should probably set
an absmax value of something unreasonable like 250.  I'm tuning the rrds
with -i ds0:-1000 -i ds1:-1000 for receive values, and -i ds0:-50 -i
ds0:-50 for transmit values, but that might change, as I saw one box
transmitting at -10.9, so I would need at least -200 for transmit to be
safe...


snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-SMI-V1SMI.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-TC-V1SMI.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-PROCESS-MIB.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/ENTITY-MIB-V1SMI.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/ENTITY-SENSOR-MIB.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-ENTITY-SENSOR-MIB-V1SMI.my");
my (@est) = snmpwalk($router,$v3opt,'entSensorType');
foreach my $esti (@est) {
        my ($tinstance,$ttype) = ($esti =~  /(\d+):(.+)$/) ;
        next if $ttype != 14;
        my (@estv) = snmpwalk($router, v3opt,
'entSensorThresholdValue.'.$tinstance);
        my %thresh;
        foreach my $estvi (@estv) {
                my ($thin,$value) = ($estvi =~ /(\d+):(.+)$/) ;
                $thresh{$thin} = $value;
        };
        my $maxsize = $thresh{1}+10;
        my ($sens_name) = snmpget($router,$v3opt,
'entPhysicalName.'.$tinstance);
        my $sens_descr .= ' '.$sens_name;
        my $target_name=$router_name.".signal".$tinstance;
        $target_lines .= <<SIGNAL
#--------------------------------------------------------------------------------------
# Signal Strength
    
Target[$target_name]:
entSensorValue.$tinstance&entSensorValue.$tinstance:$router
SnmpOptions[$target_name]: $v3options
YLegend[$target_name]: dB
Options[$target_name]: gauge, noi, nopercent
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: $maxsize
ShortLegend[$target_name]: dB
Factor[$target_name]: .1
routers.cgi*ShortDesc[$target_name]: $sens_name
routers.cgi*Options[$target_name]: nototal
bb*host[$target_name]: $router_name
bb*svc[$target_name]: signal
bb*red[$target_name]: $thresh{4}:$thresh{1}
bb*yellow[$target_name]: $thresh{3}:$thresh{2}
Legend1[$target_name]: dB
WithPeak[$target_name]: ymw
Title[$target_name]: $sysname $sens_descr
PageTop[$target_name]: <H1>$sysname $sens_descr </H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
SIGNAL
;
} 


-- 
Daniel J McDonald, CCIE #2495, CISSP #78281, CNX
Austin Energy
http://www.austinenergy.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.oetiker.ch/pipermail/mrtg/attachments/20080812/6b812369/attachment.bin 


More information about the mrtg mailing list