# $Id: vcs.cvu,v 1.13 2008/03/03 21:54:47 jad Exp $ # $Source: /usr/msrc/usr/local/libexec/vcsstats/RCS/vcs.cvu,v $ # # CVU configuration for vcsstats # # $Check: perl -c %f && /opt/peg/bin/rrds -S -c %f /dev/null && echo "sane" # $Compile(*): /opt/peg/bin/rrds -c %f %s # # how to present different data sources and build the RRD package PEG::CVU; # our so we're in scope for the above package our(@rra); # RRA parameters our(@init_params); # Default rrdgraph parameter prefix 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 our(@detailmaps); # maps to render for $drilldown/$ask_for_me our($rrdcrit); # R.E. criteria to match an RRD we'll render # data sources: # "dsname" => [line color, area color, descr, build string, update letter] # colors default to "000000" if undef %ds = ( "member" => ['000088', undef, "group owner", "GAUGE:3600:0:U", 'm'], "state" => ['000000', undef, "service group state", "GAUGE:3600:0:U", 's'], "onlinetime" => ['33ddaa', undef, "online time", "GAUGE:3600:0:U", 'o'], "resonline" => ['77aadd', undef, "resources online", "GAUGE:3600:0:U", 'r'], "linfo" => ['6060e0', undef, "info messages", "ABSOLUTE:3600:0:U", 'i'], "lnotice" => ['40e050', undef, "notice messages", "ABSOLUTE:3600:0:U", 'n'], "lwarning" => ['e0e010', undef, "warning messages", "ABSOLUTE:3600:0:U", 'w'], "lerror" => ['e05050', undef, "error messages", "ABSOLUTE:3600:0:U", 'e'], ); # 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" => ["member,UN,INF,0,IF", 'f0e8e8', undef, "dropped sample"], "online" => ["state,5,GE,INF,0,IF", 'ffffff', undef, "group online"], "partial" => ["state,2,GE,state,5,LT,EQ,INF,0,IF", 'ffff80', undef, "group partially online"], "faulted" => ["state,1,GE,state,2,LT,EQ,INF,0,IF", 'ff9090', undef, "group faulted"], "ltotal" => ["linfo,lnotice,+,lwarning,+,lerror,+", "606060", undef, "total messages"], ); # 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 = ( 'hosts' => [ "online:AREA", "partial:AREA", "faulted:AREA", "member:LINE3", "drop:AREA", '--', "--upper-limit", "10", "--vertical-label", "host", 'GPRINT:member:LAST: group owner\: %3.0lf (current)', 'GPRINT:member:MAX: group owner\: %3.0lf (max)', 'GPRINT:member:MIN: group owner\: %3.0lf (min)'], 'resources' => ["resonline:AREA", "drop:AREA", '--', "--vertical-label", "resources"], 'messages' => ["lerror:AREA", "lwarning:STACK", "lnotice:STACK", "linfo:STACK", "drop:AREA", '--', "--lower-limit", "0", "--vertical-label", "messages"], 'time' => ["onlinetime:AREA", "drop:AREA", '--', "--vertical-label", "seconds since epoch", 'GPRINT:onlinetime:LAST: online time\: %3.0lf (current)'], ); # default map, must be defined in %maps above $defmap = 'hosts'; @detailmaps = ('hosts', 'resources', 'messages', 'time'); # RRA definitions: # RRD retention parameters (used by /opt/peg/bin/rrds) @rra = ( "--step", "3600", "RRA:AVERAGE:0.5:1:1663", "RRA:AVERAGE:0.5:8:1663", ); # Default rrdgraph params for all map, cdef, and ds presentations above. @init_params = ( # %% "--lower-limit", "0", ); # R.E criteria. $1 is the unique part of the file. $rrdcrit = "^vcs-(.*)\.rrd\$"; # success 1;