mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add Alcatel Omniswitch Traps Handlers (#13492)
* first * style1 * lint * add another trap * add another trap * change juniper to alcatel * style * style * style
This commit is contained in:
59
LibreNMS/Snmptrap/Handlers/AlechassisTrapsAlert.php
Normal file
59
LibreNMS/Snmptrap/Handlers/AlechassisTrapsAlert.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* AlechassisTrapsAlert.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class AlechassisTrapsAlert implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$descr_aos6 = $trap->getOidData($trap->findOid('ALCATEL-IND1-CHASSIS-MIB::chassisTrapsAlertDescr'));
|
||||
$descr_aos7 = $trap->getOidData($trap->findOid('ALCATEL-IND1-CHASSIS-MIB::chassisTrapsAlertDescr.0'));
|
||||
|
||||
if (! empty($descr_aos6)) {
|
||||
Log::event("$descr_aos6", $device->device_id, 'trap', 2);
|
||||
} elseif (! empty($descr_aos7)) {
|
||||
Log::event("$descr_aos7", $device->device_id, 'trap', 2);
|
||||
}
|
||||
}
|
||||
}
|
53
LibreNMS/Snmptrap/Handlers/Aos6CfgSavedTrap.php
Normal file
53
LibreNMS/Snmptrap/Handlers/Aos6CfgSavedTrap.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos6CfgSavedTrap.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 Paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos6CfgSavedTrap implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$descr = $trap->getOidData($trap->findOid('ALCATEL-IND1-CONFIG-MGR-MIB::alcatelIND1ConfigMgrMIB.3.1.1'));
|
||||
Log::event("$descr", $device->device_id, 'trap', 2);
|
||||
}
|
||||
}
|
58
LibreNMS/Snmptrap/Handlers/Aos6DoSTrap.php
Normal file
58
LibreNMS/Snmptrap/Handlers/Aos6DoSTrap.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos6DoSTrap.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos6DoSTrap implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$type = $trap->getOidData($trap->findOid('ALCATEL-IND1-IP-MIB::alaDoSType'));
|
||||
$detected = $trap->getOidData($trap->findOid('ALCATEL-IND1-IP-MIB::alaDoSDetected'));
|
||||
$ip = $trap->getOidData($trap->findOid('ALCATEL-IND1-IP-MIB::alaDoSIp'));
|
||||
$slot = $trap->getOidData($trap->findOid('ALCATEL-IND1-IP-MIB::alaDoSSlot'));
|
||||
$port = $trap->getOidData($trap->findOid('ALCATEL-IND1-IP-MIB::alaDoSPort'));
|
||||
$mac = $trap->getOidData($trap->findOid('ALCATEL-IND1-IP-MIB::alaDoSMac'));
|
||||
Log::event("There has been detected a Denial of Service (DoS) attack. Type of the attack is: $type. Number of attacks are: $detected. Slot where was received is: $slot. Source IP is: $ip. Mac address is: $mac.", $device->device_id, 'trap', 2);
|
||||
}
|
||||
}
|
53
LibreNMS/Snmptrap/Handlers/Aos6HicServerTrap.php
Normal file
53
LibreNMS/Snmptrap/Handlers/Aos6HicServerTrap.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos6HicServerTrap.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 Paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos6HicServerTrap implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$ip = $trap->getOidData($trap->findOid('ALCATEL-IND1-AAA-MIB::aaaHSvrIpAddress'));
|
||||
Log::event("Radius server with the IP: $ip might be unreachable or recovered.", $device->device_id, 'trap', 2);
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos6LbdStateChangeForAutoRecovery.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 Paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos6LbdStateChangeForAutoRecovery implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$before = $trap->getOidData($trap->findOid('ALCATEL-IND1-LBD-MIB::alaLbdPreviousStateAutoRecovery'));
|
||||
$current = $trap->getOidData($trap->findOid('ALCATEL-IND1-LBD-MIB::alaLbdCurrentStateAutoRecovery'));
|
||||
$ifIndex = $trap->getOidData($trap->findOid('ALCATEL-IND1-LBD-MIB::alaLbdPortIfIndex'));
|
||||
$port = $device->ports()->where('ifIndex', $ifIndex)->first();
|
||||
Log::event("Loopback detection has been recovered on the port $port->ifDescr. Status of the port before was $before and now is $current.", $device->device_id, 'trap', 1);
|
||||
}
|
||||
}
|
57
LibreNMS/Snmptrap/Handlers/Aos6LbdStateChangeToShutdown.php
Normal file
57
LibreNMS/Snmptrap/Handlers/Aos6LbdStateChangeToShutdown.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos6LbdStateChangeToShutdown
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 Paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos6LbdStateChangeToShutdown implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$before = $trap->getOidData($trap->findOid('ALCATEL-IND1-LBD-MIB::alaLbdPreviousState'));
|
||||
$current = $trap->getOidData($trap->findOid('ALCATEL-IND1-LBD-MIB::alaLbdCurrentState'));
|
||||
$ifDescr = $trap->getOidData($trap->findOid('IF-MIB::ifDescr'));
|
||||
$ifIndex = $trap->getOidData($trap->findOid('ALCATEL-IND1-LBD-MIB::alaLbdPortIfIndex'));
|
||||
$port = $device->ports()->where('ifIndex', $ifIndex)->first();
|
||||
Log::event("There has been a loop detected on the port $port->ifDescr. Status of the port before was $before and now is $current.", $device->device_id, 'trap', 5);
|
||||
}
|
||||
}
|
53
LibreNMS/Snmptrap/Handlers/Aos6StackMgrDuplicateSlot.php
Normal file
53
LibreNMS/Snmptrap/Handlers/Aos6StackMgrDuplicateSlot.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos6StackMgrDuplicateSlot.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos6StackMgrDuplicateSlot implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$slot_nr = $trap->getOidData($trap->findOid('ALCATEL-IND1-STACK-MANAGER-MIB::alaStackMgrSlotNINumber'));
|
||||
Log::event("Stack member $slot_nr is duplicated.", $device->device_id, 'trap', 5);
|
||||
}
|
||||
}
|
54
LibreNMS/Snmptrap/Handlers/Aos6StackMgrRoleChange.php
Normal file
54
LibreNMS/Snmptrap/Handlers/Aos6StackMgrRoleChange.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos6StackMgrRoleChange.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos6StackMgrRoleChange implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$p_nr = $trap->getOidData($trap->findOid('ALCATEL-IND1-STACK-MANAGER-MIB::alaStackMgrPrimary'));
|
||||
$s_nr = $trap->getOidData($trap->findOid('ALCATEL-IND1-STACK-MANAGER-MIB::alaStackMgrSecondary'));
|
||||
Log::event("Stack management change.Primary unit of the stack is now chassis: $p_nr. Secondary unit of the stack is now chassis: $s_nr.", $device->device_id, 'trap', 2);
|
||||
}
|
||||
}
|
57
LibreNMS/Snmptrap/Handlers/Aos7portViolation.php
Normal file
57
LibreNMS/Snmptrap/Handlers/Aos7portViolation.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos7portViolation.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos7portViolation implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$reason = $trap->getOidData($trap->findOid('ALCATEL-IND1-PORT-MIB::portViolationSource.2.0'));
|
||||
$current = $trap->getOidData($trap->findOid('ALCATEL-IND1-PORT-MIB::portViolationReason.3.0'));
|
||||
$ifDescr = $trap->getOidData($trap->findOid('IF-MIB::ifDescr'));
|
||||
$ifIndex = $trap->getOidData($trap->findOid('IF-MIB::ifIndex'));
|
||||
$port = $device->ports()->where('ifIndex', $ifIndex)->first();
|
||||
Log::event("There has been a loop detected on the port $port->ifDescr. The source code of the violation is: $reason and the current status code is: $current.", $device->device_id, 'trap', 5);
|
||||
}
|
||||
}
|
56
LibreNMS/Snmptrap/Handlers/Aos7portViolationNotification.php
Normal file
56
LibreNMS/Snmptrap/Handlers/Aos7portViolationNotification.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos7portViolationNotification.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* Alcatel configuration change trap. Includes interface used to affect
|
||||
* the change, the user, and the system time when the change was made.
|
||||
* If a commit confirmed is rolled back the source is "other" and the
|
||||
* user is "root".
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*
|
||||
* @copyright 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos7portViolationNotification implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
$reason = $trap->getOidData($trap->findOid('ALCATEL-IND1-PORT-MIB::portViolationRecoveryReason.1.0'));
|
||||
$ifDescr = $trap->getOidData($trap->findOid('IF-MIB::ifDescr'));
|
||||
$ifIndex = $trap->getOidData($trap->findOid('IF-MIB::ifIndex'));
|
||||
$port = $device->ports()->where('ifIndex', $ifIndex)->first();
|
||||
Log::event("There has been a loop detected on the port $port->ifDescr. The current status code is: $reason.", $device->device_id, 'trap', 5);
|
||||
}
|
||||
}
|
47
LibreNMS/Snmptrap/Handlers/Aos7stpNewRoot.php
Normal file
47
LibreNMS/Snmptrap/Handlers/Aos7stpNewRoot.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos7stpNewRoot.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos7stpNewRoot implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
Log::event('SNMP Trap: Device ' . $device->displayName() . ' was elected as new root on one of its Spanning Tree Instances', $device->device_id, 'stp', 3);
|
||||
}
|
||||
}
|
47
LibreNMS/Snmptrap/Handlers/Aos7stpRootPortChange.php
Normal file
47
LibreNMS/Snmptrap/Handlers/Aos7stpRootPortChange.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos7stpRootPortChange.php
|
||||
*
|
||||
* -Description-
|
||||
*
|
||||
* 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 2021 paulierco
|
||||
* @author Paul Iercosan <mail@paulierco.ro>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Snmptrap\Handlers;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\SnmptrapHandler;
|
||||
use LibreNMS\Snmptrap\Trap;
|
||||
use Log;
|
||||
|
||||
class Aos7stpRootPortChange implements SnmptrapHandler
|
||||
{
|
||||
/**
|
||||
* Handle snmptrap.
|
||||
* Data is pre-parsed and delivered as a Trap.
|
||||
*
|
||||
* @param Device $device
|
||||
* @param Trap $trap
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Device $device, Trap $trap)
|
||||
{
|
||||
Log::event('SNMP Trap: A root port has changed for a spanning tree bridge. The root port is the port that offers the lowest cost path from this bridge to the root bridge.', $device->device_id, 'stp', 3);
|
||||
}
|
||||
}
|
@@ -10,6 +10,18 @@
|
||||
|
||||
return [
|
||||
'trap_handlers' => [
|
||||
'ALCATEL-IND1-VLAN-STP-MIB::stpNewRoot' => \LibreNMS\Snmptrap\Handlers\Aos7stpNewRoot::class,
|
||||
'ALCATEL-IND1-VLAN-STP-MIB::stpRootPortChange' => \LibreNMS\Snmptrap\Handlers\Aos7stpRootPortChange::class,
|
||||
'ALCATEL-IND1-PORT-MIB::portViolationTrap' => \LibreNMS\Snmptrap\Handlers\Aos7portViolation::class,
|
||||
'ALCATEL-IND1-PORT-MIB::portViolationNotificationTrap' => \LibreNMS\Snmptrap\Handlers\Aos7portViolationNotification::class,
|
||||
'ALCATEL-IND1-CONFIG-MGR-MIB::alcatelIND1ConfigMgrMIB.3.0.1' => \LibreNMS\Snmptrap\Handlers\Aos6CfgSavedTrap::class,
|
||||
'ALCATEL-IND1-CHASSIS-MIB::chassisTrapsAlert' => \LibreNMS\Snmptrap\Handlers\AlechassisTrapsAlert::class,
|
||||
'ALCATEL-IND1-STACK-MANAGER-MIB::alaStackMgrDuplicateSlotTrap' => \LibreNMS\Snmptrap\Handlers\Aos6StackMgrDuplicateSlot::class,
|
||||
'ALCATEL-IND1-STACK-MANAGER-MIB::alaStackMgrRoleChangeTrap' => \LibreNMS\Snmptrap\Handlers\Aos6StackMgrRoleChange::class,
|
||||
'ALCATEL-IND1-IP-MIB::alaDoSTrap' => \LibreNMS\Snmptrap\Handlers\Aos6DoSTrap::class,
|
||||
'ALCATEL-IND1-LBD-MIB::alaLbdStateChangeToShutdown' => \LibreNMS\Snmptrap\Handlers\Aos6LbdStateChangeToShutdown::class,
|
||||
'ALCATEL-IND1-LBD-MIB::alaLbdStateChangeForAutoRecovery' => \LibreNMS\Snmptrap\Handlers\Aos6LbdStateChangeForAutoRecovery::class,
|
||||
'ALCATEL-IND1-AAA-MIB::aaaHicServerTrap' => \LibreNMS\Snmptrap\Handlers\Aos6HicServerTrap::class,
|
||||
'BGP4-MIB::bgpBackwardTransition' => \LibreNMS\Snmptrap\Handlers\BgpBackwardTransition::class,
|
||||
'BGP4-MIB::bgpEstablished' => \LibreNMS\Snmptrap\Handlers\BgpEstablished::class,
|
||||
'BGP4-V2-MIB-JUNIPER::jnxBgpM2BackwardTransition' => \LibreNMS\Snmptrap\Handlers\JnxBgpM2BackwardTransition::class,
|
||||
|
Reference in New Issue
Block a user