Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
936 B
PHP
Raw Permalink Normal View History

2011-09-23 13:54:40 +00:00
<?php
2020-09-21 15:40:17 +02:00
2011-09-23 13:54:40 +00:00
$scale_min = '0';
$scale_max = '100';
2019-04-11 23:26:42 -05:00
require 'includes/html/graphs/common.inc.php';
2011-09-23 13:54:40 +00:00
$rrd_options .= " COMMENT:' Cur Max\\n'";
2011-09-23 13:54:40 +00:00
$colour = toner2colour($toner['supply_descr'], 100 - $toner['supply_current']);
if ($colour['left'] == null) {
$colour['left'] = 'CC0000';
}
2011-09-23 13:54:40 +00:00
2021-03-28 17:25:30 -05:00
$descr = \LibreNMS\Data\Store\Rrd::safeDescr(substr(str_pad($toner['supply_descr'], 26), 0, 26));
2011-09-23 13:54:40 +00:00
$background = \LibreNMS\Util\Color::percentage((100 - $toner['supply_current']));
2011-09-23 13:54:40 +00:00
$rrd_options .= ' DEF:toner' . $toner['supply_id'] . '=' . $rrd_filename . ':toner:AVERAGE ';
2011-09-23 13:54:40 +00:00
$rrd_options .= ' LINE1:toner' . $toner['supply_id'] . '#' . $colour['left'] . ":'" . $descr . "' ";
2011-09-23 13:54:40 +00:00
$rrd_options .= ' AREA:toner' . $toner['supply_id'] . '#' . $background['right'] . ':';
$rrd_options .= ' GPRINT:toner' . $toner['supply_id'] . ":LAST:'%5.0lf%%'";
$rrd_options .= ' GPRINT:toner' . $toner['supply_id'] . ':MAX:%5.0lf%%\l';