Hi, [resent email without screenshots/images]
As I emailed yesterday, I modified the reports to display "Cacti style" statistics on the RRD graphs, i.e.: "Now: nn Avg: nn Min: nn Max: nn". The behaviour is now configurable through conf.php by setting the value "$graphreport_stats = true", as I can imagine not everyone is interested in these values. If you set it to "false", the graphs default back to the normal/previous layout. It automatically resizes the Font size and text alignment depending on the graph size small/medium/large. See attachment for the patch, which was created against the current trunk. Unfortunately I was unable to attach images of what the end result now looks like, because the ganglia-developers list has a message size limit of 40 KB. You can see here what the graphs look like with this enabled: * http://ganglia.sara.nl/?c=LISA%20Cluster I hope you guys will find it useful, I could modify the patch if you would like to see it differently. Kind regards, - Ramon. -- R. Bastiaans, B.ICT :: Systems Programmer, HPC&V SARA - Computing & Networking Services Science Park 121 PO Box 94613 1098 XG Amsterdam NL 1090 GP Amsterdam NL P.+31 (0)20 592 3000 F.+31 (0)20 668 3167
diff -ur ganglia-trunk/monitor-core/web/conf.php.in ganglia-trunk.new/monitor-core/web/conf.php.in
--- ganglia-trunk/monitor-core/web/conf.php.in 2009-10-01 17:10:06.381961658 +0200
+++ ganglia-trunk.new/monitor-core/web/conf.php.in 2009-10-02 11:38:59.499191594 +0200
@@ -40,6 +40,9 @@
# Location for modular-graph files.
$graphdir='./graph.d';
+# Display statistics on graphs; i.e.: average, min, max
+$graphreport_stats = true;
+
#
# If you want to grab data from a different ganglia source specify it here.
# Although, it would be strange to alter the IP since the Round-Robin
diff -ur ganglia-trunk/monitor-core/web/graph.d/cpu_report.php ganglia-trunk.new/monitor-core/web/graph.d/cpu_report.php
--- ganglia-trunk/monitor-core/web/graph.d/cpu_report.php 2009-10-01 17:10:06.050044623 +0200
+++ ganglia-trunk.new/monitor-core/web/graph.d/cpu_report.php 2009-10-02 11:39:18.638252410 +0200
@@ -1,8 +1,8 @@
<?php
/* Pass in by reference! */
-function graph_cpu_report ( &$rrdtool_graph ) {
-
+function graph_cpu_report( &$rrdtool_graph )
+{
global $context,
$cpu_idle_color,
$cpu_nice_color,
@@ -13,17 +13,22 @@
$range,
$rrd_dir,
$size,
- $strip_domainname;
+ $strip_domainname,
+ $graphreport_stats;
- if ($strip_domainname) {
+ if ($strip_domainname)
+ {
$hostname = strip_domainname($hostname);
}
- $rrdtool_graph['height'] += ($size != 'small') ? 14 : 0;
+ $rrdtool_graph['height'] += ($size == 'medium') ? 14 : 0;
$title = 'CPU';
- if ($context != 'host') {
+ if ($context != 'host')
+ {
$rrdtool_graph['title'] = $title;
- } else {
+ }
+ else
+ {
$rrdtool_graph['title'] = "$hostname $title last $range";
}
$rrdtool_graph['upper-limit'] = '100';
@@ -31,68 +36,100 @@
$rrdtool_graph['vertical-label'] = 'Percent';
$rrdtool_graph['extras'] = '--rigid';
- $fmt = '%5.1lf';
+ $series = '';
- if($context != "host") {
+ if ($size == 'medium')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
+ }
+ else if ($size == 'large')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
+ }
- /*
- * If we are not in a host context, then we need to calculate
- * the average
- */
- $series =
- "'DEF:num_nodes=${rrd_dir}/cpu_user.rrd:num:AVERAGE' "
- . "'DEF:cpu_user=${rrd_dir}/cpu_user.rrd:sum:AVERAGE' "
- . "'CDEF:ccpu_user=cpu_user,num_nodes,/,0,110,LIMIT' "
- . "'DEF:cpu_nice=${rrd_dir}/cpu_nice.rrd:sum:AVERAGE' "
- . "'CDEF:ccpu_nice=cpu_nice,num_nodes,/,0,110,LIMIT' "
- . "'DEF:cpu_system=${rrd_dir}/cpu_system.rrd:sum:AVERAGE' "
- . "'CDEF:ccpu_system=cpu_system,num_nodes,/,0,110,LIMIT' "
- . "'DEF:cpu_idle=${rrd_dir}/cpu_idle.rrd:sum:AVERAGE' "
- . "'CDEF:ccpu_idle=cpu_idle,num_nodes,/,0,110,LIMIT' "
- . "'AREA:ccpu_user#$cpu_user_color:User' "
- . "'GPRINT:ccpu_user:AVERAGE:$fmt%%' "
- . "'STACK:ccpu_nice#$cpu_nice_color:Nice' "
- . "'GPRINT:ccpu_nice:AVERAGE:$fmt%%' "
- . "'STACK:ccpu_system#$cpu_system_color:System' "
- . "'GPRINT:ccpu_system:AVERAGE:$fmt%%\\l' ";
-
- if (file_exists("$rrd_dir/cpu_wio.rrd")) {
- $series .= "'DEF:cpu_wio=${rrd_dir}/cpu_wio.rrd:sum:AVERAGE' "
- . "'CDEF:ccpu_wio=cpu_wio,num_nodes,/,0,110,LIMIT' "
- . "'STACK:ccpu_wio#$cpu_wio_color:Wait' "
- . "'GPRINT:ccpu_wio:AVERAGE:$fmt%%' ";
+ if($context != "host" )
+ {
+ $series .= "DEF:'num_nodes'='${rrd_dir}/cpu_user.rrd':'num':AVERAGE ";
+ }
+ $series .= "DEF:'cpu_user'='${rrd_dir}/cpu_user.rrd':'sum':AVERAGE "
+ . "DEF:'cpu_nice'='${rrd_dir}/cpu_nice.rrd':'sum':AVERAGE "
+ . "DEF:'cpu_system'='${rrd_dir}/cpu_system.rrd':'sum':AVERAGE "
+ . "DEF:'cpu_idle'='${rrd_dir}/cpu_idle.rrd':'sum':AVERAGE ";
+
+ if (file_exists("$rrd_dir/cpu_wio.rrd"))
+ {
+ $series .= "DEF:'cpu_wio'='${rrd_dir}/cpu_wio.rrd':'sum':AVERAGE ";
+ }
+
+ if($context != "host" )
+ {
+ $series .= "CDEF:'ccpu_user'=cpu_user,num_nodes,/ "
+ . "CDEF:'ccpu_nice'=cpu_nice,num_nodes,/ "
+ . "CDEF:'ccpu_system'=cpu_system,num_nodes,/ "
+ . "CDEF:'ccpu_idle'=cpu_idle,num_nodes,/ ";
+
+ if (file_exists("$rrd_dir/cpu_wio.rrd"))
+ {
+ $series .= "CDEF:'ccpu_wio'=cpu_wio,num_nodes,/ ";
}
- $series .= "'STACK:ccpu_idle#$cpu_idle_color:Idle' ";
- $series .= "'GPRINT:ccpu_idle:AVERAGE:$fmt%%' ";
- $series .= "'CDEF:util=100,ccpu_idle,-,0,110,LIMIT' ";
-
- } else {
-
- /* Context is "host" */
-
- $series = "'DEF:cpu_user=${rrd_dir}/cpu_user.rrd:sum:AVERAGE' "
- . "'DEF:cpu_nice=${rrd_dir}/cpu_nice.rrd:sum:AVERAGE' "
- . "'DEF:cpu_system=${rrd_dir}/cpu_system.rrd:sum:AVERAGE' "
- . "'DEF:cpu_idle=${rrd_dir}/cpu_idle.rrd:sum:AVERAGE' "
- . "'AREA:cpu_user#$cpu_user_color:User' "
- . "'GPRINT:cpu_user:AVERAGE:$fmt%%' "
- . "'STACK:cpu_nice#$cpu_nice_color:Nice' "
- . "'GPRINT:cpu_nice:AVERAGE:$fmt%%' "
- . "'STACK:cpu_system#$cpu_system_color:System' "
- . "'GPRINT:cpu_system:AVERAGE:$fmt%%\\l' ";
-
- if (file_exists("$rrd_dir/cpu_wio.rrd")) {
- $series .= "'DEF:cpu_wio=${rrd_dir}/cpu_wio.rrd:sum:AVERAGE' ";
- $series .= "'STACK:cpu_wio#$cpu_wio_color:WAIT' ";
- $series .= "'GPRINT:cpu_wio:AVERAGE:$fmt%%' ";
+ $plot_prefix='ccpu';
+ }
+ else
+ {
+ $plot_prefix='cpu';
+ }
+
+ $series .= "AREA:'${plot_prefix}_user'#$cpu_user_color:'User' ";
+
+ if($graphreport_stats == true)
+ {
+ $series .= "GPRINT:'${plot_prefix}_user':LAST:' Now\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_user':MIN:'Min\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_user':AVERAGE:'Avg\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_user':MAX:'Max\:%5.2lf%%\\n' ";
+ }
+ $series .= "STACK:'${plot_prefix}_nice'#$cpu_nice_color:'Nice' ";
+
+ if($graphreport_stats == true)
+ {
+ $series .= "GPRINT:'${plot_prefix}_nice':LAST:' Now\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_nice':MIN:'Min\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_nice':AVERAGE:'Avg\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_nice':MAX:'Max\:%5.2lf%%\\n' ";
+ }
+ $series .= "STACK:'${plot_prefix}_system'#$cpu_system_color:'System' ";
+
+ if($graphreport_stats == true)
+ {
+ $series .= "GPRINT:'${plot_prefix}_system':LAST:'Now\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_system':MIN:'Min\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_system':AVERAGE:'Avg\:%5.2lf%%' "
+ . "GPRINT:'${plot_prefix}_system':MAX:'Max\:%5.2lf%%\\n' ";
+ }
+
+ if (file_exists("$rrd_dir/cpu_wio.rrd"))
+ {
+ $series .= "STACK:'${plot_prefix}_wio'#$cpu_wio_color:'WAIT' ";
+
+ if($graphreport_stats == true)
+ {
+ $series .= "GPRINT:'${plot_prefix}_wio':LAST:' Now\:%5.2lf%%' "
+ ."GPRINT:'${plot_prefix}_wio':MIN:'Min\:%5.2lf%%' "
+ ."GPRINT:'${plot_prefix}_wio':AVERAGE:'Avg\:%5.2lf%%' "
+ ."GPRINT:'${plot_prefix}_wio':MAX:'Max\:%5.2lf%%\\n' ";
}
+ }
+
+ $series .= "STACK:'${plot_prefix}_idle'#$cpu_idle_color:'Idle' ";
- $series .= "'STACK:cpu_idle#$cpu_idle_color:Idle' ";
- $series .= "'GPRINT:cpu_idle:AVERAGE:$fmt%%' ";
- $series .= "'CDEF:util=100,cpu_idle,-,0,MAX' ";
+ if($graphreport_stats == true)
+ {
+ $series .= "GPRINT:'${plot_prefix}_idle':LAST:' Now\:%5.2lf%%' "
+ ."GPRINT:'${plot_prefix}_idle':MIN:'Min\:%5.2lf%%' "
+ ."GPRINT:'${plot_prefix}_idle':AVERAGE:'Avg\:%5.2lf%%' "
+ ."GPRINT:'${plot_prefix}_idle':MAX:'Max\:%5.2lf%%\\n' ";
}
- $series .= "'GPRINT:util:AVERAGE:($fmt%% Avg Usage)\\l' ";
$rrdtool_graph['series'] = $series;
diff -ur ganglia-trunk/monitor-core/web/graph.d/load_report.php ganglia-trunk.new/monitor-core/web/graph.d/load_report.php
--- ganglia-trunk/monitor-core/web/graph.d/load_report.php 2009-10-01 17:10:06.050044623 +0200
+++ ganglia-trunk.new/monitor-core/web/graph.d/load_report.php 2009-10-02 11:39:27.730846071 +0200
@@ -13,13 +13,14 @@
$range,
$rrd_dir,
$size,
- $strip_domainname;
+ $strip_domainname,
+ $graphreport_stats;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
- $rrdtool_graph['height'] += ($size != 'small') ? 14 : 0;
+ $rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
$title = 'Load';
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
@@ -30,35 +31,56 @@
$rrdtool_graph['vertical-label'] = 'Load/Procs';
$rrdtool_graph['extras'] = '--rigid';
- $pctfmt = '%3.0lf';
- $numfmt = '%7.1lf';
- $intfmt = '%5.0lf';
-
- $width= $size == 'small' ? 1.25 : 2;
-
- $series = "'DEF:load_one=${rrd_dir}/load_one.rrd:sum:AVERAGE' "
- . "'DEF:proc_run=${rrd_dir}/proc_run.rrd:sum:AVERAGE' "
- . "'DEF:cpu_num=${rrd_dir}/cpu_num.rrd:sum:AVERAGE' ";
-
- $series .= "'AREA:load_one#$load_one_color:1-min Load ' ";
- $series .= "'GPRINT:load_one:AVERAGE:$numfmt' ";
- $series .= "'CDEF:util=load_one,cpu_num,/,100,*' ";
- $series .= "'GPRINT:util:AVERAGE:($pctfmt%%)' ";
-
- $series .= "'LINE$width:cpu_num#$cpu_num_color:CPUs ' ";
- $series .= "'GPRINT:cpu_num:AVERAGE:$intfmt\\l' ";
-
- $series .= "'LINE$width:proc_run#$proc_run_color:Running Procs' ";
- $series .= "'GPRINT:proc_run:AVERAGE:$numfmt' ";
- $series .= "'CDEF:util2=proc_run,cpu_num,/,100,*' ";
- $series .= "'GPRINT:util2:AVERAGE:($pctfmt%%)' ";
+ if ($size == 'medium')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
+ }
+ else if ($size == 'large')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
+ }
+
+ $series = "DEF:'load_one'='${rrd_dir}/load_one.rrd':'sum':AVERAGE "
+ ."DEF:'proc_run'='${rrd_dir}/proc_run.rrd':'sum':AVERAGE "
+ ."DEF:'cpu_num'='${rrd_dir}/cpu_num.rrd':'sum':AVERAGE ";
+
+ $series .="AREA:'load_one'#$load_one_color:'1-min' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'load_one':LAST:'Now\:%6.2lf%s' "
+ . "GPRINT:'load_one':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'load_one':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'load_one':MAX:'Max\:%6.2lf%s\\n' ";
+ }
if( $context != 'host' ) {
- $series .= "'DEF:num_nodes=${rrd_dir}/cpu_num.rrd:num:AVERAGE' ";
- $series .= "'LINE$width:num_nodes#$num_nodes_color:Nodes' ";
- $series .= "'GPRINT:num_nodes:AVERAGE:$intfmt' ";
+ $series .="DEF:'num_nodes'='${rrd_dir}/cpu_num.rrd':'num':AVERAGE ";
+ $series .= "LINE2:'num_nodes'#$num_nodes_color:'Nodes' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'num_nodes':LAST:'Now\:%6.2lf%s' "
+ . "GPRINT:'num_nodes':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'num_nodes':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'num_nodes':MAX:'Max\:%6.2lf%s\\n' ";
+ }
}
+ $series .="LINE2:'cpu_num'#$cpu_num_color:'CPUs' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'cpu_num':LAST:' Now\:%6.2lf%s' "
+ . "GPRINT:'cpu_num':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'cpu_num':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'cpu_num':MAX:'Max\:%6.2lf%s\\n' ";
+ }
+ $series .="LINE2:'proc_run'#$proc_run_color:'Procs' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'proc_run':LAST:'Now\:%6.2lf%s' "
+ . "GPRINT:'proc_run':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'proc_run':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'proc_run':MAX:'Max\:%6.2lf%s\\n' ";
+ }
$rrdtool_graph['series'] = $series;
diff -ur ganglia-trunk/monitor-core/web/graph.d/mem_report.php ganglia-trunk.new/monitor-core/web/graph.d/mem_report.php
--- ganglia-trunk/monitor-core/web/graph.d/mem_report.php 2009-10-01 17:10:06.050044623 +0200
+++ ganglia-trunk.new/monitor-core/web/graph.d/mem_report.php 2009-10-02 11:39:24.045992008 +0200
@@ -14,7 +14,8 @@
$range,
$rrd_dir,
$size,
- $strip_domainname;
+ $strip_domainname,
+ $graphreport_stats;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
@@ -29,45 +30,80 @@
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Bytes';
$rrdtool_graph['extras'] = '--rigid --base 1024';
+ if ($size == 'medium')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
+ }
+ else if ($size == 'large')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
+ }
+ $series = "DEF:'mem_total'='${rrd_dir}/mem_total.rrd':'sum':AVERAGE "
+ ."CDEF:'bmem_total'=mem_total,1024,* "
+ ."DEF:'mem_shared'='${rrd_dir}/mem_shared.rrd':'sum':AVERAGE "
+ ."CDEF:'bmem_shared'=mem_shared,1024,* "
+ ."DEF:'mem_free'='${rrd_dir}/mem_free.rrd':'sum':AVERAGE "
+ ."CDEF:'bmem_free'=mem_free,1024,* "
+ ."DEF:'mem_cached'='${rrd_dir}/mem_cached.rrd':'sum':AVERAGE "
+ ."CDEF:'bmem_cached'=mem_cached,1024,* "
+ ."DEF:'mem_buffers'='${rrd_dir}/mem_buffers.rrd':'sum':AVERAGE "
+ ."CDEF:'bmem_buffers'=mem_buffers,1024,* "
+ ."CDEF:'bmem_used'='bmem_total','bmem_shared',-,'bmem_free',-,'bmem_cached',-,'bmem_buffers',- "
+ ."AREA:'bmem_used'#$mem_used_color:'Used' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'bmem_used':LAST:' Now\:%6.2lf%s' "
+ . "GPRINT:'bmem_used':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'bmem_used':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'bmem_used':MAX:'Max\:%6.2lf%s\\n' ";
+ }
+ $series .= "STACK:'bmem_shared'#$mem_shared_color:'Shared' ";
- $fmt = '%.1lf';
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'bmem_shared':LAST:' Now\:%6.2lf%s' "
+ . "GPRINT:'bmem_shared':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'bmem_shared':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'bmem_shared':MAX:'Max\:%6.2lf%s\\n' ";
+ }
+ $series .= "STACK:'bmem_cached'#$mem_cached_color:'Cached' ";
- $series = "'DEF:mem_total=${rrd_dir}/mem_total.rrd:sum:AVERAGE' "
- . "'CDEF:bmem_total=mem_total,1024,*' "
- . "'DEF:mem_shared=${rrd_dir}/mem_shared.rrd:sum:AVERAGE' "
- . "'CDEF:bmem_shared=mem_shared,1024,*' "
- . "'DEF:mem_free=${rrd_dir}/mem_free.rrd:sum:AVERAGE' "
- . "'CDEF:bmem_free=mem_free,1024,*' "
- . "'DEF:mem_cached=${rrd_dir}/mem_cached.rrd:sum:AVERAGE' "
- . "'CDEF:bmem_cached=mem_cached,1024,*' "
- . "'DEF:mem_buffers=${rrd_dir}/mem_buffers.rrd:sum:AVERAGE' "
- . "'CDEF:bmem_buffers=mem_buffers,1024,*' "
- . "'CDEF:bmem_used=bmem_total,bmem_shared,-,bmem_free,-,bmem_cached,-,bmem_buffers,-' "
- . "'AREA:bmem_used#$mem_used_color:Used' "
- . "'GPRINT:bmem_used:AVERAGE:$fmt%S' "
- . "'STACK:bmem_shared#$mem_shared_color:Shared' "
- . "'GPRINT:bmem_shared:AVERAGE:$fmt%S' "
- . "'STACK:bmem_cached#$mem_cached_color:Cached' "
- . "'GPRINT:bmem_cached:AVERAGE:$fmt%S\\l' "
- . "'STACK:bmem_buffers#$mem_buffered_color:Buffered' "
- . "'GPRINT:bmem_buffers:AVERAGE:$fmt%S' ";
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'bmem_cached':LAST:' Now\:%6.2lf%s' "
+ . "GPRINT:'bmem_cached':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'bmem_cached':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'bmem_cached':MAX:'Max\:%6.2lf%s\\n' ";
+ }
+ $series .= "STACK:'bmem_buffers'#$mem_buffered_color:'Buffered' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'bmem_buffers':LAST:'Now\:%6.2lf%s' "
+ . "GPRINT:'bmem_buffers':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'bmem_buffers':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'bmem_buffers':MAX:'Max\:%6.2lf%s\\n' ";
+ }
if (file_exists("$rrd_dir/swap_total.rrd")) {
- $series .= "'DEF:swap_total=${rrd_dir}/swap_total.rrd:sum:AVERAGE' "
- . "'DEF:swap_free=${rrd_dir}/swap_free.rrd:sum:AVERAGE' "
- . "'CDEF:bmem_swapped=swap_total,swap_free,-,1024,*,0,MAX' "
- . "'STACK:bmem_swapped#$mem_swapped_color:Swapped' "
- . "'GPRINT:bmem_swapped:AVERAGE:$fmt%S\\g' "
- . "'CDEF:bswap_total=swap_total,1024,*' "
- . "'GPRINT:bswap_total:AVERAGE:/$fmt%S\\g' "
- . "'CDEF:swap_util=swap_total,swap_free,-,swap_total,/,100,*' "
- . "'GPRINT:swap_util:AVERAGE: ($fmt%%)\\l' ";
+ $series .= "DEF:'swap_total'='${rrd_dir}/swap_total.rrd':'sum':AVERAGE "
+ ."DEF:'swap_free'='${rrd_dir}/swap_free.rrd':'sum':AVERAGE "
+ ."CDEF:'bmem_swapped'='swap_total','swap_free',-,1024,* "
+ ."STACK:'bmem_swapped'#$mem_swapped_color:'Swapped' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'bmem_swapped':LAST:' Now\:%6.2lf%s' "
+ . "GPRINT:'bmem_swapped':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'bmem_swapped':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'bmem_swapped':MAX:'Max\:%6.2lf%s\\n' ";
+ }
}
- $series .= "'LINE2:bmem_total#$cpu_num_color:Total In-Core' ";
- $series .= "'GPRINT:bmem_total:AVERAGE:$fmt%S' "
- . "'CDEF:util=bmem_total,bmem_free,-,bmem_total,/,100,*' "
- . "'GPRINT:util:AVERAGE:($fmt%% Real Memory In Use)\\l' ";
+ $series .= "LINE2:'bmem_total'#$cpu_num_color:'Total' ";
+
+ if($graphreport_stats == true) {
+ $series .= "GPRINT:'bmem_total':LAST:' Now\:%6.2lf%s' "
+ . "GPRINT:'bmem_total':MIN:'Min\:%6.2lf%s' "
+ . "GPRINT:'bmem_total':AVERAGE:'Avg\:%6.2lf%s' "
+ . "GPRINT:'bmem_total':MAX:'Max\:%6.2lf%s\\n' ";
+ }
$rrdtool_graph['series'] = $series;
diff -ur ganglia-trunk/monitor-core/web/graph.d/metric.php ganglia-trunk.new/monitor-core/web/graph.d/metric.php
--- ganglia-trunk/monitor-core/web/graph.d/metric.php 2009-10-01 17:10:06.050044623 +0200
+++ ganglia-trunk.new/monitor-core/web/graph.d/metric.php 2009-10-02 11:39:40.643042748 +0200
@@ -22,7 +22,8 @@
$summary,
$value,
$vlabel,
- $strip_domainname;
+ $strip_domainname,
+ $graphreport_stats;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
@@ -30,6 +31,15 @@
$rrdtool_graph['height'] += 0; //no fudge needed
+ if ($size == 'medium')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
+ }
+ else if ($size == 'large')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
+ }
+
switch ($context) {
case 'host':
@@ -109,23 +119,36 @@
$rrdtool_graph['vertical-label'] = ' ';
}
- // the actual graph...
- $series = "'DEF:sum=$rrd_dir/$metricname.rrd:sum:AVERAGE' ";
- $series .= "'AREA:sum#$default_metric_color:$subtitle_one' ";
- $series .= "'VDEF:summax=sum,MAXIMUM' ";
- $series .= "'LINE1:summax#ff0000:$subtitle_one' ";
- $series .= "'COMMENT:$subtitle_two\\l' ";
+ //# the actual graph...
+ $series = "DEF:'sum'='$rrd_dir/$metricname.rrd:sum':AVERAGE ";
+ $series .= "AREA:'sum'#$default_metric_color:'$subtitle_one\\n'";
+
+ if($graphreport_stats == false)
+ {
+ $series .= ":STACK: COMMENT:'$subtitle_two'";
+ }
- if ($jobstart) {
- $series .= "'VRULE:$jobstart#$jobstart_color' ";
+ if ($size == 'small')
+ {
+ $eol2 = '\\n';
+ }
+ else
+ {
+ $eol2 = '';
}
- if ($size != "small") {
- $fmt = '%.1lf';
- $series .= "'GPRINT:sum:MIN:(Min\:$fmt%s' ";
- $series .= "'GPRINT:sum:AVERAGE:Avg\:$fmt%s' ";
- $series .= "'GPRINT:sum:MAX:Max\:$fmt%s)' ";
- $series .= "'GPRINT:sum:LAST:Last\:$fmt%s\\l' ";
+
+ if($graphreport_stats == true) {
+
+ $series .= " GPRINT:'sum':LAST:'Now\:%7.2lf%s' "
+ . "GPRINT:'sum':MIN:'Min\:%7.2lf%s${eol2}' "
+ . "GPRINT:'sum':AVERAGE:'Avg\:%7.2lf%s' "
+ . "GPRINT:'sum':MAX:'Max\:%7.2lf%s\\n' ";
+ }
+
+ if ($jobstart) {
+ $series .= "VRULE:$jobstart#$jobstart_color ";
}
+
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
diff -ur ganglia-trunk/monitor-core/web/graph.d/network_report.php ganglia-trunk.new/monitor-core/web/graph.d/network_report.php
--- ganglia-trunk/monitor-core/web/graph.d/network_report.php 2009-10-01 17:10:06.050044623 +0200
+++ ganglia-trunk.new/monitor-core/web/graph.d/network_report.php 2009-10-02 11:39:31.989951798 +0200
@@ -11,14 +11,15 @@
$range,
$rrd_dir,
$size,
- $strip_domainname;
+ $strip_domainname,
+ $graphreport_stats;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Network';
- $rrdtool_graph['height'] += ($size != 'small' ) ? 14 : 0;
+ $rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
@@ -27,20 +28,36 @@
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Bytes/sec';
$rrdtool_graph['extras'] = '--rigid --base 1024';
+ if ($size == 'medium')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
+ }
+ else if ($size == 'large')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
+ }
+
+ $series = "DEF:'bytes_in'='${rrd_dir}/bytes_in.rrd':'sum':AVERAGE "
+ ."DEF:'bytes_out'='${rrd_dir}/bytes_out.rrd':'sum':AVERAGE "
+ ."LINE2:'bytes_in'#$mem_cached_color:'In' ";
+
+ if($graphreport_stats == true) {
+
+ $series .= "GPRINT:'bytes_in':LAST:' Now\:%7.2lf%s' "
+ . "GPRINT:'bytes_in':MIN:'Min\:%7.2lf%s' "
+ . "GPRINT:'bytes_in':AVERAGE:'Avg\:%7.2lf%s' "
+ . "GPRINT:'bytes_in':MAX:'Max\:%7.2lf%s\\n' ";
+ }
+
+ $series .= "LINE2:'bytes_out'#$mem_used_color:'Out' ";
- $width= $size == 'small' ? 1.25 : 2;
+ if($graphreport_stats == true) {
- $fmt = '%5.1lf';
- $series = "'DEF:bytes_in=${rrd_dir}/bytes_in.rrd:sum:AVERAGE' "
- . "'DEF:bytes_out=${rrd_dir}/bytes_out.rrd:sum:AVERAGE' "
- . "'LINE$width:bytes_in#$mem_cached_color:In ' "
- . "'GPRINT:bytes_in:MIN:(Min\:$fmt%s' "
- . "'GPRINT:bytes_in:AVERAGE:Avg\:$fmt%s' "
- . "'GPRINT:bytes_in:MAX:Max\:$fmt%s)\\l' "
- . "'LINE$width:bytes_out#$mem_used_color:Out' "
- . "'GPRINT:bytes_out:MIN:(Min\:$fmt%s' "
- . "'GPRINT:bytes_out:AVERAGE:Avg\:$fmt%s' "
- . "'GPRINT:bytes_out:MAX:Max\:$fmt%s)\\l' ";
+ $series .= "GPRINT:'bytes_out':LAST:'Now\:%7.2lf%s' "
+ . "GPRINT:'bytes_out':MIN:'Min\:%7.2lf%s' "
+ . "GPRINT:'bytes_out':AVERAGE:'Avg\:%7.2lf%s' "
+ . "GPRINT:'bytes_out':MAX:'Max\:%7.2lf%s\\n' ";
+ }
$rrdtool_graph['series'] = $series;
diff -ur ganglia-trunk/monitor-core/web/graph.d/packet_report.php ganglia-trunk.new/monitor-core/web/graph.d/packet_report.php
--- ganglia-trunk/monitor-core/web/graph.d/packet_report.php 2009-10-01 17:10:06.050044623 +0200
+++ ganglia-trunk.new/monitor-core/web/graph.d/packet_report.php 2009-10-02 11:39:36.242146022 +0200
@@ -11,14 +11,15 @@
$range,
$rrd_dir,
$size,
- $strip_domainname;
+ $strip_domainname,
+ $graphreport_stats;
if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'Packets';
- $rrdtool_graph['height'] += ($size != 'small') ? 14 : 0;
+ $rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
@@ -27,20 +28,35 @@
$rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Packets/sec';
$rrdtool_graph['extras'] = '--rigid --base 1024';
+ if ($size == 'medium')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
+ }
+ else if ($size == 'large')
+ {
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
+ }
- $width= $size == 'small' ? 1.25 : 2;
+ $series = "DEF:'pkts_in'='${rrd_dir}/pkts_in.rrd':'sum':AVERAGE "
+ ."DEF:'pkts_out'='${rrd_dir}/pkts_out.rrd':'sum':AVERAGE "
+ ."LINE2:'pkts_in'#$mem_cached_color:'In' ";
+
+ if($graphreport_stats == true)
+ {
+ $series .= "GPRINT:'pkts_in':LAST:' Now\:%7.2lf%s' "
+ . "GPRINT:'pkts_in':MIN:'Min\:%7.2lf%s' "
+ . "GPRINT:'pkts_in':AVERAGE:'Avg\:%7.2lf%s' "
+ . "GPRINT:'pkts_in':MAX:'Max\:%7.2lf%s\\n' ";
+ }
+ $series .= "LINE2:'pkts_out'#$mem_used_color:'Out' ";
- $fmt = '%5.1lf';
- $series = "'DEF:bytes_in=${rrd_dir}/pkts_in.rrd:sum:AVERAGE' "
- . "'DEF:bytes_out=${rrd_dir}/pkts_out.rrd:sum:AVERAGE' "
- . "'LINE$width:bytes_in#$mem_cached_color:In ' "
- . "'GPRINT:bytes_in:MIN:(Min\:$fmt%s' "
- . "'GPRINT:bytes_in:AVERAGE:Avg\:$fmt%s' "
- . "'GPRINT:bytes_in:MAX:Max\:$fmt%s)\\l' "
- . "'LINE$width:bytes_out#$mem_used_color:Out' "
- . "'GPRINT:bytes_out:MIN:(Min\:$fmt%s' "
- . "'GPRINT:bytes_out:AVERAGE:Avg\:$fmt%s' "
- . "'GPRINT:bytes_out:MAX:Max\:$fmt%s)\\l' ";
+ if($graphreport_stats == true)
+ {
+ $series .= "GPRINT:'pkts_out':LAST:'Now\:%7.2lf%s' "
+ . "GPRINT:'pkts_out':MIN:'Min\:%7.2lf%s' "
+ . "GPRINT:'pkts_out':AVERAGE:'Avg\:%7.2lf%s' "
+ . "GPRINT:'pkts_out':MAX:'Max\:%7.2lf%s\\n' ";
+ }
$rrdtool_graph['series'] = $series;
smime.p7s
Description: S/MIME Cryptographic Signature
------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf
_______________________________________________ Ganglia-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-developers
