Files
Heath Barnhart 8a921567ba New OS: Ekinops (#12088)
* Initial push

* renamed mib files

* adding eki mgmt event trap handler

* Adding handler to config/snmptraps.php

* added slot state monitoring

* Ekinops port discovery script

* cleanup

* moved ifDescr change from discovery to poller

* simplified port poller script

* fixed poller array

* add Mgnt2TrapNMSEvent handler

* Adding nms alarm handler

* adding handler to snmptrap.php

* Updated handler names, exapanded event traphandler

* beginning tests and cleanup

* adding snmpsim data

* making tests

* finished trap tests

* fixed ekinops.yaml

* style and lint pass

* new snmpsim data and fixes

* adding correct snmpsim

* fixed test data

* Update ekinops.svg

* Update ekinops.svg

* Update ekinops.yaml

* new os discovery method

* remove unneeded precache line

* removing unneccesary pre-cache script

* styleci fixes

* few more style fixes

* trim whitespace in discovery

* remove unused mibs

Co-authored-by: Tony Murray <[email protected]>
2020-09-23 18:23:57 +02:00

55 lines
1.8 KiB
PHP

<?php
/**
* ekinops.inc.php
*
* -Description-
*
* The Ekinops interface naming scheme is overly verbose (see example).
* The ifDescr and ifName returned by the device are the same. This
* script reduces ifDescr to slot/card type/interface and sets ifAlias
* to the user defined description found on the interface's configuration
* on the Ekinops shelf.
*
* Example:
* ifName: EKINOPS/C600HC/13/PM_10010-MR/S10-Client10(PORT_Number 10)
* ifDescr: 13/PM_10010-MR/S10-Client10
* ifAlias: PORT_Number 10
*
* 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/>.
*
* Traps when Adva objects are created. This includes Remote User Login object,
* Flow Creation object, and LAG Creation object.
*
* @link http://librenms.org
* @copyright 2020 KanREN, Inc
* @author Heath Barnhart <[email protected]>
*/
foreach ($port_stats as $index => $port) {
/*
* Split up ifName and drop the EKIPS/Chassis
*/
$intName = preg_split("/[\/,\(,\)]/", $port['ifName']);
// Make ifDescr slot/card/int
$ifDescr = $intName[2] . '/' . $intName[3] . '/' . $intName[4];
// Make ifAlias descr
$ifAlias = $intName[5];
$port_stats[$index]['ifAlias'] = $ifAlias;
$port_stats[$index]['ifDescr'] = $ifDescr;
}