Files
0a8f24c5b1 Cisco enhanced cellular (#12463)
* Cisco enhanced cellular support

* Extra sensors, camelcasing and bugfixes

* Doc update

* German translation

* French translation

* Style fixes

* Style changes

* Style changes

* Style changes

* Style changes

* Style changes

* Added test data

* New test data --variant

* New test data --variant ir1101

* Made the new wireless sensors generic

* Added test data for ios variant ir809

* Fix includes/discovery/sensors/count/cisco.inc.php, thanks PipoCanaja

* Moved cellular operating band from Wireless sensors to count sensor

* test data

* test data

* test data

* test data

* Moved ICCID/IMSI/IMEI to inventory

* test data and style fix

* Cellular state sensors now have a group

Co-authored-by: Maikel de Boer <[email protected]>
2021-03-02 06:37:30 -06:00

36 lines
1.7 KiB
PHP

<?php
/*
* LibreNMS - Cisco count sensors
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*
* @package LibreNMS
* @subpackage webui
* @link http://librenms.org
* @copyright 2021 LibreNMS
* @author LibreNMS Contributors
*/
$tables = [
['num_oid' => '.1.3.6.1.4.1.9.9.661.1.3.2.1.6.', 'oid' => 'c3gGsmNumberOfNearbyCell', 'state_name' => 'c3gGsmNumberOfNearbyCell', 'mib' => 'CISCO-WAN-3G-MIB', 'descr' => 'Nearby cells'],
['num_oid' => '.1.3.6.1.4.1.9.9.817.1.1.1.1.1.6.', 'oid' => 'cwceLteCurrOperatingBand', 'state_name' => 'cwceLteCurrOperatingBand', 'mib' => 'CISCO-WAN-CELL-EXT-MIB', 'descr' => 'Cellular operating band'],
];
foreach ($tables as $tablevalue) {
$temp = snmpwalk_cache_multi_oid($device, $tablevalue['oid'], [], $tablevalue['mib']);
$cur_oid = $tablevalue['num_oid'];
$state_name = $tablevalue['state_name'];
foreach ($temp as $index => $entry) {
//Discover Sensors
$descr = ucwords($temp[$index][$tablevalue['descr']]);
if ($state_name == 'c3gGsmNumberOfNearbyCell' || $state_name == 'cwceLteCurrOperatingBand') {
$descr = snmp_get($device, 'entPhysicalName.' . $index, '-Oqv', 'ENTITY-MIB') . ' - ' . $tablevalue['descr'];
}
discover_sensor($valid['sensor'], 'count', $device, $cur_oid . $index, $index, $state_name, $descr, 1, 1, null, null, null, null, $temp[$index][$tablevalue['state_name']], 'snmp', $index);
}
}