2009-10-27 13:04:16 +00:00
|
|
|
<?php
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
require 'includes/graphs/common.inc.php';
|
2012-04-05 16:47:39 +00:00
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_filename = rrd_name($device['hostname'], 'ucd_cpu');
|
2011-03-17 13:35:25 +00:00
|
|
|
$rrd_options .= " DEF:user=$rrd_filename:user:AVERAGE";
|
|
|
|
$rrd_options .= " DEF:nice=$rrd_filename:nice:AVERAGE";
|
|
|
|
$rrd_options .= " DEF:system=$rrd_filename:system:AVERAGE";
|
|
|
|
$rrd_options .= " DEF:idle=$rrd_filename:idle:AVERAGE";
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' CDEF:total=user,nice,system,idle,+,+,+';
|
|
|
|
$rrd_options .= ' CDEF:user_perc=user,total,/,100,*';
|
|
|
|
$rrd_options .= ' CDEF:nice_perc=nice,total,/,100,*';
|
|
|
|
$rrd_options .= ' CDEF:system_perc=system,total,/,100,*';
|
|
|
|
$rrd_options .= ' CDEF:idle_perc=idle,total,/,100,*';
|
2011-09-18 18:22:07 +00:00
|
|
|
$rrd_options .= " COMMENT:'Usage Current Average Maximum\\n'";
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' AREA:user_perc#c02020:user';
|
2011-09-18 18:22:07 +00:00
|
|
|
$rrd_options .= " GPRINT:user_perc:LAST:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:user_perc:AVERAGE:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:user_perc:MAX:' %5.2lf%%\\n'";
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' AREA:nice_perc#008f00:nice:STACK';
|
2011-09-18 18:22:07 +00:00
|
|
|
$rrd_options .= " GPRINT:nice_perc:LAST:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:nice_perc:AVERAGE:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:nice_perc:MAX:' %5.2lf%%\\n'";
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' AREA:system_perc#ea8f00:system:STACK';
|
2011-09-18 18:22:07 +00:00
|
|
|
$rrd_options .= " GPRINT:system_perc:LAST:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:system_perc:AVERAGE:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:system_perc:MAX:' %5.2lf%%\\n'";
|
2015-07-13 20:10:26 +02:00
|
|
|
$rrd_options .= ' AREA:idle_perc#f8f8f3:idle:STACK';
|
2011-09-18 18:22:07 +00:00
|
|
|
$rrd_options .= " GPRINT:idle_perc:LAST:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:idle_perc:AVERAGE:' %5.2lf%%'";
|
|
|
|
$rrd_options .= " GPRINT:idle_perc:MAX:' %5.2lf%%\\n'";
|