mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Better ServerIron support
This commit is contained in:
@@ -1,15 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($device['os'] == "serveriron") {
|
if ($device['os'] == 'serveriron') {
|
||||||
echo("nos: ");
|
echo 'ServerIron Dynamic: ';
|
||||||
|
|
||||||
$used = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
|
$percent = snmp_get($device, 'snAgGblDynMemUtil.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||||
$total = "100";
|
|
||||||
$free = ($total - $used);
|
|
||||||
|
|
||||||
$percent = $used;
|
if (is_numeric($percent)) {
|
||||||
|
discover_mempool($valid_mempool, $device, 0, 'ServerIron', 'Dynamic Memory', '1', null, null);
|
||||||
if (is_numeric($used)) {
|
|
||||||
discover_mempool($valid_mempool, $device, 0, "serveriron", "Memory", "1", NULL, NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,39 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ($device['os'] == "serveriron") {
|
if ($device['os'] == 'serveriron') {
|
||||||
echo("serveriron : ");
|
echo 'ServerIron : ';
|
||||||
|
$processors_array = snmpwalk_cache_triple_oid($device, 'snAgentCpuUtilEntry', $processors_array, 'FOUNDRY-SN-AGENT-MIB');
|
||||||
|
d_echo($processors_array);
|
||||||
|
|
||||||
$descr = "CPU";
|
foreach ($processors_array as $index => $entry) {
|
||||||
$usage = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq");
|
if (($entry['snAgentCpuUtilValue'] || $entry['snAgentCpuUtil100thPercent']) && $entry['snAgentCpuUtilInterval'] == '300') {
|
||||||
|
// $entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
|
||||||
|
if ($entry['snAgentCpuUtil100thPercent']) {
|
||||||
|
$usage_oid = '.1.3.6.1.4.1.1991.1.1.2.11.1.1.6.'.$index;
|
||||||
|
$usage = $entry['snAgentCpuUtil100thPercent'];
|
||||||
|
$precision = 100;
|
||||||
|
}
|
||||||
|
else if ($entry['snAgentCpuUtilValue']) {
|
||||||
|
$usage_oid = '.1.3.6.1.4.1.1991.1.1.2.11.1.1.4.'.$index;
|
||||||
|
$usage = $entry['snAgentCpuUtilValue'];
|
||||||
|
$precision = 100;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_numeric($usage)) {
|
list($slot, $instance, $interval) = explode('.', $index);
|
||||||
discover_processor($valid['processor'], $device, "1.3.6.1.4.1.1588.2.1.1.1.26.1", "0", "serveriron", $descr, "1", $usage, NULL, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unset ($processors_array);
|
$descr_oid = 'snAgentConfigModuleDescription.'.$entry['snAgentCpuUtilSlotNum'];
|
||||||
|
$descr = snmp_get($device, $descr_oid, '-Oqv', 'FOUNDRY-SN-AGENT-MIB');
|
||||||
|
$descr = str_replace('"', '', $descr);
|
||||||
|
list($descr) = explode(' ', $descr);
|
||||||
|
|
||||||
|
$descr = 'Slot '.$entry['snAgentCpuUtilSlotNum'].' '.$descr;
|
||||||
|
$descr = $descr.' ['.$instance.']';
|
||||||
|
|
||||||
|
if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
|
||||||
|
discover_processor($valid['processor'], $device, $usage_oid, $index, 'serveriron', $descr, $precision, $usage, $entPhysicalIndex, null);
|
||||||
|
}
|
||||||
|
}//end if
|
||||||
|
}//end foreach
|
||||||
|
}//end if
|
||||||
|
|
||||||
|
unset($processors_array);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Somewhat of an uggly hack since Server doesn't support fetching total memory of the device over SNMP
|
// Simple hard-coded poller for Brocade Ironware Dynamic Memory (old style)
|
||||||
// Given OID returns usage in percent so we set total to 100 in order to get a proper graph
|
// Yes, it really can be this simple.
|
||||||
$mempool['total'] = "100";
|
$mempool['total'] = snmp_get($device, 'snAgGblDynMemTotal.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||||
$mempool['used'] = snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.6.0", "-Ovq");
|
$mempool['free'] = snmp_get($device, 'snAgGblDynMemFree.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB');
|
||||||
$mempool['free'] = ($mempool['total'] - $mempool['used']);
|
$mempool['used'] = ($mempool['total'] - $mempool['free']);
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$proc = trim(snmp_get($device, "1.3.6.1.4.1.1588.2.1.1.1.26.1.0", "-Ovq"),'"');
|
|
||||||
Reference in New Issue
Block a user