mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix load graph (fixed per-os specific graphs for device-level graphs *only*)
git-svn-id: http://www.observium.org/svn/observer/trunk@1157 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -21,6 +21,7 @@ if($_GET['debug']) {
|
|||||||
|
|
||||||
if($_GET['device']) {
|
if($_GET['device']) {
|
||||||
$_GET['id'] = $_GET['device'];
|
$_GET['id'] = $_GET['device'];
|
||||||
|
$device_id = $_GET['device'];
|
||||||
} elseif($_GET['if']) {
|
} elseif($_GET['if']) {
|
||||||
$_GET['id'] = $_GET['if'];
|
$_GET['id'] = $_GET['if'];
|
||||||
} elseif($_GET['port']) {
|
} elseif($_GET['port']) {
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
else if(strstr($sysDescr, "sparc64")) { $hardware = "Generic SPARC 64-bit"; }
|
else if(strstr($sysDescr, "sparc64")) { $hardware = "Generic SPARC 64-bit"; }
|
||||||
$cmd = $config['snmpget'] . " -m UCD-SNMP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']. " .1.3.6.1.4.1.2021.7890.1.3.1.1.6.100.105.115.116.114.111";
|
$cmd = $config['snmpget'] . " -m UCD-SNMP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']. " .1.3.6.1.4.1.2021.7890.1.3.1.1.6.100.105.115.116.114.111";
|
||||||
$features = trim(`$cmd`);
|
$features = trim(`$cmd`);
|
||||||
$features = str_replace("No Such Object available on this agent at this OID", "", $features);
|
|
||||||
$features = str_replace("\"", "", $features);
|
$features = str_replace("\"", "", $features);
|
||||||
|
if(preg_match("@No\ Such@", $features)||preg_match("@No\ such@", $features)) { unset($features); }
|
||||||
// Detect Dell hardware via OpenManage SNMP
|
// Detect Dell hardware via OpenManage SNMP
|
||||||
$cmd = $config['snmpget'] . " -m MIB-Dell-10892 -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " .1.3.6.1.4.1.674.10892.1.300.10.1.9.1";
|
$cmd = $config['snmpget'] . " -m MIB-Dell-10892 -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " .1.3.6.1.4.1.674.10892.1.300.10.1.9.1";
|
||||||
$hw = trim(str_replace("\"", "", `$cmd`));
|
$hw = trim(str_replace("\"", "", `$cmd`));
|
||||||
|
|||||||
@@ -122,9 +122,10 @@
|
|||||||
if($port[$oid]) {
|
if($port[$oid]) {
|
||||||
$oid_diff = $this_port[$oid] - $port[$oid];
|
$oid_diff = $this_port[$oid] - $port[$oid];
|
||||||
$oid_rate = $oid_diff / $polled_period;
|
$oid_rate = $oid_diff / $polled_period;
|
||||||
|
if($oid_rate < 0) { $oid_rate = "0"; }
|
||||||
$update .= ", `".$oid."_rate` = '".$oid_rate."'";
|
$update .= ", `".$oid."_rate` = '".$oid_rate."'";
|
||||||
$update .= ", `".$oid."_delta` = '".$oid_diff."'";
|
$update .= ", `".$oid."_delta` = '".$oid_diff."'";
|
||||||
#echo("\n $oid ($oid_diff B) $oid_rate Bps $polled_period secs\n");
|
if($debug) {echo("\n $oid ($oid_diff B) $oid_rate Bps $polled_period secs\n");}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ while($processor = mysql_fetch_array($proc_data)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$proc = trim(str_replace("\"", "", $proc));
|
$proc = trim(str_replace("\"", "", $proc));
|
||||||
list($proc) = split(" ", $proc);
|
list($proc) = preg_split("@\ @", $proc);
|
||||||
|
|
||||||
echo($proc . "%\n");
|
echo($proc . "%\n");
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ while ($device = mysql_fetch_array($device_query)) {
|
|||||||
eventlog("OS Version -> $version", $device['device_id']);
|
eventlog("OS Version -> $version", $device['device_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $features && $features != $device['features'] ) {
|
if ( $features != $device['features'] ) {
|
||||||
$poll_update .= $poll_separator . "`features` = '$features'";
|
$poll_update .= $poll_separator . "`features` = '$features'";
|
||||||
$poll_separator = ", ";
|
$poll_separator = ", ";
|
||||||
eventlog("OS Features -> $features", $device['device_id']);
|
eventlog("OS Features -> $features", $device['device_id']);
|
||||||
|
|||||||
Reference in New Issue
Block a user