# $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 Unix # # how to present UNIX load 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(@overview); # maps to render "in list context" our($rrdcrit); # R.E. criteria to match an RRD we'll render our($version); # a version string from our conf mgmt sys $version = '$Id: unix.cvu,v 1.2 2008/12/09 15:51:48 ksb Exp $'; # data sources: # "dsname" => [line color, area color, descr, build string, update letter] # colors default to "000000" if undef %ds = ( 'sysload' => ["669966", undef, "sysload", "GAUGE:300:0:U", 'l'], 'cpu_user' => ["6666cc", undef, "CPU user", "COUNTER:300:0:U", 'u', '@,UN,0,@,IF'], 'cpu_nice' => ["339933", undef, "CPU nice", "COUNTER:300:0:U", 'n', '@,UN,0,@,IF'], 'cpu_sys' => ["cccc66", undef, "CPU sys", "COUNTER:300:0:U", 's', '@,UN,0,@,IF'], 'cpu_wait' => ["990000", undef, "CPU wait", "COUNTER:300:0:U", 'w', '@,UN,0,@,IF'], 'cpu_int' => ["cc6666", undef, "CPU interupt", "COUNTER:300:0:U", 'r', '@,UN,0,@,IF'], 'cpu_idle' => ["008000", undef, "CPU idle", "COUNTER:300:0:U", 'i', '@,UN,0,@,IF'], 'pagein' => ["669966", undef, "pagein", "COUNTER:300:0:U", 'I'], 'pageout' => ["666699", undef, "pageout", "COUNTER:300:0:U", 'O'], 'intr' => ["66cc55", undef, "intr", "COUNTER:300:0:U", 'R'], 'scall' => ["cc6666", undef, "scall", "COUNTER:300:0:U", 'S'], 'cswitch' => ["6666cc", undef, "cswitch", "COUNTER:300:0:U", 'C'], 'fork' => ["669966", undef, "fork", "COUNTER:300:0:U", 'F'], ); # 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 = ( 'cpu_consume' => ["cpu_user,cpu_nice,+,cpu_sys,+,cpu_wait,+,cpu_int,+,cpu_idle,+,100,/", '000000', undef, "CPU total"], 'per_user' => ["cpu_user,cpu_consume,/", "6666cc", undef, "percent user"], 'per_nice' => ["cpu_nice,cpu_consume,/", "339933", undef, "percent nice"], 'per_sys' => ["cpu_sys,cpu_consume,/", "cccc66", undef, "percent sys"], 'per_wait' => ["cpu_wait,cpu_consume,/", "990000", undef, "percent wait"], 'per_int' => ["cpu_int,cpu_consume,/", "cc6666", undef, "percent interupt"], 'per_idle' => ["cpu_idle,cpu_consume,/", "008000", undef, "percent idle"], ); # 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 = ( 'load' => ["sysload:LINE2", '--', "--upper-limit", "2", "--vertical-label", "load average"], 'misc' => ["intr:LINE2", "scall:LINE2", "cswitch:LINE2", '--', "--vertical-label", "events/second"], 'forks' => ["fork:LINE2", '--', "--vertical-label", "forks/second"], 'vm' => ["pagein:AREA", "pageout:STACK", '--', "--vertical-label", "events/second"], 'cpu' => ["per_nice:AREA", "per_user:STACK", "per_sys:STACK", "per_wait:STACK", "per_int:STACK", '--', "--vertical-label", "percent CPU usage", "--lower-limit", "0", "--upper-limit", "100"], 'rawcpu' => ["cpu_nice:AREA", "cpu_user:STACK", "cpu_sys:STACK", "cpu_wait:STACK", "cpu_int:STACK", '--', "--vertical-label", "raw CPU usage"], ); # default map, must be defined in %maps above $defmap = 'cpu'; @overview = ('load', 'cpu'); @detailmaps = ('load', 'cpu', 'misc', 'vm', 'forks'); # RRA definitions: # RRD retention parameters (used by /opt/peg/bin/rrds) @rra = ( "RRA:AVERAGE:0.5:1:4320", "RRA:AVERAGE:0.5:4:4320", "RRA:AVERAGE:0.5:24:6652", ); # 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 = "/(unix.*)\.rrd\$"; # success 1;