Skip to content

Commit

Permalink
Merge branch 'librenms:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMysteriousX authored Feb 11, 2024
2 parents 722ca74 + 5769d73 commit 4954305
Show file tree
Hide file tree
Showing 44 changed files with 38,218 additions and 143 deletions.
183 changes: 81 additions & 102 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/definitions/discovery/adva_fsp150.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ modules:
- { value: 35, generic: 2, graph: 0, descr: 'PSU B Failed' }
- { value: 53, generic: 2, graph: 0, descr: 'SFP Mismatch' }
- { value: 59, generic: 2, graph: 0, descr: 'Over Temperature' }
- { value: 60, generic: 2, graph: 0, descr: 'Under Tempurature' }
- { value: 60, generic: 2, graph: 0, descr: 'Under Temperature' }
- { value: 65, generic: 2, graph: 0, descr: 'Input Power Fault' }
- { value: 86, generic: 3, graph: 0, descr: 'SNMP Dying Gasp - Host Unreachable' }
- { value: 90, generic: 3, graph: 0, descr: 'SFP Non Qualified' }
Expand Down
78 changes: 78 additions & 0 deletions includes/definitions/discovery/eltex-mes24xx.yaml
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 }}'
2 changes: 1 addition & 1 deletion includes/definitions/discovery/exa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ modules:
- oid: E7-Calix-MIB::e7OltPonPortTable
value: E7-Calix-MIB::e7OltPonPortTemperature
num_oid: '.1.3.6.1.4.1.6321.1.2.2.2.1.6.2.1.5.{{ $index }}'
descr: '{{ $subindex0 }}/{{ $subindex1 }}/{{ $subindex2 }} Tempurature'
descr: '{{ $subindex0 }}/{{ $subindex1 }}/{{ $subindex2 }} Temperature'
group: PON
low_limit: -40
low_warn_limit: -25
Expand Down
16 changes: 15 additions & 1 deletion includes/definitions/discovery/ios.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mib: POWER-ETHERNET-MIB:CISCO-POWER-ETHERNET-EXT-MIB:CISCO-ENTITY-FRU-CONTROL-MIB
mib: POWER-ETHERNET-MIB:CISCO-POWER-ETHERNET-EXT-MIB:CISCO-ENTITY-FRU-CONTROL-MIB:CISCO-HSRP-MIB
modules:
sensors:
pre-cache:
Expand Down Expand Up @@ -33,6 +33,20 @@ modules:
descr: "PoE Devices Connected"
state:
data:
-
oid: cHsrpGrpTable
value: cHsrpGrpStandbyState
num_oid: '.1.3.6.1.4.1.9.9.106.1.2.1.1.15.{{ $index }}'
descr: 'HSRP Status {{ $cHsrpGrpVirtualIpAddr }}'
index: 'cHsrpGrpStandbyState.{{ $index }}'
group: 'HSRP'
states:
- { value: 1, generic: 2, graph: 0, descr: 'initial' }
- { value: 2, generic: 2, graph: 0, descr: 'learn' }
- { value: 3, generic: 1, graph: 0, descr: 'listen' }
- { value: 4, generic: 1, graph: 0, descr: 'speak' }
- { value: 5, generic: 0, graph: 0, descr: 'standby' }
- { value: 6, generic: 0, graph: 0, descr: 'active' }
-
oid: cefcModuleOperStatus
value: cefcModuleOperStatus
Expand Down
2 changes: 1 addition & 1 deletion includes/definitions/edfamux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: solidoptics
mib_dir: solidoptics
over:
- { graph: device_dbm, text: 'dBm' }
- { graph: device_temperature, text: 'Tempurature' }
- { graph: device_temperature, text: 'Temperature' }
discovery:
-
sysObjectID:
Expand Down
29 changes: 29 additions & 0 deletions includes/definitions/eltex-mes24xx.yaml
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 includes/discovery/entity-physical/eltex-mes24xx.inc.php
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
);
43 changes: 43 additions & 0 deletions includes/discovery/ipv6-addresses/eltex-mes24xx.inc.php
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']);
}
}
}
12 changes: 7 additions & 5 deletions includes/discovery/route.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,13 @@
$mpls_vpn_route_nb = snmpwalk_group($device, $oid, $mib, 6, []);
$mpls_skip = false;

foreach ($mpls_vpn_route_nb as $vpnId => $route_nb) {
if ($route_nb['mplsL3VpnVrfPerfCurrNumRoutes'] > $max_routes) {
echo "Skipping all MPLS routes because vpn instance $vpnId has more than $max_routes routes.";
$mpls_skip = true;
break;
if (! empty($mpls_vpn_route_nb) && count($mpls_vpn_route_nb) > 1) {
foreach ($mpls_vpn_route_nb as $vpnId => $route_nb) {
if ($route_nb['mplsL3VpnVrfPerfCurrNumRoutes'] > $max_routes) {
echo "Skipping all MPLS routes because vpn instance $vpnId has more than $max_routes routes.";
$mpls_skip = true;
break;
}
}
}

Expand Down
Loading

0 comments on commit 4954305

Please sign in to comment.