mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Moved dnos health disco to powerconnect (#6331)
This commit is contained in:
committed by
Tony Murray
parent
9b62ea2cbf
commit
8a2f103144
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'powerconnect') {
|
||||
echo 'Powerconnect: ';
|
||||
|
||||
$free = snmp_get($device, 'dellLanExtension.6132.1.1.1.1.4.1.0', '-OvQ', 'Dell-Vendor-MIB');
|
||||
|
||||
if (is_numeric($free)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'powerconnect-cpu', 'CPU Memory', '1', null, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'powerconnect') {
|
||||
echo 'Powerconnect: ';
|
||||
|
||||
$free = snmp_get($device, 'dellLanExtension.6132.1.1.1.1.4.1.0', '-OvQ', 'Dell-Vendor-MIB');
|
||||
|
||||
if (is_numeric($free)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'powerconnect-cpu', 'CPU Memory', '1', null, null);
|
||||
}
|
||||
|
||||
echo 'DNOS-MEMORY-POOL: ';
|
||||
|
||||
$get_series = explode('.', snmp_get($device, 'mib-2.1.2.0', '-Onvsbq', 'F10-PRODUCTS-MIB', 'dnos'), 2); // Get series From MIB
|
||||
$series = $get_series[0];
|
||||
if ($series == 'f10SSeriesProducts') {
|
||||
$total = snmp_get($device, 'chSysProcessorMemSize.1', '-OvQU', 'F10-S-SERIES-CHASSIS-MIB');
|
||||
$used = $mempool['total'] * (snmp_get($device, 'F10-S-SERIES-CHASSIS-MIB::chStackUnitMemUsageUtil.1', '-OvQU')/ 100);
|
||||
$free = ($mempool['total'] - $mempool['used']);
|
||||
if (is_numeric($total) && is_numeric($used)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'dnos-mem', 'Memory Utilization', '1', null, null);
|
||||
}
|
||||
} else {
|
||||
$free = snmp_get($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.1.0', '-OvQ');
|
||||
if (is_numeric($free)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'dnos-mem', 'Memory Utilization', '1', null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,26 @@ if ($device['os'] == 'powerconnect') {
|
||||
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.4.0', '0', 'powerconnect', $descr, '1', $usage, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
echo 'DNOS CPU: ';
|
||||
$get_series = explode('.', snmp_get($device, 'mib-2.1.2.0', '-Onvsbq', 'F10-PRODUCTS-MIB', 'dnos'), 2); // Get series From MIB
|
||||
$series = $get_series[0];
|
||||
$descr = 'CPU';
|
||||
|
||||
if ($series == 'f10SSeriesProducts') {
|
||||
echo 'Dell S Series Chassis';
|
||||
$usage = trim(snmp_get($device, 'chStackUnitCpuUtil5Sec.1', '-OvQ', 'F10-S-SERIES-CHASSIS-MIB'));
|
||||
|
||||
discover_processor($valid['processor'], $device, 'F10-S-SERIES-CHASSIS-MIB::chStackUnitCpuUtil5Sec.1', '0', 'dnos-cpu', '1', $usage, null, null);
|
||||
} elseif ($series == 'f10CSeriesProducts') {
|
||||
echo 'Dell C Series Chassis';
|
||||
$usage = trim(snmp_get($device, 'chLineCardCpuUtil5Sec.1', '-OvQ', 'F10-S-SERIES-CHASSIS-MIB'));
|
||||
|
||||
discover_processor($valid['processor'], $device, 'F10-C-SERIES-CHASSIS-MIB::chLineCardCpuUtil5Sec.1', '0', 'dnos-cpu', '1', $usage, null, null);
|
||||
} else {
|
||||
preg_match('/(\d*\.\d*)/', snmp_get($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0', '-OvQ'), $matches);
|
||||
$usage = $matches[0];
|
||||
|
||||
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0', '0', 'dnos-cpu', $descr, '1', $usage, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,3 +36,37 @@ switch ($sysObjectId) {
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.4.0', 0, 'powerconnect', 'Internal Temperature', '1', '1', '0', null, null, '45', $temperature);
|
||||
}
|
||||
}
|
||||
|
||||
$temps = snmp_walk($device, '.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.43.1.8.1.5', '-Osqn');
|
||||
//This will return at least 4 OIDs (multiplied by the number of switches if stacked) and associated values for various temperatures
|
||||
|
||||
$counter = 0;
|
||||
|
||||
foreach (explode("\n", $temps) as $i => $t) {
|
||||
$t = explode(' ', $t);
|
||||
$oid = $t[0];
|
||||
$val = $t[1];
|
||||
|
||||
if (substr($oid, -1) == '1') {
|
||||
// This code will only pull CPU temp for each stack member, but there is no reason why the additional values couldn't be graphed
|
||||
$counter = $counter + 1;
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $counter, 'dnos', 'Unit ' . $counter . ' CPU temperature', '1', '1', null, null, null, null, $val);
|
||||
}
|
||||
}
|
||||
|
||||
// Force10 S-Series
|
||||
// F10-S-SERIES-CHASSIS-MIB::chStackUnitTemp.1 = Gauge32: 47
|
||||
// F10-S-SERIES-CHASSIS-MIB::chStackUnitModelID.1 = STRING: S25-01-GE-24V
|
||||
echo 'FTOS C-Series ';
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'chStackUnitTemp', array(), 'F10-S-SERIES-CHASSIS-MIB', 'ftos');
|
||||
$oids = snmpwalk_cache_oid($device, 'chStackUnitSysType', $oids, 'F10-S-SERIES-CHASSIS-MIB', 'ftos');
|
||||
|
||||
if (is_array($oids)) {
|
||||
foreach ($oids as $index => $entry) {
|
||||
$descr = 'Unit '.$index.' '.$entry['chStackUnitSysType'];
|
||||
$oid = '.1.3.6.1.4.1.6027.3.10.1.2.2.1.14.'.$index;
|
||||
$current = $entry['chStackUnitTemp'];
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'ftos-sseries', $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user