mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Major changes to graphing system organisation. Prevent sensors from being discovered in ENTITY-SENSOR-MIB if they've already been detected in CISCO-ENTITY-SENSOR-MIB (they share entPhysicalIndex). Fix ADSL poller. Make popup overlibs prettier as default.
git-svn-id: http://www.observium.org/svn/observer/trunk@1470 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
33
html/includes/graphs/processor/usage.inc.php
Executable file
33
html/includes/graphs/processor/usage.inc.php
Executable file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
include("common.inc.php");
|
||||
|
||||
$iter = "1";
|
||||
|
||||
$sql = mysql_query("SELECT * FROM `processors` AS P, `devices` AS D where P.`processor_id` = '".mres($_GET['id'])."' AND P.device_id = D.device_id");
|
||||
$rrd_options .= " COMMENT:' Cur Max\\n'";
|
||||
while($proc = mysql_fetch_array($sql)) {
|
||||
if($iter=="1") {$colour="CC0000";} elseif($iter=="2") {$colour="008C00";} elseif($iter=="3") {$colour="4096EE";
|
||||
} elseif($iter=="4") {$colour="73880A";} elseif($iter=="5") {$colour="D01F3C";} elseif($iter=="6") {$colour="36393D";
|
||||
} elseif($iter=="7") {$colour="FF0084"; unset($iter); }
|
||||
$descr = substr(str_pad(short_hrDeviceDescr($proc['processor_descr']), 28),0,28);
|
||||
$descr = str_replace(":", "\:", $descr);
|
||||
$rrd = $config['rrd_dir'] . "/".$proc['hostname']."/" . safename("processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
|
||||
$rrd_options .= " DEF:proc" . $proc['hrDeviceIndex'] . "=$rrd:usage:AVERAGE ";
|
||||
$rrd_options .= " DEF:proc_max=$rrd:usage:MAX";
|
||||
$rrd_options .= " DEF:proc_min=$rrd:usage:MIN";
|
||||
|
||||
$rrd_options .= " AREA:proc_max#c5c5c5";
|
||||
$rrd_options .= " AREA:proc_min#ffffffff";
|
||||
|
||||
$rrd_options .= " LINE1:proc" . $proc['hrDeviceIndex'] . "#" . $colour . ":'" . $descr . "' ";
|
||||
$rrd_options .= " GPRINT:proc" . $proc['hrDeviceIndex'] . ":LAST:%3.0lf";
|
||||
$rrd_options .= " GPRINT:proc" . $proc['hrDeviceIndex'] . ":MAX:%3.0lf\\\l ";
|
||||
$iter++;
|
||||
}
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user