# $Check: perl -c %f && /opt/peg/bin/rrds -S -c %f /dev/null && echo "sane" # $Compile(*): /opt/peg/bin/rrds -c %f %s # CVU configuration file for pingstats # # how to present different data sources and build the RRD package PEG::CVU; # All our our's so we're in scope for the above package. # The Template.cvu _must_ `our' all the possible attributes, others could # skip them, I suppose. The sub `renew' at the end of this file must be # in sync with the variables defined here. -- ksb our($version); # a version string from our conf mgmt sys our(%ds); # data sources; see below for format our(%cdef); # CDEFs; see below for format our(%maps); # maps; see below for format our($defmap); # default map to render (as a single IMG) our(@overview); # maps to render in "list context" our(@detailmaps); # maps to render for $drilldown/$ask_for_me our(@rra); # RRA parameters our(@init_params); # Default rrdgraph parameter prefix our($rrdcrit); # R.E. criteria to match an RRD we'll render our($timebox); # ref to a function to filter start/end our($content); # content type our renderer emits our($renderer); # render agent path, in local http instance $version = # '$Id: ping.cvu,v 1.1 2009/01/26 20:37:10 ksb Exp $'; # data sources: # 'dsname' => [line color, area color, descr, build string, update letter] # colors default to '000000' if undef %ds = ( 'loss' => ['ff0000', undef, 'dropped packets', 'GAUGE:300:0:U', 'L'], 'time' => ['0000ff', undef, 'time (ms)', 'GAUGE:300:0:U', undef ], 'ttl' => ['00ff00', undef, 'time to live', 'GAUGE:300:0:U', 'c'], ); # CDEFs: # if we can't find a ds in %ds, we look here # 'cdef' => [RPN definition, line color, area color, descr] # colors default to '000000' if undef %cdef = ( 'drop' => ['time,UN,INF,0,IF', 'f0e8e8', undef, 'No Data'], ); # maps: # list of maps we know how to render. after a '--' entry, everything goes # to @graph_params. You can specify a ds or a cdef here. Also any options # from rrdgraph. # 'mapname' => [ds:style, cdef:style,... '--', rrdgraph-params...] %maps = ( 'default' => ['time:LINE2', 'drop:AREA', '--', '--vertical-label', 'ping time (ms)'], 'frames' => ['loss:LINE2', 'drop:AREA', '--', '--vertical-label', 'lost frames'], ); # default map, must be defined in %maps, %cdef or %ds above $defmap = 'default'; @overview = ('default'); @detailmaps = ('default', 'frames', 'ttl'); # RRA definitions: # RRD retention parameters (used by /opt/peg/bin/rrds) @rra = ( '--step', '300', 'RRA:AVERAGE:0.5:1:8928', 'RRA:AVERAGE:0.5:12:8040', 'RRA:AVERAGE:0.5:288:731', ); # Default rrdgraph params for all map, cdef, and ds presentations above. @init_params = ( '--lower-limit', '0', ); # Set an image (or frame) render agent (default /cgi-bin/app-rrds.pl) $renderer = undef; # Set a Content-Type (e.g. image/...|text/plain|text/html|... # that the above emits (else default to an IMG). $content = undef; # R.E search criteria. # $1 is the key to get to this file, # $2 is the unique part of the file. $rrdcrit = '/app-(ping[^-0-9.]+)(.*)\.rrd\$'; # success 1;