mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Added model, processor, fan and power supply for Alcatel Omnistack Switches * Removed Index from description of Fan and power supply * Merged PR #10655 * Added Temperature Sensor for AOS7+ Alcatel Enterprise Switches * Added AOS7 mempools * Added Tests * Update aos.yaml * Update alerts levels in state sensors * Add test data
30 lines
1.2 KiB
PHP
30 lines
1.2 KiB
PHP
<?php
|
|
echo "Checking Fan Speed...\n";
|
|
$rpm=[];
|
|
$rpm_oid = '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.11.1'; // alaChasEntPhysFanTable
|
|
$data = snmp_walk($device, 'alaChasEntPhysFanTable', "-OQUn", 'ALCATEL-IND1-CHASSIS-MIB', ':mibs/nokia/aos7:mibs');
|
|
foreach (explode("\n", $data) as $entry) {
|
|
list($oid,$value) = explode('=', $entry, 2);
|
|
$oid = trim($oid);
|
|
$value = trim($value, "\" \\\n\r");
|
|
list($revindex, $revchass, $revdata,) = explode('.', strrev($oid), 4);
|
|
if (!strstr($value, 'at this OID') && !empty($oid)) {
|
|
$chassis=strrev($revchass);
|
|
$index=strrev($revindex);
|
|
$data=strrev($revdata);
|
|
$rpm[$chassis][$index][$data] = $value;
|
|
}
|
|
}
|
|
if (is_array($rpm)) {
|
|
foreach ($rpm as $chassis => $entry) {
|
|
foreach ($entry as $index => $data) {
|
|
$descr = 'Chassis '.($chassis-450). " Fan $index";
|
|
$value = $data[4];
|
|
$id= "$chassis.$index";
|
|
$oid= "$rpm_oid.4.$chassis.$index";
|
|
echo "$descr: $value\n";
|
|
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $id, 'alcatel-lucent', $descr, '1', '1', null, null, null, null, $value, 'snmp');
|
|
}
|
|
}
|
|
}
|