# $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 namedstats # # how to present named stats 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: named.cvu,v 1.7 2008/10/06 18:23:04 ksb Exp $'; # data sources: # 'dsname' => [line color, area color, descr, build string, update letter] # colors default to '000000' if undef %ds = ( 'success' => ['00ff00', undef, 'successful', 'COUNTER:300:0:U', 's'], 'referral' => ['3333cc', undef, 'referral', 'COUNTER:300:0:U', 'r'], 'recursion' => ['990099', undef, 'recursive', 'COUNTER:300:0:U', 'c'], 'nxrrset' => ['ffcc66', undef, 'no such resource', 'COUNTER:300:0:U', 'n'], 'nxdomain' => ['ff66cc', undef, 'no such domain', 'COUNTER:300:0:U', 'd'], 'failure' => ['ff0000', undef, 'otherwise unsuccessful', 'COUNTER:300:0:U', 'f'], # these are not always sent from every named, I don't know why. 'duplicate' => ['cc00ff', undef, 'duplicate request', 'COUNTER:300:0:U', 'u'], 'dropped' => ['333333', undef, 'black-holed', 'COUNTER:300:0:U', 'l'], ); # 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 = ( 'doom1' => ['duplicate,UN,0,duplicate,IF', '000000', undef, '[duplicate]'], 'doom2' => ['dropped,UN,0,dropped,IF', '000000', undef, '[dropped]'], 'all' => ['hate,allsuccess,+', 'FFCC99', undef, 'all requests'], 'drop' => ['success,UN,INF,0,IF', 'f0e8e8', undef, 'No Data'], 'hate' => ['nxrrset,nxdomain,+,failure,+,doom1,+,doom2,+', '993333', undef, 'unsuccessful'], 'allsuccess' => ['success,referral,+,recursion,+,doom2,+', '339933', undef, 'successful'], ); # 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 = ( 'splash' => ['all:AREA', 'hate:LINE1', 'allsuccess:LINE2', 'drop:AREA', '--', '--vertical-label', 'queries per second'], 'happy' => ['success:AREA', 'referral:STACK', 'recursion:STACK', 'drop:AREA', '--', '--vertical-label', 'successful per second'], 'sad' => ['nxdomain:AREA', 'nxrrset:STACK', 'failure:STACK', 'doom1:STACK', 'doom2:STACK', 'drop:AREA', '--', '--vertical-label', 'unsuccessful per second'], 'all' => [ 'nxdomain:AREA', 'nxrrset:STACK', 'failure:STACK', 'doom1:STACK', 'doom2:STACK','success:STACK', 'referral:STACK', 'recursion:STACK', 'drop:AREA', '--', '--vertical-label', 'queries per second'], ); # default map, must be defined in %maps, %cdef or %ds above $defmap = 'splash'; @detailmaps = ('all', 'happy', 'sad'); # 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-(named)(.*)\.rrd\$'; # success 1;