-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds support for sagemcom * requested changes * delete unused variable * logos * modules fine tuning * code style * Update sagemcom.svg * Update sagemcom.svg
- Loading branch information
1 parent
e82f1fc
commit 49f0197
Showing
25 changed files
with
12,244 additions
and
0 deletions.
There are no files selected for viewing
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,67 @@ | ||
<?php | ||
/** | ||
* equipStatusTrap.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 <http://www.gnu.org/licenses/>. | ||
* | ||
* @package LibreNMS | ||
* @link http://librenms.org | ||
* @copyright 2018 Vitali Kari | ||
* @author Vitali Kari <vitali.kari@gmail.com> | ||
*/ | ||
|
||
namespace LibreNMS\Snmptrap\Handlers; | ||
|
||
use App\Models\Device; | ||
use LibreNMS\Interfaces\SnmptrapHandler; | ||
use LibreNMS\Snmptrap\Trap; | ||
|
||
class EquipStatusTrap 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) | ||
{ | ||
$state = $trap->getOidData('EQUIPMENT-MIB::equipStatus.0'); | ||
|
||
$severity = $this->getSeverity($state); | ||
log_event('SNMP Trap: Equipment Status ' . $state, $device->toArray(), 'state', $severity); | ||
} | ||
|
||
private function getSeverity($state) | ||
{ | ||
$severity_map = [ | ||
'warning' => 4, | ||
'major' => 4, | ||
'5' => 4, | ||
'3' => 4, | ||
'critical' => 5, | ||
'4' => 5, | ||
'minor' => 3, | ||
'2' => 3, | ||
'nonAlarmed' => 1, | ||
'1' => 1, | ||
]; | ||
return $severity_map[$state] ?? 0; | ||
} | ||
} |
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,74 @@ | ||
<?php | ||
/** | ||
* logTrap.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 <http://www.gnu.org/licenses/>. | ||
* | ||
* @package LibreNMS | ||
* @link http://librenms.org | ||
* @copyright 2018 Vitali Kari | ||
* @author Vitali Kari <vitali.kari@gmail.com> | ||
*/ | ||
|
||
namespace LibreNMS\Snmptrap\Handlers; | ||
|
||
use App\Models\Device; | ||
use LibreNMS\Interfaces\SnmptrapHandler; | ||
use LibreNMS\Snmptrap\Trap; | ||
|
||
class LogTrap 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) | ||
{ | ||
$index = $trap->findOid('LOG-MIB::logIndex'); | ||
$index = $trap->getOidData($index); | ||
|
||
$logName = $trap->getOidData('LOG-MIB::logName.'.$index); | ||
$logEvent = $trap->getOidData('LOG-MIB::logEvent.'.$index); | ||
$logPC = $trap->getOidData('LOG-MIB::logPC.'.$index); | ||
$logAI = $trap->getOidData('LOG-MIB::logAI.'.$index); | ||
$state = $trap->getOidData('LOG-MIB::logEquipStatusV2.'.$index); | ||
|
||
$severity = $this->getSeverity($state); | ||
log_event('SNMP Trap: Log '.$logName.' '.$logEvent.' '.$logPC.' '.$logAI.' '.$state, $device->toArray(), 'log', $severity); | ||
} | ||
|
||
private function getSeverity($state) | ||
{ | ||
$severity_map = [ | ||
'warning' => 4, | ||
'major' => 4, | ||
'5' => 4, | ||
'3' => 4, | ||
'critical' => 5, | ||
'4' => 5, | ||
'minor' => 3, | ||
'2' => 3, | ||
'nonAlarmed' => 1, | ||
'1' => 1, | ||
]; | ||
return $severity_map[$state] ?? 0; | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
mib: EQUIPMENT-MIB | ||
modules: | ||
sensors: | ||
state: | ||
data: | ||
- | ||
oid: equipStatusV2 | ||
num_oid: '.1.3.6.1.4.1.1038.107.11.{{ $index }}' | ||
descr: Status of all equipment objects | ||
state_name: Severity | ||
states: | ||
- { value: 1, generic: 0, graph: 0, descr: nonAlarmed } | ||
- { value: 2, generic: 0, graph: 0, descr: minor } | ||
- { value: 3, generic: 1, graph: 0, descr: major } | ||
- { value: 4, generic: 2, graph: 0, descr: critical } | ||
- { value: 5, generic: 1, graph: 0, descr: warning } | ||
- { value: 6, generic: 0, graph: 0, descr: invNonAlarmed } | ||
- { value: 7, generic: 0, graph: 0, descr: invMinor } | ||
- { value: 8, generic: 1, graph: 0, descr: invMajor } | ||
- { value: 9, generic: 2, graph: 0, descr: invCritical } | ||
- { value: 10, generic: 1, graph: 0, descr: invWarning } |
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,28 @@ | ||
os: ionos | ||
text: 'Sagem ADR IONOS' | ||
type: network | ||
icon: sagemcom | ||
group: sagemcom | ||
over: | ||
- { graph: device_bits, text: 'Device Traffic' } | ||
discovery: | ||
- sysObjectID: | ||
- .1.3.6.1.4.1.1038 | ||
poller_modules: | ||
hr-mib: false | ||
ucd-mib: false | ||
stp: false | ||
ospf: false | ||
discovery_modules: | ||
processors: false | ||
mempools: false | ||
entity-physical: false | ||
storage: false | ||
hr-device: false | ||
discovery-protocols: false | ||
bgp-peers: false | ||
ports-stack: false | ||
vlans: false | ||
ucd-diskio: false | ||
stp: false | ||
fdb-table: false |
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,57 @@ | ||
--******************************************************************* | ||
--* SAGEM, IONOS * | ||
--******************************************************************* | ||
--******************************************************************* | ||
-- | ||
-- Filename: adr155c | ||
-- | ||
-- File type: .mib | ||
-- | ||
-- Description: SNMP source Mib file. | ||
-- | ||
-- Version: 19 11 2002 | ||
-- | ||
-- Date(DD MM YYYY): 15 11 02 last update for IONOS NMS | ||
-- | ||
-- Contact: D. Mobuchon, F. Bonnevialle | ||
-- | ||
-- History: | ||
-- Version: MIB-P0-301199 Date: 30 11 1999 | ||
-- | ||
-- Name: F.Bonnevialle | ||
-- Date: 15 11 2002 | ||
-- Desc: Modification for SilverCreek Compiler | ||
--******************************************************************* | ||
--******************************************************************* | ||
--* Copyright (c) 2002, SAGEM , All rights reserved. * | ||
--******************************************************************* | ||
|
||
|
||
|
||
|
||
--******************************************************************* | ||
-- MIB: ADR155C-MIB | ||
--******************************************************************* | ||
ADR155C-MIB DEFINITIONS ::= BEGIN | ||
|
||
IMPORTS | ||
sagemDr FROM SAGEM-DR-MIB | ||
MODULE-IDENTITY FROM SNMPv2-SMI ; | ||
|
||
-- SRU : | ||
|
||
|
||
adr155c MODULE-IDENTITY | ||
LAST-UPDATED "0211150000Z" | ||
ORGANIZATION "SAGEM-Tolbiac drd/ddp/tmhd" | ||
CONTACT-INFO | ||
" " | ||
DESCRIPTION | ||
"The MIB module specific for ARD155c equipment" | ||
::= { sagemDr 12 } | ||
|
||
|
||
|
||
|
||
END | ||
|
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,54 @@ | ||
--******************************************************************* | ||
--* SAGEM, IONOS * | ||
--******************************************************************* | ||
--******************************************************************* | ||
-- | ||
-- Filename: adr2500c | ||
-- | ||
-- File type: .mib | ||
-- | ||
-- Description: SNMP source Mib file. | ||
-- | ||
-- Version: 19 11 2002 | ||
-- | ||
-- Date(DD MM YYYY): 15 11 02 last update for IONOS NMS | ||
-- | ||
-- Contact: D. Mobuchon, F. Bonnevialle | ||
-- | ||
-- History: | ||
-- Version: MIB-P0-301199 Date: 30 11 1999 | ||
-- | ||
-- Name: F.Bonnevialle | ||
-- Date: 15 11 2002 | ||
-- Desc: Modification for SilverCreek Compiler | ||
--******************************************************************* | ||
--******************************************************************* | ||
--* Copyright (c) 2002, SAGEM , All rights reserved. * | ||
--******************************************************************* | ||
|
||
|
||
|
||
|
||
--******************************************************************* | ||
-- MIB: ADR2500C-MIB | ||
--******************************************************************* | ||
ADR2500C-MIB DEFINITIONS ::= BEGIN | ||
|
||
IMPORTS | ||
sagemDr FROM SAGEM-DR-MIB | ||
MODULE-IDENTITY FROM SNMPv2-SMI ; | ||
|
||
adr2500c MODULE-IDENTITY | ||
LAST-UPDATED "0211150000Z" | ||
ORGANIZATION "SAGEM-Tolbiac drd/ddp/tmhd" | ||
CONTACT-INFO | ||
" " | ||
DESCRIPTION | ||
"The MIB module specific for ARD2500c equipment" | ||
::= { sagemDr 17 } | ||
|
||
|
||
|
||
|
||
END | ||
|
Oops, something went wrong.