# $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 a network port # # 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 = '$FedEx$'; # data sources: # 'dsname' => [line color, area color, descr, build string, update letter] # colors default to '000000' if undef %ds = ( 'iucast' => ['33cc33', undef, 'in unicast', 'COUNTER:300:0:1073741825', 'i'], 'oucast' => ['3333cc', undef, 'out unicast', 'COUNTER:300:0:1073741825', 'o'], 'inucast' => ['33ff99', undef, 'in non-unicast', 'COUNTER:300:0:1073741825', 'I'], 'onucast' => ['3399ff', undef, 'out non-unicast', 'COUNTER:300:0:1073741825', 'O'], 'ibyte' => ['33ff33', undef, 'byte receive', 'COUNTER:300:0:1073741825', 'r'], 'obyte' => ['3333ff', undef, 'byte sent', 'COUNTER:300:0:1073741825', 's'], 'ierr' => ['cc3333', undef, 'input error', 'COUNTER:300:0:1073741825', 'W'], 'oerr' => ['cccc33', undef, 'output error', 'COUNTER:300:0:1073741825', 'Z'], ); # 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' => ['ierr,UN,INF,0,IF', 'f0e8e8', undef, 'No Data'], 'ibits' => ['ibyte,8,*', '33ff33', undef, 'in bits/s'], 'obits' => ['obyte,8,*', '3333ff', undef, 'out bits/s'], 'error' => ['ierr,oerr,+', 'ff0000', undef, 'total error frames'], 'mcast' => ['inucast,onucast,+', '330033', undef, 'total multicast frames'], 'frames' => ['inucast,onucast,+,iucast,+,oucast,+', '000000', undef, 'total frames/s'], 'mpin' => ['iucast,100,*,frames,/', '33ff33', undef, 'in unicast%'], 'mpout' => ['oucast,100,*,frames,/', '3333ff', undef, 'out unicast%'], 'mpnin' => ['inucast,100,*,frames,/', '009999', undef, 'in mcast%'], 'mpnout' => ['onucast,100,*,frames,/', '990099', undef, 'out mcast%'], ); # 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 = ( 'frames' => ['iucast:LINE2', 'oucast:LINE2', 'error:LINE1', 'mcast:LINE1', 'drop:AREA', '--', '--vertical-label', 'frames/s'], 'bits' => ['ibits:LINE2', 'obits:LINE2', 'drop:AREA', '--', '--vertical-label', 'bits/s'], 'multicast' => ['inucast:LINE2', 'onucast:LINE2', 'error:LINE1', 'drop:AREA', '--', '--vertical-label', 'mcast frames/s'], 'bytes' => ['ibyte:LINE2', 'obyte:LINE2', 'drop:AREA', '--', '--vertical-label', 'bytes/s'], 'precent' => ['mpin:AREA', 'mpout:STACK', 'mpnin:STACK', 'mpnout:STACK', 'drop:AREA', '--', '--rigid', '--upper-limit', '100', '--vertical-label', 'frame percentages'], ); # default map, must be defined in %maps, %cdef or %ds above $defmap = 'bits'; @overview = ('bits'); @detailmaps = ('bits', 'frames', 'multicast'); # RRA definitions: # RRD retention parameters (used by /opt/peg/bin/rrds) @rra = ( 'RRA:AVERAGE:0.5:1:12960', 'RRA:AVERAGE:0.5:3:36000', '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 = '/(net)-([^.]+)\.rrd\$'; # success 1;