mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
MegaRaid controller in Linux (Broadcom/LSI) (#12999)
* Add power consumed
* Revert "Add power consumed"
This reverts commit 424554ac04bd340de2fd962cb6808045024ef783.
* Start with tempsensorts aus some states
* Inventory data
* Convert plugins to Blade
* Revert "Convert plugins to Blade"
This reverts commit 8d1d3ff5b1.
* fix style
* Add FANs and Powersupplies
* fix style
* add test data
* add a short description for the doc
* refresh Testfile
This commit is contained in:
@@ -105,6 +105,7 @@ by following the steps under the `SNMP Extend` heading.
|
||||
1. [Mailcow-dockerized postfix](#mailcow-dockerized-postfix) - SNMP extend
|
||||
1. [Mailscanner](#mailscanner) - SNMP extend
|
||||
1. [Mdadm](#mdadm) - SNMP extend
|
||||
1. [MegaRAID](#megaraid) - SNMP extend
|
||||
1. [Memcached](#memcached) - SNMP extend
|
||||
1. [Munin](#munin) - Agent
|
||||
1. [MySQL](#mysql) - SNMP extend, Agent
|
||||
@@ -924,6 +925,21 @@ The application should be auto-discovered as described at the
|
||||
top of the page. If it is not, please follow the steps set out
|
||||
under `SNMP Extend` heading top of page.
|
||||
|
||||
|
||||
## MegaRAID
|
||||
|
||||
This software from Broadcom/LSI let you monitor MegaRAID controller.
|
||||
|
||||
1. Download the [external software](https://docs.broadcom.com/docs/1211132411799) and follow the included install instructions.
|
||||
|
||||
2. Add the following line to your snmpd.conf file (usually /etc/snmp/snmpd.conf)
|
||||
```
|
||||
pass .1.3.6.1.4.1.3582 /usr/sbin/lsi_mrdsnmpmain
|
||||
```
|
||||
|
||||
3. Restart snmpd on your host
|
||||
|
||||
|
||||
## Memcached
|
||||
|
||||
### SNMP Extend
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
mib: LSI-MegaRAID-SAS-MIB
|
||||
modules:
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
-
|
||||
oid: adapterPropertiesTable
|
||||
value: temperatureROC
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.2.1.42.{{ $index }}'
|
||||
index: 'controllertemp.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adapterID-APT }}'
|
||||
descr: 'Controller'
|
||||
-
|
||||
oid: bbuTable
|
||||
value: temperature
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.6.2.1.16.{{ $index }}'
|
||||
index: 'bbutemp.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adpID }}'
|
||||
descr: 'BBU'
|
||||
-
|
||||
oid: physicalDriveTable
|
||||
value: pdTemperature
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.2.1.2.1.36.{{ $index }}'
|
||||
index: 'slot.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adpID-PDT }} Enclosure {{ enclDeviceId }}'
|
||||
descr: '/c{{ $adpID-PDT }}/e{{ $enclDeviceId }}/s{{ $slotNumber }}'
|
||||
count:
|
||||
data:
|
||||
-
|
||||
oid: adapterPropertiesTable
|
||||
value: vdPresentCount
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.2.1.18.{{ $index }}'
|
||||
index: 'vdsum.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adapterID-APT }}'
|
||||
descr: 'Virtual disks'
|
||||
-
|
||||
oid: adapterPropertiesTable
|
||||
value: pdDiskPredFailureCount
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.2.1.19.{{ $index }}'
|
||||
index: 'vdfail.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adapterID-APT }}'
|
||||
warn_limit: 1
|
||||
descr: 'Virtual disk failure'
|
||||
-
|
||||
oid: adapterPropertiesTable
|
||||
value: pdDiskPredFailureCount
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.2.1.23.{{ $index }}'
|
||||
index: 'criticaldisks.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adapterID-APT }}'
|
||||
warn_limit: 1
|
||||
descr: 'Critical disks'
|
||||
-
|
||||
oid: adapterPropertiesTable
|
||||
value: pdDiskFailedCount
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.2.1.24.{{ $index }}'
|
||||
index: 'faileddisks.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adapterID-APT }}'
|
||||
warn_limit: 1
|
||||
descr: 'Failed disks'
|
||||
state:
|
||||
data:
|
||||
-
|
||||
oid: adapterPropertiesTable
|
||||
value: alarmState
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.2.1.4.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adapterID-APT }}'
|
||||
descr: 'Alarm'
|
||||
state_name: alarmState
|
||||
states:
|
||||
- { descr: disabled , graph: 0, value: 0, generic: 1 }
|
||||
- { descr: enabled , graph: 0, value: 1, generic: 0 }
|
||||
-
|
||||
oid: enclosurePowerSupplyTable
|
||||
value: powerSupplyStatus
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.5.5.1.3.{{ $index }}'
|
||||
group: 'Enclosure {{ $enclosureId-EPST }}'
|
||||
descr: 'Powersupply {{ $powerSupplyID }}'
|
||||
state_name: powerSupplyStatus
|
||||
states:
|
||||
- { descr: invalid , graph: 0, value: 1, generic: 2 }
|
||||
- { descr: ok , graph: 0, value: 2, generic: 0 }
|
||||
- { descr: critical , graph: 0, value: 3, generic: 2 }
|
||||
- { descr: nonCritical , graph: 0, value: 4, generic: 1 }
|
||||
- { descr: unrecoverable , graph: 0, value: 5, generic: 2 }
|
||||
- { descr: notInstalled , graph: 0, value: 6, generic: 3 }
|
||||
- { descr: unknown , graph: 0, value: 7, generic: 1 }
|
||||
- { descr: notAvailible , graph: 0, value: 8, generic: 3 }
|
||||
-
|
||||
oid: enclosureFanTable
|
||||
value: fanStatus
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.5.3.1.3.{{ $index }}'
|
||||
group: 'Enclosure {{ $enclosureId }}'
|
||||
descr: 'FAN {{ $fanID }}'
|
||||
state_name: fanStatus
|
||||
states:
|
||||
- { descr: invalid , graph: 0, value: 1, generic: 2 }
|
||||
- { descr: ok , graph: 0, value: 2, generic: 0 }
|
||||
- { descr: critical , graph: 0, value: 3, generic: 2 }
|
||||
- { descr: nonCritical , graph: 0, value: 4, generic: 1 }
|
||||
- { descr: unrecoverable , graph: 0, value: 5, generic: 2 }
|
||||
- { descr: notInstalled , graph: 0, value: 6, generic: 3 }
|
||||
- { descr: unknown , graph: 0, value: 7, generic: 1 }
|
||||
- { descr: notAvailible , graph: 0, value: 8, generic: 3 }
|
||||
-
|
||||
oid: enclosureAlarmTable
|
||||
value: alarmStatus
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.5.7.{{ $index }}'
|
||||
group: 'Enclosure {{ $enclosureId-EAT }}'
|
||||
descr: 'Alarm'
|
||||
state_name: alarmStatus
|
||||
states:
|
||||
- { descr: invalid , graph: 0, value: 1, generic: 2 }
|
||||
- { descr: ok , graph: 0, value: 2, generic: 0 }
|
||||
- { descr: critical , graph: 0, value: 3, generic: 2 }
|
||||
- { descr: nonCritical , graph: 0, value: 4, generic: 1 }
|
||||
- { descr: unrecoverable , graph: 0, value: 5, generic: 2 }
|
||||
- { descr: notInstalled , graph: 0, value: 6, generic: 3 }
|
||||
- { descr: unknown , graph: 0, value: 7, generic: 1 }
|
||||
- { descr: notAvailible , graph: 0, value: 8, generic: 3 }
|
||||
-
|
||||
oid: bbuTable
|
||||
value: chargerStatus
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.6.2.1.20.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adpID }}'
|
||||
descr: 'BBU charger'
|
||||
state_name: chargerStatus
|
||||
states:
|
||||
- { descr: notAvailible, graph: 0, value: -1, generic: 3 }
|
||||
- { descr: off , graph: 0, value: 0, generic: 2 }
|
||||
- { descr: complete , graph: 0, value: 1, generic: 0 }
|
||||
- { descr: progress , graph: 0, value: 2, generic: 1 }
|
||||
-
|
||||
oid: bbuTable
|
||||
value: batteryReplacement
|
||||
num_oid: '.1.3.6.1.4.1.3582.4.1.4.1.6.2.1.27.{{ $index }}'
|
||||
group: 'RAID Controller {{ $adpID }}'
|
||||
descr: 'BBU replacement'
|
||||
state_name: batteryReplacement
|
||||
states:
|
||||
- { descr: not availible , graph: 0, value: -1, generic: 3 }
|
||||
- { descr: needsReplacement , graph: 0, value: 1, generic: 2 }
|
||||
- { descr: ok , graph: 0, value: 0, generic: 0 }
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
$controller_array = snmpwalk_cache_multi_oid($device, 'adapterInfoTable', $controller_array, 'LSI-MegaRAID-SAS-MIB');
|
||||
$enclosures = snmpwalk_cache_multi_oid($device, 'enclosureTable', $enclosures, 'LSI-MegaRAID-SAS-MIB');
|
||||
$drives = snmpwalk_cache_multi_oid($device, 'physicalDriveTable', $drives, 'LSI-MegaRAID-SAS-MIB');
|
||||
$bbus = snmpwalk_cache_multi_oid($device, 'bbuTable', $bbus, 'LSI-MegaRAID-SAS-MIB');
|
||||
|
||||
foreach ($controller_array as $controller) {
|
||||
// Discover the chassis
|
||||
$entity_array[] = [
|
||||
'entPhysicalIndex' => 200 + $controller['adapterID-AIT'],
|
||||
'entPhysicalParentRelPos' => $controller['adapterID-AIT'],
|
||||
'entPhysicalDescr' => '/C' . $controller['adapterID-AIT'],
|
||||
'entPhysicalClass' => 'port',
|
||||
'entPhysicalModelName' => $controller['productName'],
|
||||
'entPhysicalSerialNum' => $controller['serialNo'],
|
||||
'entPhysicalContainedIn' => '0',
|
||||
'entPhysicalVendorType' => $controller['adapterVendorID'],
|
||||
'entPhysicalFirmwareRev' => $controller['firmwareVersion'],
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($bbus as $bbu) {
|
||||
// Discover the chassis
|
||||
$entity_array[] = [
|
||||
'entPhysicalIndex' => 1000 + $bbu['pdIndex'],
|
||||
'entPhysicalClass' => 'charge',
|
||||
'entPhysicalModelName' => $bbu['deviceName'],
|
||||
'entPhysicalSerialNum' => $bbu['serialNumber'],
|
||||
'entPhysicalContainedIn' => 200 + $bbu['adpID'],
|
||||
'entPhysicalIsFRU' => 'true',
|
||||
'entPhysicalFirmwareRev' => $bbu['firmwareStatus'],
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($enclosures as $enclosure) {
|
||||
// Discover the chassis
|
||||
$entity_array[] = [
|
||||
'entPhysicalIndex' => 210 + $enclosure['deviceId'],
|
||||
'entPhysicalMfgName' => $enclosure['slotCount'],
|
||||
'entPhysicalParentRelPos' => $enclosure['deviceId'],
|
||||
'entPhysicalDescr' => '/C' . $enclosure['adapterID-CDIT'] . '/E' . $enclosure['deviceId'],
|
||||
'entPhysicalClass' => 'chassis',
|
||||
'entPhysicalModelName' => $enclosure['productID'],
|
||||
'entPhysicalSerialNum' => $enclosure['enclSerialNumber'],
|
||||
'entPhysicalContainedIn' => 200 + $enclosure['adapterID-CDIT'],
|
||||
'entPhysicalVendorType' => $enclosure['adapterVendorID'],
|
||||
'entPhysicalFirmwareRev' => $enclosure['firmwareVersion'],
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($drives as $drive) {
|
||||
// Discover the chassis
|
||||
$entity_array[] = [
|
||||
'entPhysicalIndex' => 500 + $drive['enclDeviceId'] * 100 + $drive['physDevID'],
|
||||
'entPhysicalParentRelPos' => $drive['slotNumber'],
|
||||
'entPhysicalDescr' => '/C' . $drive['adpID-PDT'] . '/E' . $drive['enclDeviceId'] . '/S' . $drive['slotNumber'],
|
||||
'entPhysicalClass' => 'drive',
|
||||
'entPhysicalModelName' => $drive['pdProductID'],
|
||||
'entPhysicalSerialNum' => $drive['pdSerialNumber'],
|
||||
'entPhysicalContainedIn' => 210 + $drive['enclDeviceId'],
|
||||
'entPhysicalIsFRU' => 'true',
|
||||
'entPhysicalFirmwareRev' => $drive['pdFwversion'],
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($entity_array as $entPhysicalIndex => $entry) {
|
||||
$entPhysicalIndex = array_key_exists('entPhysicalIndex', $entry) ? $entry['entPhysicalIndex'] : '';
|
||||
$entPhysicalDescr = array_key_exists('entPhysicalDescr', $entry) ? $entry['entPhysicalDescr'] : '';
|
||||
$entPhysicalClass = array_key_exists('entPhysicalClass', $entry) ? $entry['entPhysicalClass'] : '';
|
||||
$entPhysicalName = array_key_exists('entPhysicalName', $entry) ? $entry['entPhysicalName'] : '';
|
||||
$entPhysicalModelName = array_key_exists('entPhysicalModelName', $entry) ? $entry['entPhysicalModelName'] : '';
|
||||
$entPhysicalSerialNum = array_key_exists('entPhysicalSerialNum', $entry) ? $entry['entPhysicalSerialNum'] : '';
|
||||
$entPhysicalContainedIn = array_key_exists('entPhysicalContainedIn', $entry) ? $entry['entPhysicalContainedIn'] : '';
|
||||
$entPhysicalMfgName = array_key_exists('entPhysicalMfgName', $entry) ? $entry['entPhysicalMfgName'] : '';
|
||||
$entPhysicalParentRelPos = array_key_exists('entPhysicalParentRelPos', $entry) ? $entry['entPhysicalParentRelPos'] : '';
|
||||
$entPhysicalVendorType = array_key_exists('entPhysicalVendorType', $entry) ? $entry['entPhysicalVendorType'] : '';
|
||||
$entPhysicalHardwareRev = array_key_exists('entPhysicalHardwareRev', $entry) ? $entry['entPhysicalHardwareRev'] : '';
|
||||
$entPhysicalFirmwareRev = array_key_exists('entPhysicalFirmwareRev', $entry) ? $entry['entPhysicalFirmwareRev'] : '';
|
||||
$entPhysicalSoftwareRev = array_key_exists('entPhysicalSoftwareRev', $entry) ? $entry['entPhysicalSoftwareRev'] : '';
|
||||
$entPhysicalIsFRU = array_key_exists('entPhysicalIsFRU', $entry) ? $entry['entPhysicalIsFRU'] : '';
|
||||
$entPhysicalAlias = array_key_exists('entPhysicalAlias', $entry) ? $entry['entPhysicalAlias'] : '';
|
||||
$entPhysicalAssetID = array_key_exists('entPhysicalAssetID', $entry) ? $entry['entPhysicalAssetID'] : '';
|
||||
$ifIndex = array_key_exists('ifIndex', $entry) ? $entry['ifIndex'] : '';
|
||||
|
||||
discover_entity_physical($valid,
|
||||
$device,
|
||||
$entPhysicalIndex,
|
||||
$entPhysicalDescr,
|
||||
$entPhysicalClass,
|
||||
$entPhysicalName,
|
||||
$entPhysicalModelName,
|
||||
$entPhysicalSerialNum,
|
||||
$entPhysicalContainedIn,
|
||||
$entPhysicalMfgName,
|
||||
$entPhysicalParentRelPos,
|
||||
$entPhysicalVendorType,
|
||||
$entPhysicalHardwareRev,
|
||||
$entPhysicalFirmwareRev,
|
||||
$entPhysicalSoftwareRev,
|
||||
$entPhysicalIsFRU,
|
||||
$entPhysicalAlias,
|
||||
$entPhysicalAssetID,
|
||||
$ifIndex);
|
||||
}//end foreach
|
||||
|
||||
echo "\n";
|
||||
unset(
|
||||
$update_data,
|
||||
$insert_data,
|
||||
$entry,
|
||||
$entity_array
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user