Revision: 2474
http://ganglia.svn.sourceforge.net/ganglia/?rev=2474&view=rev
Author: bernardli
Date: 2011-02-12 00:35:42 +0000 (Sat, 12 Feb 2011)
Log Message:
-----------
[web] Fix Bugzilla #278 with attached patch (metric.php was further modified to support 'default' size)
- fixed some string formatting for when graphreport_stats is not true
- cleaned up whitespaces and removed tabs
- now use RPN LIMIT instead of IF to prevent nonexistent ((sub)zero) values
- graph stats min/now values now works properly with rrdtool 1.2
- graph y-axis scale now displays correct values for rrdtool 1.2
Submitted-by: Ramon Bastiaans <ramon.bastiaans@...>
Modified Paths:
--------------
trunk/monitor-core/web/graph.d/cpu_report.php
trunk/monitor-core/web/graph.d/load_report.php
trunk/monitor-core/web/graph.d/mem_report.php
trunk/monitor-core/web/graph.d/metric.php
trunk/monitor-core/web/graph.d/network_report.php
trunk/monitor-core/web/graph.d/packet_report.php
Modified: trunk/monitor-core/web/graph.d/cpu_report.php
===================================================================
--- trunk/monitor-core/web/graph.d/cpu_report.php 2011-02-11 20:54:33 UTC (rev 2473)
+++ trunk/monitor-core/web/graph.d/cpu_report.php 2011-02-12 00:35:42 UTC (rev 2474)
@@ -1,7 +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,
@@ -15,49 +16,45 @@
$strip_domainname,
$graphreport_stats;
- if ($strip_domainname) {
+ if ($strip_domainname) {
$hostname = strip_domainname($hostname);
}
$title = 'CPU';
- if ($context != 'host') {
+ if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "$hostname $title last $range";
}
-
- $rrdtool_graph['upper-limit'] = '100';
- $rrdtool_graph['lower-limit'] = '0';
+ $rrdtool_graph['upper-limit'] = '100';
+ $rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Percent';
- $rrdtool_graph['extras'] = '--rigid';
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
+ $rrdtool_graph['extras'] = ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- if( $graphreport_stats ) {
+ if ( $graphreport_stats ) {
$rrdtool_graph['height'] += ($size == 'medium') ? 16 : 0;
$rmspace = '\\g';
} else {
$rmspace = '';
}
- $series = '';
+ $series = '';
// RB: Perform some formatting/spacing magic.. tinkered to fit
//
if ($size == 'small') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '\\l';
- $space1 = ' ';
- $space2 = ' ';
- } else if ($size == 'medium') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = '';
+ $eol1 = '\\l';
+ $space1 = ' ';
+ $space2 = ' ';
+ } else if ($size == 'medium' || $size == 'default') {
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = '';
} else if ($size == 'large') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = ' ';
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = ' ';
}
if ($context != "host" ) {
@@ -74,87 +71,87 @@
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,/ ";
+ . "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,/ ";
}
- $plot_prefix='ccpu';
+ $plot_prefix ='ccpu';
} else {
- $plot_prefix='cpu';
+ $plot_prefix ='cpu';
}
$series .= "AREA:'${plot_prefix}_user'#$cpu_user_color:'User${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:user_pos=${plot_prefix}_user,0,LT,0,${plot_prefix}_user,IF "
+ $series .= "CDEF:user_pos=${plot_prefix}_user,0,INF,LIMIT "
. "VDEF:user_last=user_pos,LAST "
. "VDEF:user_min=user_pos,MINIMUM "
. "VDEF:user_avg=user_pos,AVERAGE "
. "VDEF:user_max=user_pos,MAXIMUM "
. "GPRINT:'user_last':' ${space1}Now\:%5.1lf%%' "
- . "GPRINT:'user_min':'Min\:%5.1lf%%${eol1}' "
+ . "GPRINT:'user_min':'${space1}Min\:%5.1lf%%${eol1}' "
. "GPRINT:'user_avg':'${space2}Avg\:%5.1lf%%' "
- . "GPRINT:'user_max':'Max\:%5.1lf%%\\l' ";
+ . "GPRINT:'user_max':'${space1}Max\:%5.1lf%%\\l' ";
}
$series .= "STACK:'${plot_prefix}_nice'#$cpu_nice_color:'Nice${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:nice_pos=${plot_prefix}_nice,0,LT,0,${plot_prefix}_nice,IF "
+ $series .= "CDEF:nice_pos=${plot_prefix}_nice,0,INF,LIMIT "
. "VDEF:nice_last=nice_pos,LAST "
. "VDEF:nice_min=nice_pos,MINIMUM "
. "VDEF:nice_avg=nice_pos,AVERAGE "
. "VDEF:nice_max=nice_pos,MAXIMUM "
. "GPRINT:'nice_last':' ${space1}Now\:%5.1lf%%' "
- . "GPRINT:'nice_min':'Min\:%5.1lf%%${eol1}' "
+ . "GPRINT:'nice_min':'${space1}Min\:%5.1lf%%${eol1}' "
. "GPRINT:'nice_avg':'${space2}Avg\:%5.1lf%%' "
- . "GPRINT:'nice_max':'Max\:%5.1lf%%\\l' ";
+ . "GPRINT:'nice_max':'${space1}Max\:%5.1lf%%\\l' ";
}
$series .= "STACK:'${plot_prefix}_system'#$cpu_system_color:'System${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:system_pos=${plot_prefix}_system,0,LT,0,${plot_prefix}_system,IF "
+ $series .= "CDEF:system_pos=${plot_prefix}_system,0,INF,LIMIT "
. "VDEF:system_last=system_pos,LAST "
. "VDEF:system_min=system_pos,MINIMUM "
. "VDEF:system_avg=system_pos,AVERAGE "
. "VDEF:system_max=system_pos,MAXIMUM "
. "GPRINT:'system_last':'${space1}Now\:%5.1lf%%' "
- . "GPRINT:'system_min':'Min\:%5.1lf%%${eol1}' "
+ . "GPRINT:'system_min':'${space1}Min\:%5.1lf%%${eol1}' "
. "GPRINT:'system_avg':'${space2}Avg\:%5.1lf%%' "
- . "GPRINT:'system_max':'Max\:%5.1lf%%\\l' ";
+ . "GPRINT:'system_max':'${space1}Max\:%5.1lf%%\\l' ";
}
if (file_exists("$rrd_dir/cpu_wio.rrd")) {
$series .= "STACK:'${plot_prefix}_wio'#$cpu_wio_color:'Wait${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:wio_pos=${plot_prefix}_wio,0,LT,0,${plot_prefix}_wio,IF "
+ $series .= "CDEF:wio_pos=${plot_prefix}_wio,0,INF,LIMIT "
. "VDEF:wio_last=wio_pos,LAST "
. "VDEF:wio_min=wio_pos,MINIMUM "
. "VDEF:wio_avg=wio_pos,AVERAGE "
. "VDEF:wio_max=wio_pos,MAXIMUM "
- . "GPRINT:'wio_last':' ${space1}Now\:%5.1lf%%' "
- . "GPRINT:'wio_min':'Min\:%5.1lf%%${eol1}' "
+ . "GPRINT:'wio_last':' ${space1}Now\:%5.1lf%%' "
+ . "GPRINT:'wio_min':'${space1}Min\:%5.1lf%%${eol1}' "
. "GPRINT:'wio_avg':'${space2}Avg\:%5.1lf%%' "
- . "GPRINT:'wio_max':'Max\:%5.1lf%%\\l' ";
+ . "GPRINT:'wio_max':'${space1}Max\:%5.1lf%%\\l' ";
}
}
$series .= "STACK:'${plot_prefix}_idle'#$cpu_idle_color:'Idle${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:idle_pos=${plot_prefix}_idle,0,LT,0,${plot_prefix}_idle,IF "
+ $series .= "CDEF:idle_pos=${plot_prefix}_idle,0,INF,LIMIT "
. "VDEF:idle_last=idle_pos,LAST "
. "VDEF:idle_min=idle_pos,MINIMUM "
. "VDEF:idle_avg=idle_pos,AVERAGE "
. "VDEF:idle_max=idle_pos,MAXIMUM "
. "GPRINT:'idle_last':' ${space1}Now\:%5.1lf%%' "
- . "GPRINT:'idle_min':'Min\:%5.1lf%%${eol1}' "
+ . "GPRINT:'idle_min':'${space1}Min\:%5.1lf%%${eol1}' "
. "GPRINT:'idle_avg':'${space2}Avg\:%5.1lf%%' "
- . "GPRINT:'idle_max':'Max\:%5.1lf%%\\l' ";
+ . "GPRINT:'idle_max':'${space1}Max\:%5.1lf%%\\l' ";
}
$rrdtool_graph['series'] = $series;
Modified: trunk/monitor-core/web/graph.d/load_report.php
===================================================================
--- trunk/monitor-core/web/graph.d/load_report.php 2011-02-11 20:54:33 UTC (rev 2473)
+++ trunk/monitor-core/web/graph.d/load_report.php 2011-02-12 00:35:42 UTC (rev 2474)
@@ -27,6 +27,9 @@
if ( $hostname != '' ) {
$rrdtool_graph['height'] += ($size == 'medium') ? 12 : 0;
}
+ $rmspace = '\\g';
+ } else {
+ $rmspace = '';
}
$title = 'Load';
@@ -37,93 +40,88 @@
$rrdtool_graph['title'] = "$hostname $title last $range";
}
- $rrdtool_graph['lower-limit'] = '0';
+ $rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Load/Procs';
- $rrdtool_graph['extras'] = '--rigid';
+ $rrdtool_graph['extras'] = ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
if ($size == 'small') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '\\l';
- $space1 = ' ';
- $space2 = ' ';
- } else if ($size == 'medium') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = ' ';
- $space1 = ' ';
- $space2 = '';
+ $eol1 = '\\l';
+ $space1 = ' ';
+ $space2 = ' ';
+ } else if ($size == 'medium' || $size == 'default') {
+ $eol1 = '';
+ $space1 = '';
+ $space2 = '';
} else if ($size == 'large') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = ' ';
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = ' ';
}
$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 ";
+ . "DEF:'proc_run'='${rrd_dir}/proc_run.rrd':'sum':AVERAGE "
+ . "DEF:'cpu_num'='${rrd_dir}/cpu_num.rrd':'sum':AVERAGE "
+ . "AREA:'load_one'#$load_one_color:'1-min${rmspace}' ";
- $series .="AREA:'load_one'#$load_one_color:'1-min\\g' ";
-
if ($graphreport_stats ) {
- $series .= "CDEF:load_pos=load_one,0,LT,0,load_one,IF "
+ $series .= "CDEF:load_pos=load_one,0,INF,LIMIT "
. "VDEF:load_last=load_pos,LAST "
. "VDEF:load_min=load_pos,MINIMUM "
. "VDEF:load_avg=load_pos,AVERAGE "
. "VDEF:load_max=load_pos,MAXIMUM "
. "GPRINT:'load_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'load_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'load_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'load_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'load_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'load_max':'${space1}Max\:%6.1lf%s\\l' ";
}
if ( $context != 'host' ) {
- $series .="DEF:'num_nodes'='${rrd_dir}/cpu_num.rrd':'num':AVERAGE ";
- $series .= "LINE2:'num_nodes'#$num_nodes_color:'Nodes\\g' ";
+ $series .= "DEF:'num_nodes'='${rrd_dir}/cpu_num.rrd':'num':AVERAGE "
+ . "LINE2:'num_nodes'#$num_nodes_color:'Nodes${rmspace}' ";
if ($graphreport_stats ) {
- $series .= "CDEF:numnod_pos=num_nodes,0,LT,0,num_nodes,IF "
- . "VDEF:numnod_last=numnod_pos,LAST "
- . "VDEF:numnod_min=numnod_pos,MINIMUM "
- . "VDEF:numnod_avg=numnod_pos,AVERAGE "
- . "VDEF:numnod_max=numnod_pos,MAXIMUM "
- . "GPRINT:'numnod_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'numnod_min':'Min\:%6.1lf%s${eol1}' "
- . "GPRINT:'numnod_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'numnod_max':'Max\:%6.1lf%s\\l' ";
+ $series .= "CDEF:numnod_pos=num_nodes,0,INF,LIMIT "
+ . "VDEF:numnod_last=numnod_pos,LAST "
+ . "VDEF:numnod_min=numnod_pos,MINIMUM "
+ . "VDEF:numnod_avg=numnod_pos,AVERAGE "
+ . "VDEF:numnod_max=numnod_pos,MAXIMUM "
+ . "GPRINT:'numnod_last':' ${space1}Now\:%6.1lf%s' "
+ . "GPRINT:'numnod_min':'${space1}Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'numnod_avg':'${space2}Avg\:%6.1lf%s' "
+ . "GPRINT:'numnod_max':'${space1}Max\:%6.1lf%s\\l' ";
}
}
- $series .="LINE2:'cpu_num'#$cpu_num_color:'CPUs\\g' ";
+ $series .="LINE2:'cpu_num'#$cpu_num_color:'CPUs${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:cpun_pos=cpu_num,0,LT,0,cpu_num,IF "
+ $series .= "CDEF:cpun_pos=cpu_num,0,INF,LIMIT "
. "VDEF:cpun_last=cpun_pos,LAST "
. "VDEF:cpun_min=cpun_pos,MINIMUM "
. "VDEF:cpun_avg=cpun_pos,AVERAGE "
. "VDEF:cpun_max=cpun_pos,MAXIMUM "
. "GPRINT:'cpun_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'cpun_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'cpun_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'cpun_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'cpun_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'cpun_max':'${space1}Max\:%6.1lf%s\\l' ";
}
- $series .="LINE2:'proc_run'#$proc_run_color:'Procs\\g' ";
+ $series .="LINE2:'proc_run'#$proc_run_color:'Procs${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:procr_pos=proc_run,0,LT,0,proc_run,IF "
+ $series .= "CDEF:procr_pos=proc_run,0,INF,LIMIT "
. "VDEF:procr_last=procr_pos,LAST "
. "VDEF:procr_min=procr_pos,MINIMUM "
. "VDEF:procr_avg=procr_pos,AVERAGE "
. "VDEF:procr_max=procr_pos,MAXIMUM "
. "GPRINT:'procr_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'procr_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'procr_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'procr_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'procr_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'procr_max':'${space1}Max\:%6.1lf%s\\l' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
-
}
?>
Modified: trunk/monitor-core/web/graph.d/mem_report.php
===================================================================
--- trunk/monitor-core/web/graph.d/mem_report.php 2011-02-11 20:54:33 UTC (rev 2473)
+++ trunk/monitor-core/web/graph.d/mem_report.php 2011-02-12 00:35:42 UTC (rev 2474)
@@ -28,30 +28,31 @@
} else {
$rrdtool_graph['title'] = "$hostname $title last $range";
}
- $rrdtool_graph['lower-limit'] = '0';
+ $rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Bytes';
- $rrdtool_graph['extras'] = '--rigid --base 1024';
- $rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
+ $rrdtool_graph['extras'] = '--base 1024';
+ $rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
if ( $graphreport_stats ) {
$rrdtool_graph['height'] += ($size == 'medium') ? 4 : 0;
+ $rmspace = '\\g';
+ } else {
+ $rmspace = '';
}
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
if ($size == 'small') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '\\l';
- $space1 = ' ';
- $space2 = ' ';
- } else if ($size == 'medium') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = '';
+ $eol1 = '\\l';
+ $space1 = ' ';
+ $space2 = ' ';
+ } else if ($size == 'medium' || $size = 'default') {
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = '';
} else if ($size == 'large') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = ' ';
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = ' ';
}
$series = "DEF:'mem_total'='${rrd_dir}/mem_total.rrd':'sum':AVERAGE "
."CDEF:'bmem_total'=mem_total,1024,* "
@@ -64,96 +65,95 @@
."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\\g' ";
+ ."AREA:'bmem_used'#$mem_used_color:'Use${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:used_pos=bmem_used,0,LT,0,bmem_used,IF "
+ $series .= "CDEF:used_pos=bmem_used,0,INF,LIMIT "
. "VDEF:used_last=used_pos,LAST "
. "VDEF:used_min=used_pos,MINIMUM "
. "VDEF:used_avg=used_pos,AVERAGE "
. "VDEF:used_max=used_pos,MAXIMUM "
- . "GPRINT:'used_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'used_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'used_last':' ${space1}Now\:%6.1lf%s' "
+ . "GPRINT:'used_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'used_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'used_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'used_max':'${space1}Max\:%6.1lf%s\\l' ";
}
- $series .= "STACK:'bmem_shared'#$mem_shared_color:'Shared\\g' ";
+ $series .= "STACK:'bmem_shared'#$mem_shared_color:'Share${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:shared_pos=bmem_shared,0,LT,0,bmem_shared,IF "
+ $series .= "CDEF:shared_pos=bmem_shared,0,INF,LIMIT "
. "VDEF:shared_last=shared_pos,LAST "
. "VDEF:shared_min=shared_pos,MINIMUM "
. "VDEF:shared_avg=shared_pos,AVERAGE "
. "VDEF:shared_max=shared_pos,MAXIMUM "
- . "GPRINT:'shared_last':'${space1}Now\:%6.1lf%s' "
- . "GPRINT:'shared_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'shared_last':' ${space1}Now\:%6.1lf%s' "
+ . "GPRINT:'shared_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'shared_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'shared_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'shared_max':'${space1}Max\:%6.1lf%s\\l' ";
}
- $series .= "STACK:'bmem_cached'#$mem_cached_color:'Cached\\g' ";
+ $series .= "STACK:'bmem_cached'#$mem_cached_color:'Cache${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:cached_pos=bmem_cached,0,LT,0,bmem_cached,IF "
+ $series .= "CDEF:cached_pos=bmem_cached,0,INF,LIMIT "
. "VDEF:cached_last=cached_pos,LAST "
. "VDEF:cached_min=cached_pos,MINIMUM "
. "VDEF:cached_avg=cached_pos,AVERAGE "
. "VDEF:cached_max=cached_pos,MAXIMUM "
- . "GPRINT:'cached_last':'${space1}Now\:%6.1lf%s' "
- . "GPRINT:'cached_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'cached_last':' ${space1}Now\:%6.1lf%s' "
+ . "GPRINT:'cached_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'cached_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'cached_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'cached_max':'${space1}Max\:%6.1lf%s\\l' ";
}
- $series .= "STACK:'bmem_buffers'#$mem_buffered_color:'Buffer\\g' ";
+ $series .= "STACK:'bmem_buffers'#$mem_buffered_color:'Buffer${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:buffers_pos=bmem_buffers,0,LT,0,bmem_buffers,IF "
+ $series .= "CDEF:buffers_pos=bmem_buffers,0,INF,LIMIT "
. "VDEF:buffers_last=buffers_pos,LAST "
. "VDEF:buffers_min=buffers_pos,MINIMUM "
. "VDEF:buffers_avg=buffers_pos,AVERAGE "
. "VDEF:buffers_max=buffers_pos,MAXIMUM "
. "GPRINT:'buffers_last':'${space1}Now\:%6.1lf%s' "
- . "GPRINT:'buffers_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'buffers_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'buffers_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'buffers_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'buffers_max':'${space1}Max\:%6.1lf%s\\l' ";
}
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,* "
- ."STACK:'bmem_swapped'#$mem_swapped_color:'Swap\\g' ";
+ . "DEF:'swap_free'='${rrd_dir}/swap_free.rrd':'sum':AVERAGE "
+ . "CDEF:'bmem_swapped'='swap_total','swap_free',-,1024,* "
+ . "STACK:'bmem_swapped'#$mem_swapped_color:'Swap${rmspace}' ";
- if ( $graphreport_stats ) {
- $series .= "CDEF:swapped_pos=bmem_swapped,0,LT,0,bmem_swapped,IF "
+ if ( $graphreport_stats ) {
+ $series .= "CDEF:swapped_pos=bmem_swapped,0,INF,LIMIT "
. "VDEF:swapped_last=swapped_pos,LAST "
. "VDEF:swapped_min=swapped_pos,MINIMUM "
. "VDEF:swapped_avg=swapped_pos,AVERAGE "
. "VDEF:swapped_max=swapped_pos,MAXIMUM "
. "GPRINT:'swapped_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'swapped_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'swapped_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'swapped_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'swapped_max':'Max\:%6.1lf%s\\l' ";
- }
+ . "GPRINT:'swapped_max':'${space1}Max\:%6.1lf%s\\l' ";
+ }
}
- $series .= "LINE2:'bmem_total'#$cpu_num_color:'Total\\g' ";
+ $series .= "LINE2:'bmem_total'#$cpu_num_color:'Total${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:total_pos=bmem_total,0,LT,0,bmem_total,IF "
+ $series .= "CDEF:total_pos=bmem_total,0,INF,LIMIT "
. "VDEF:total_last=total_pos,LAST "
. "VDEF:total_min=total_pos,MINIMUM "
. "VDEF:total_avg=total_pos,AVERAGE "
. "VDEF:total_max=total_pos,MAXIMUM "
. "GPRINT:'total_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'total_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'total_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'total_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'total_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'total_max':'${space1}Max\:%6.1lf%s\\l' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
-
}
?>
Modified: trunk/monitor-core/web/graph.d/metric.php
===================================================================
--- trunk/monitor-core/web/graph.d/metric.php 2011-02-11 20:54:33 UTC (rev 2473)
+++ trunk/monitor-core/web/graph.d/metric.php 2011-02-12 00:35:42 UTC (rev 2474)
@@ -31,11 +31,13 @@
$rrdtool_graph['height'] += 0; //no fudge needed
$rrdtool_graph['extras'] = '';
+ //$rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
- 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 ($size == 'large') {
+ //$space1 = ' ';
+ $space1 = '\t';
+ } else {
+ $space1 = '';
}
switch ($context) {
@@ -117,32 +119,36 @@
$rrdtool_graph['vertical-label'] = $metricname;
}
+ if ($size == 'small') {
+ $eol1 = '\\n';
+ $eol2 = '\\l';
+ } else if ($size == 'large') {
+ $eol1 = '';
+ $eol2 = '';
+ } else if ($size == 'medium' || $size == 'default') {
+ $eol1 = '\\n';
+ $eol2 = '';
+ }
//# the actual graph...
- $series = "DEF:'sum'='$rrd_dir/$metricname.rrd:sum':AVERAGE ";
- $series .= "AREA:'sum'#$default_metric_color:'$subtitle_one\\n'";
+ $series = "DEF:'sum'='$rrd_dir/$metricname.rrd:sum':AVERAGE "
+ . "AREA:'sum'#$default_metric_color:'$subtitle_one${eol1}'";
if ($graphreport_stats == false) {
$series .= ":STACK: COMMENT:'$subtitle_two\\l'";
}
$series .= " ";
- if ($size == 'small') {
- $eol2 = '\\l';
- } else {
- $eol2 = '';
- }
if($graphreport_stats == true) {
-
- $series .= "CDEF:sum_pos=sum,0,LT,0,sum,IF "
+ $series .= "CDEF:sum_pos=sum,0,INF,LIMIT "
. "VDEF:sum_last=sum_pos,LAST "
. "VDEF:sum_min=sum_pos,MINIMUM "
. "VDEF:sum_avg=sum_pos,AVERAGE "
. "VDEF:sum_max=sum_pos,MAXIMUM "
- . "GPRINT:'sum_last':'Now\:%7.2lf%s' "
- . "GPRINT:'sum_min':'Min\:%7.2lf%s${eol2}' "
- . "GPRINT:'sum_avg':'Avg\:%7.2lf%s' "
- . "GPRINT:'sum_max':'Max\:%7.2lf%s\\l' ";
+ . "GPRINT:'sum_last':'${space1}Now\:%7.2lf%s' "
+ . "GPRINT:'sum_min':'${space1}Min\:%7.2lf%s${eol2}' "
+ . "GPRINT:'sum_avg':'${space1}Avg\:%7.2lf%s' "
+ . "GPRINT:'sum_max':'${space1}Max\:%7.2lf%s\\l' ";
}
if ($jobstart) {
@@ -152,7 +158,6 @@
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
-
}
?>
Modified: trunk/monitor-core/web/graph.d/network_report.php
===================================================================
--- trunk/monitor-core/web/graph.d/network_report.php 2011-02-11 20:54:33 UTC (rev 2473)
+++ trunk/monitor-core/web/graph.d/network_report.php 2011-02-12 00:35:42 UTC (rev 2474)
@@ -20,71 +20,70 @@
$title = 'Network';
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
- if( $graphreport_stats ) {
+ if ( $graphreport_stats ) {
$rrdtool_graph['height'] += ($size == 'medium') ? 52 : 0;
+ $rmspace = '\\g';
+ } else {
+ $rmspace = '';
}
- if ($context != 'host') {
+ if ($context != 'host') {
$rrdtool_graph['title'] = $title;
} else {
$rrdtool_graph['title'] = "$hostname Network last $range";
}
-
- $rrdtool_graph['lower-limit'] = '0';
+ $rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Bytes/sec';
- $rrdtool_graph['extras'] = '--rigid --base 1024';
+ $rrdtool_graph['extras'] = '--base 1024';
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
if ($size == 'small') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '\\l';
- $space1 = ' ';
- $space2 = ' ';
- } else if ($size == 'medium') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = '';
+ $eol1 = '\\l';
+ $space1 = ' ';
+ $space2 = ' ';
+ } else if ($size == 'medium' || $size == 'default') {
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = '';
} else if ($size == 'large') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = ' ';
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = ' ';
}
$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\\g' ";
+ . "DEF:'bytes_out'='${rrd_dir}/bytes_out.rrd':'sum':AVERAGE "
+ . "LINE2:'bytes_in'#$mem_cached_color:'In${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:bytesin_pos=bytes_in,0,LT,0,bytes_in,IF "
+ $series .= "CDEF:bytesin_pos=bytes_in,0,INF,LIMIT "
. "VDEF:bytesin_last=bytesin_pos,LAST "
. "VDEF:bytesin_min=bytesin_pos,MINIMUM "
. "VDEF:bytesin_avg=bytesin_pos,AVERAGE "
. "VDEF:bytesin_max=bytesin_pos,MAXIMUM "
. "GPRINT:'bytesin_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'bytesin_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'bytesin_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'bytesin_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'bytesin_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'bytesin_max':'${space1}Max\:%6.1lf%s\\l' ";
}
- $series .= "LINE2:'bytes_out'#$mem_used_color:'Out\\g' ";
+ $series .= "LINE2:'bytes_out'#$mem_used_color:'Out${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:bytesout_pos=bytes_out,0,LT,0,bytes_out,IF "
+ $series .= "CDEF:bytesout_pos=bytes_out,0,INF,LIMIT "
. "VDEF:bytesout_last=bytesout_pos,LAST "
. "VDEF:bytesout_min=bytesout_pos,MINIMUM "
. "VDEF:bytesout_avg=bytesout_pos,AVERAGE "
. "VDEF:bytesout_max=bytesout_pos,MAXIMUM "
. "GPRINT:'bytesout_last':'${space1}Now\:%6.1lf%s' "
- . "GPRINT:'bytesout_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'bytesout_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'bytesout_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'bytesout_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'bytesout_max':'${space1}Max\:%6.1lf%s\\l' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
-
}
?>
Modified: trunk/monitor-core/web/graph.d/packet_report.php
===================================================================
--- trunk/monitor-core/web/graph.d/packet_report.php 2011-02-11 20:54:33 UTC (rev 2473)
+++ trunk/monitor-core/web/graph.d/packet_report.php 2011-02-12 00:35:42 UTC (rev 2474)
@@ -22,6 +22,9 @@
$rrdtool_graph['height'] += ($size == 'medium') ? 28 : 0;
if ( $graphreport_stats ) {
$rrdtool_graph['height'] += ($size == 'medium') ? 52 : 0;
+ $rmspace = '\\g';
+ } else {
+ $rmspace = '';
}
if ($context != 'host') {
@@ -29,61 +32,57 @@
} else {
$rrdtool_graph['title'] = "$hostname $title last $range";
}
- $rrdtool_graph['lower-limit'] = '0';
+ $rrdtool_graph['lower-limit'] = '0';
$rrdtool_graph['vertical-label'] = 'Packets/sec';
- $rrdtool_graph['extras'] = '--rigid --base 1024';
+ $rrdtool_graph['extras'] = '--base 1024';
+ $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
if ($size == 'small') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '\\l';
- $space1 = ' ';
- $space2 = ' ';
- }
- if ($size == 'medium') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:7' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = '';
+ $eol1 = '\\l';
+ $space1 = ' ';
+ $space2 = ' ';
+ } if ($size == 'medium' || $size == 'default') {
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = '';
} else if ($size == 'large') {
- $rrdtool_graph['extras'] .= ($graphreport_stats == true) ? ' --font LEGEND:10' : '';
- $eol1 = '';
- $space1 = ' ';
- $space2 = ' ';
+ $eol1 = '';
+ $space1 = ' ';
+ $space2 = ' ';
}
$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\\g' ";
+ . "DEF:'pkts_out'='${rrd_dir}/pkts_out.rrd':'sum':AVERAGE "
+ . "LINE2:'pkts_in'#$mem_cached_color:'In${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:pktsin_pos=pkts_in,0,LT,0,pkts_in,IF "
+ $series .= "CDEF:pktsin_pos=pkts_in,0,INF,LIMIT "
. "VDEF:pktsin_last=pktsin_pos,LAST "
. "VDEF:pktsin_min=pktsin_pos,MINIMUM "
. "VDEF:pktsin_avg=pktsin_pos,AVERAGE "
. "VDEF:pktsin_max=pktsin_pos,MAXIMUM "
. "GPRINT:'pktsin_last':' ${space1}Now\:%6.1lf%s' "
- . "GPRINT:'pktsin_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'pktsin_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'pktsin_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'pktsin_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'pktsin_max':'${space1}Max\:%6.1lf%s\\l' ";
}
- $series .= "LINE2:'pkts_out'#$mem_used_color:'Out\\g' ";
+ $series .= "LINE2:'pkts_out'#$mem_used_color:'Out${rmspace}' ";
if ( $graphreport_stats ) {
- $series .= "CDEF:pktsout_pos=pkts_out,0,LT,0,pkts_out,IF "
+ $series .= "CDEF:pktsout_pos=pkts_out,0,INF,LIMIT "
. "VDEF:pktsout_last=pktsout_pos,LAST "
. "VDEF:pktsout_min=pktsout_pos,MINIMUM "
. "VDEF:pktsout_avg=pktsout_pos,AVERAGE "
. "VDEF:pktsout_max=pktsout_pos,MAXIMUM "
. "GPRINT:'pktsout_last':'${space1}Now\:%6.1lf%s' "
- . "GPRINT:'pktsout_min':'Min\:%6.1lf%s${eol1}' "
+ . "GPRINT:'pktsout_min':'${space1}Min\:%6.1lf%s${eol1}' "
. "GPRINT:'pktsout_avg':'${space2}Avg\:%6.1lf%s' "
- . "GPRINT:'pktsout_max':'Max\:%6.1lf%s\\l' ";
+ . "GPRINT:'pktsout_max':'${space1}Max\:%6.1lf%s\\l' ";
}
$rrdtool_graph['series'] = $series;
return $rrdtool_graph;
-
}
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|