mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
adding more junose and foundry/brocade. adding new mibs. unifying processor polling
git-svn-id: http://www.observium.org/svn/observer/trunk@831 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,4 +1,37 @@
|
||||
<?php
|
||||
|
||||
$query = mysql_query("SELECT * FROM `processors` where `device_id` = '".mres($device_id)."'");
|
||||
|
||||
$i=0;
|
||||
while($proc = mysql_fetch_array($query)) {
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/$hostname/" . safename("processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
|
||||
|
||||
if(is_file($rrd_filename)) {
|
||||
|
||||
$descr = short_hrDeviceDescr($proc['processor_descr']);
|
||||
$descr = str_replace(":", "\:", $descr);
|
||||
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['rra'] = "usage";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units='%';
|
||||
$total_units='%';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if ($rrd_list) {
|
||||
include ("generic_multi_line.inc.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
$query = mysql_query("SELECT * FROM `cpmCPU` where `device_id` = '".mres($device_id)."'");
|
||||
|
||||
$i=0;
|
||||
while($proc = mysql_fetch_array($query)) {
|
||||
$rrd_filename = $config['rrd_dir'] . "/$hostname/" . safename("cpmCPU-" . $proc['cpmCPU_oid'] . ".rrd");
|
||||
if(is_file($rrd_filename)) {
|
||||
$descr = str_pad($proc['entPhysicalDescr'], 8);
|
||||
$descr = substr($descr,0,8);
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $descr;
|
||||
$rrd_list[$i]['rra'] = "usage";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$unit_text = "Load %";
|
||||
|
||||
$units='%';
|
||||
$total_units='%';
|
||||
$colours='mixed';
|
||||
|
||||
$scale_min = "0";
|
||||
$scale_max = "100";
|
||||
|
||||
$nototal = 1;
|
||||
|
||||
if($rrd_list) {include ("generic_multi_line.inc.php"); } else {
|
||||
include("common.inc.php");
|
||||
$database = $config['rrd_dir'] . "/" . $hostname . "/ios-cpu.rrd";
|
||||
$rrd_options .= " DEF:5m=$database:LOAD5M:AVERAGE";
|
||||
$rrd_options .= " DEF:5m_max=$database:LOAD5M:MAX";
|
||||
$rrd_options .= " DEF:5m_min=$database:LOAD5M:MIN";
|
||||
$rrd_options .= " COMMENT:\ \ \ \ \ \ \ \ \ \ Current\ \ Minimum\ \ Maximum\ \ Average\\\\n";
|
||||
$rrd_options .= " AREA:5m#ffee99: LINE1.25:5m#aa2200:Load\ %";
|
||||
$rrd_options .= " GPRINT:5m:LAST:%6.2lf\ GPRINT:5m_min:AVERAGE:%6.2lf\ ";
|
||||
$rrd_options .= " GPRINT:5m_max:MAX:%6.2lf\ GPRINT:5m:AVERAGE:%6.2lf\\\\n";
|
||||
}
|
||||
|
||||
?>
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
<?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); }
|
||||
$proc['descr_fixed'] = substr(str_pad(short_hrDeviceDescr($proc['hrDeviceDescr']), 28),0,28);
|
||||
$proc['descr_fixed'] = str_replace(":", "\:", $proc['descr_fixed']);
|
||||
$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 .= " LINE1:proc" . $proc['hrDeviceIndex'] . "#" . $colour . ":'" . $proc['descr_fixed'] . "' ";
|
||||
$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