forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'librenms:master' into master
- Loading branch information
Showing
44 changed files
with
38,218 additions
and
143 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
mib: ELTEX-MES-ISS-CPU-UTIL-MIB:ELTEX-MES-ISS-ENV-MIB:ARICENT-ISS-MIB | ||
modules: | ||
os: | ||
serial: .1.3.6.1.4.1.2076.81.1.120.0 | ||
sysDescr_regex: '/(?<hardware>\S+\s\S+)/' | ||
version: ENTITY-MIB::entPhysicalFirmwareRev.1 | ||
features: ENTITY-MIB::entPhysicalSoftwareRev.1 | ||
|
||
processors: | ||
data: | ||
- | ||
oid: eltMesIssCpuUtilLastMinute | ||
num_oid: '.1.3.6.1.4.1.35265.1.139.6.1.1.2.2.0' | ||
mempools: | ||
data: | ||
- | ||
total: ARICENT-ISS-MIB::issSwitchMaxRAMUsage | ||
used: ARICENT-ISS-MIB::issSwitchCurrentRAMUsage | ||
descr: 'System Memory' | ||
sensors: | ||
pre-cache: | ||
data: | ||
- | ||
oid: | ||
- eltMesIssBatteryStatusTable | ||
state: | ||
data: | ||
- | ||
oid: eltMesIssBatteryStatusTable | ||
value: eltMesIssBatteryStatus | ||
num_oid: '.1.3.6.1.4.1.35265.1.139.12.1.3.1.1.2.{{ $index }}' | ||
descr: 'Backup battery status' | ||
group: 'Chassis PSU' | ||
index: 'eltMesIssBatteryStatus.{{ $index }}' | ||
states: | ||
- { value: 1, descr: NotSupported, graph: 1, generic: 3 } | ||
- { value: 2, descr: Missing, graph: 1, generic: 2 } | ||
- { value: 3, descr: Charging, graph: 1, generic: 1 } | ||
- { value: 4, descr: Low, graph: 1, generic: 2 } | ||
- { value: 5, descr: Discharged, graph: 1, generic: 2 } | ||
- { value: 6, descr: Charged, graph: 1, generic: 0 } | ||
charge: | ||
data: | ||
- | ||
oid: eltMesIssBatteryStatusTable | ||
value: eltMesIssBatteryLevel | ||
num_oid: '.1.3.6.1.4.1.35265.1.139.12.1.3.1.1.3.{{ $index }}' | ||
descr: 'Backup battery level' | ||
index: 'eltMesIssBatteryLevel.{{ $index }}' | ||
skip_values: | ||
- | ||
oid: eltMesIssBatteryStatus | ||
op: '<' | ||
value: '3' | ||
fanspeed: | ||
data: | ||
- | ||
oid: eltMesIssEnvFanTable | ||
value: eltMesIssEnvFanSpeedLevel | ||
num_oid: '.1.3.6.1.4.1.35265.1.139.12.1.5.1.1.2.{{ $index }}' | ||
descr: 'Fan {{ $index }}' | ||
index: 'eltMesIssEnvFanSpeedLevel.{{ $index }}' | ||
voltage: | ||
data: | ||
- | ||
oid: ARICENT-ISS-MIB::issSwitchCurrentPowerSupply | ||
value: ARICENT-ISS-MIB::issSwitchCurrentPowerSupply | ||
num_oid: '.1.3.6.1.4.1.2076.81.1.71.{{ $index }}' | ||
descr: 'Main PSU' | ||
index: 'issSwitchCurrentPowerSupply.{{ $index }}' | ||
temperature: | ||
data: | ||
- | ||
oid: ARICENT-ISS-MIB::issSwitchCurrentTemperature | ||
value: ARICENT-ISS-MIB::issSwitchCurrentTemperature | ||
num_oid: '.1.3.6.1.4.1.2076.81.1.66.{{ $index }}' | ||
descr: 'Chassis' | ||
index: 'issSwitchCurrentTemperature.{{ $index }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
os: eltex-mes24xx | ||
text: Eltex | ||
ifname: true | ||
type: network | ||
icon: eltex | ||
over: | ||
- { graph: device_bits, text: 'Device Traffic' } | ||
- { graph: device_processor, text: 'CPU Usage' } | ||
- { graph: device_mempool, text: 'Memory Usage' } | ||
|
||
discovery: | ||
- | ||
sysObjectID: | ||
- .1.3.6.1.4.1.35265.1.176 # MES2424B AC | ||
|
||
mib_dir: eltexmes24xx | ||
|
||
bad_iftype: | ||
- tunnel | ||
- softwareLoopback | ||
- propPointToPointSerial | ||
|
||
|
||
poller_modules: | ||
ospf: false | ||
mpls: false | ||
discovery_modules: | ||
ospf: false | ||
mpls: false |
105 changes: 105 additions & 0 deletions
105
includes/discovery/entity-physical/eltex-mes24xx.inc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
/* | ||
* LibreNMS discovery module for Eltex-MES24xx SFP inventory items | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* @package LibreNMS | ||
* @link https://www.librenms.org | ||
* | ||
* @copyright 2024 Peca Nesovanovic | ||
* @author Peca Nesovanovic <peca.nesovanovic@sattrakt.com> | ||
*/ | ||
|
||
echo ' ELTEX-MES24xx' . PHP_EOL; | ||
$oidSfp = SnmpQuery::cache()->hideMib()->walk('ELTEX-PHY-MIB::eltexPhyTransceiverInfoTable')->table(1); | ||
$oidEnt = SnmpQuery::cache()->hideMib()->walk('ENTITY-MIB::entPhysicalParentRelPos')->table(1); | ||
|
||
if (! empty($oidSfp) && ! empty($oidEnt)) { | ||
d_echo('ELTEX 24xx Inventory: Discovering ...' . PHP_EOL); | ||
$entity_array = []; | ||
$infoType = [0 => 'unknown', 1 => 'gbic', 2 => 'sff', 3 => 'sfp-sfpplus', 255 => 'vendorspecific']; | ||
$connType = [0 => 'unknown', 1 => 'SC', 7 => 'LC', 11 => 'optical-pigtail', 255 => 'vendorspecific']; | ||
|
||
foreach ($oidSfp as $index => $data) { | ||
foreach ($oidEnt as $entIndex => $entData) { | ||
if ($entData['entPhysicalParentRelPos'] == $index) { | ||
$entity_array[] = [ | ||
'entPhysicalIndex' => $index, | ||
'entPhysicalSerialNum' => $data['eltexPhyTransceiverInfoSerialNumber'], | ||
'entPhysicalModelName' => $data['eltexPhyTransceiverInfoPartNumber'], | ||
'entPhysicalName' => $connType[$data['eltexPhyTransceiverInfoConnectorType']], | ||
'entPhysicalDescr' => $infoType[$data['eltexPhyTransceiverInfoType']], | ||
'entPhysicalClass' => 'sfp-cage', | ||
'entPhysicalContainedIn' => $entIndex, | ||
'entPhysicalMfgName' => $data['eltexPhyTransceiverInfoVendorName'], | ||
'entPhysicalHardwareRev' => $data['eltexPhyTransceiverInfoVendorRevision'], | ||
'entPhysicalIsFRU' => 'true', | ||
]; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
foreach ($entity_array as $entPhysicalIndex => $entry) { | ||
$entPhysicalIndex = $entry['entPhysicalIndex'] ?? ''; | ||
$entPhysicalDescr = $entry['entPhysicalDescr'] ?? ''; | ||
$entPhysicalClass = $entry['entPhysicalClass'] ?? ''; | ||
$entPhysicalName = $entry['entPhysicalName'] ?? ''; | ||
$entPhysicalModelName = $entry['entPhysicalModelName'] ?? ''; | ||
$entPhysicalSerialNum = $entry['entPhysicalSerialNum'] ?? ''; | ||
$entPhysicalContainedIn = $entry['entPhysicalContainedIn'] ?? ''; | ||
$entPhysicalMfgName = $entry['entPhysicalMfgName'] ?? ''; | ||
$entPhysicalParentRelPos = $entry['entPhysicalParentRelPos'] ?? ''; | ||
$entPhysicalVendorType = $entry['entPhysicalVendorType'] ?? ''; | ||
$entPhysicalHardwareRev = $entry['entPhysicalHardwareRev'] ?? ''; | ||
$entPhysicalFirmwareRev = $entry['entPhysicalFirmwareRev'] ?? ''; | ||
$entPhysicalSoftwareRev = $entry['entPhysicalSoftwareRev'] ?? ''; | ||
$entPhysicalIsFRU = $entry['entPhysicalIsFRU'] ?? ''; | ||
$entPhysicalAlias = $entry['entPhysicalAlias'] ?? ''; | ||
$entPhysicalAssetID = $entry['entPhysicalAssetID'] ?? ''; | ||
$ifIndex = $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( | ||
$modules_array, | ||
$entry, | ||
$entity_array, | ||
$trans, | ||
$mapping | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* IPv6 address discovery file for eltex-mes24xx OS | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* @link https://www.librenms.org | ||
* | ||
* @copyright 2024 Peca Nesovanovic | ||
* @author Peca Nesovanovic <peca.nesovanovic@sattrakt.com> | ||
*/ | ||
|
||
//IP-MIB | ||
$oids = SnmpQuery::hideMib()->walk('IP-MIB::ipAddressPrefixTable')->table(3); | ||
|
||
if (! empty($oids)) { | ||
d_echo('Eltex 24xx IPv6 discovering ...'); | ||
|
||
foreach ($oids as $index => $indexData) { | ||
foreach ($indexData as $addrType => $addrData) { | ||
if ($addrType != 'ipv6') { | ||
continue; | ||
} | ||
$v6addr = normalize_snmp_ip_address(key($addrData)); | ||
$addrData = array_shift($addrData); | ||
$prefixArr = $addrData['ipAddressPrefixOrigin']; | ||
$prefixLen = key($prefixArr); | ||
$prefixType = $prefixArr[$prefixLen]; | ||
discover_process_ipv6($valid, $index, $v6addr, $prefixLen, 'manual', $device['context_name']); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.