# $Id: memory.cvu,v 1.2 2008/11/04 19:46:47 anderson Exp $ # $Source: /usr/msrc/usr/local/libexec/memstats/RCS/memory.cvu,v $ # $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 %% name of application %% # # 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 $version = # %% your version infomation here %% '$FedEx: web/peg/lib/cvu/Template.cvu,v 1.10 2004/11/01 14:58:15 ksb Exp $'; # data sources: # 'dsname' => [line color, area color, descr, build string, update letter] # colors default to '000000' if undef %ds = ( 'mem_total' => ['000000', undef, 'RAM', 'GAUGE:300:0:U', 'a'], 'mem_used' => ['0000ff', undef, 'Used', 'GAUGE:300:0:U', 'b'], 'mem_free' => ['c8c8c8', 'e8e8e8', 'Free', 'GAUGE:300:0:U', 'c'], 'mem_shared' => ['994488', undef, 'Shared', 'GAUGE:300:0:U', 'd'], 'mem_buffer' => ['339933', '339933', 'Buffered', 'GAUGE:300:0:U', 'e'], 'mem_cache' => ['336633', '336633', 'Cached', 'GAUGE:300:0:U', 'f'], 'prog_used' => ['ffaa00', 'ffaa00', 'Mem Used', 'GAUGE:300:0:U', 'g'], 'prog_free' => ['00ffff', undef, 'Mem Free', 'GAUGE:300:0:U', 'h'], 'swap_total' => ['0000ff', undef, 'Swap Total', 'GAUGE:300:0:U', 'i'], 'swap_used' => ['0066ff', undef, 'Swap Used', 'GAUGE:300:0:U', 'j'], 'swap_free' => ['00aaff', undef, 'Swap Free', 'GAUGE:300:0:U', 'k'], ); # 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 = ( 'vm_used' => ['prog_used,swap_used,+', 'f0e8e8', undef, 'Virt Mem Used'], 'vm_total' => ['mem_total,swap_total,+', '888888', 'e8e8e8', 'Virt Mem Total'], ); # 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 = ( 'mem-summary' => [ 'prog_used:AREA', 'swap_used:LINE1', 'mem_total:LINE1', '--', '--vertical-label', 'Memory Summary', ], 'mem-detail' => [ 'prog_used:AREA', 'mem_cache:STACK', 'mem_buffer:STACK', 'mem_shared:LINE1', 'mem_total:LINE1', '--', '--vertical-label', 'Physical Memory Usage' ], 'vmem-detail' => [ 'prog_used:AREA', 'swap_used:STACK', 'mem_total:LINE2', '--', '--vertical-label', 'VM Memory Usage', ], ); # default map, must be defined in %maps, %cdef or %ds above $defmap = 'mem-detail'; # %% replace this with a map|CDEF|DS %% @overview = ('mem-summary'); # %% optional list %% @detailmaps = ('mem-summary','mem-detail','vmem-detail'); # %% replace these %% # RRA definitions: # RRD retention parameters (used by /opt/peg/bin/rrds) @rra = ( # '--step', '300', %% uncomment an set step, or delete line %% 'RRA:AVERAGE:0.5:1:8928', # %% adjust RRA params, or not %% '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', ); # R.E criteria. $1 is the unique part of the file. $rrdcrit = "/app-(memory.*)\.rrd\$"; # success 1;