Cisco C9800 Wireless Controller AP Count Support (#16342)

* Update CISCO-LWAPP-TC-MIB

Uploaded latest version from Cisco Feature Navigator

From the original Cisco MIB:
Deleted duplicate END in line 868
Change the names “dot11_6ghz” and “dot11_xor_5_6ghz” by removing the underscore (example: “dot11-6ghz” “dot11-xor-5-6ghz”)

* Update Iosxe.php

Added Wireless Controller module

* Update iosxe.yaml

Added AP count and Wireless Client

Credit to @AllanHahn

* Create iosxewlc.yaml

Added IOS-XE WLC. Need to add sysObjectID for the future devices beyond WLC9800.

System description has IOS-XE in it

* Update iosxe.yaml

* Update iosxe.yaml

WLC 9800 not included, have own YAML file

* Create iosxewlc.php

* Update Iosxe.php

Remove WLC Module

* Rename iosxewlc.php to Iosxewlc.php

* C9800 WLC detection

* Update iosxewlc.yaml

* Remove CiscoWLC notes

* Remove ISIS

* Update Iosxewlc.php

* Fix syntax

* Remove Cisco WLC notes

Need some cleanup since already created new PHP file for Cisco IOS-XE WLC

* Update Iosxewlc.php

* Update CISCO-LWAPP-AP-MIB

Downloaded the latest from Cisco MIBS to support AP count for Cisco WLC C9800 models.

* Update Copyright

* Change type from network to wireless

* Patterned with AirOS Cisco WLC

* Create iosxewlc_c9800.snmprec

Added test file

* styleci compliance

* styleci compliance

* styleci compliance

* Uploaded data from actual device

* styleci compliance

* styleci compliance - remove space

* Merge iosxe and iosxewlc 

As discussed

* Merhe iosxewlc.yaml to iosxe.yaml

No over graphs for Number of Clients and AP Count or IOSXE WLCs but still can view via Tabs

* remove iosxewlc.yaml

Covered by iosxe.yaml

* Delete iosxewlc.php

Covered by iosxe.php

* Rename iosxewlc_c9800.snmprec to iosxe_c9800.snmprec

due to removal of iosxewlc template which was merged.

* styleci compliance

* styleci compliance

* Update iosxe_c9800.snmprec

* Update iosxe_c9800.snmprec

* rerun-tests

* Remove pollOS block from Iosxe

* Check before polling and add additional IP discovery

* lint fix

* Added raw data from actual device

Convert sensitive data to <private>

* Create iosxe_c9800.json

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
jayceeemperador 2024-09-06 23:36:44 +08:00 committed by GitHub
parent c561efdc8f
commit 2ba6f164f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 116389 additions and 276 deletions

View File

@ -33,6 +33,7 @@ use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
use LibreNMS\Interfaces\Polling\OSPolling; use LibreNMS\Interfaces\Polling\OSPolling;
use LibreNMS\OS\Shared\Cisco; use LibreNMS\OS\Shared\Cisco;
use LibreNMS\RRD\RrdDefinition; use LibreNMS\RRD\RrdDefinition;
use SnmpQuery;
class Ciscowlc extends Cisco implements class Ciscowlc extends Cisco implements
OSPolling, OSPolling,
@ -41,6 +42,10 @@ class Ciscowlc extends Cisco implements
{ {
public function pollOS(DataStorageInterface $datastore): void public function pollOS(DataStorageInterface $datastore): void
{ {
if (! $this->getDevice()->wirelessSensors()->where('sensor_class', 'ap-count')->exists()) {
return; // if ap count doesn't exist, skip this polling TODO replace with wireless controller module
}
$device = $this->getDeviceArray(); $device = $this->getDeviceArray();
$apNames = \SnmpQuery::enumStrings()->walk('AIRESPACE-WIRELESS-MIB::bsnAPName')->table(1); $apNames = \SnmpQuery::enumStrings()->walk('AIRESPACE-WIRELESS-MIB::bsnAPName')->table(1);
$radios = \SnmpQuery::enumStrings()->walk('AIRESPACE-WIRELESS-MIB::bsnAPIfTable')->table(2); $radios = \SnmpQuery::enumStrings()->walk('AIRESPACE-WIRELESS-MIB::bsnAPIfTable')->table(2);
@ -192,15 +197,36 @@ class Ciscowlc extends Cisco implements
* *
* @return array Sensors * @return array Sensors
*/ */
public function discoverWirelessApCount() public function discoverWirelessApCount(): array
{ {
$oids = [ $data = SnmpQuery::get([
'CISCO-LWAPP-SYS-MIB::clsSysApConnectCount.0', 'CISCO-LWAPP-SYS-MIB::clsSysApConnectCount.0',
'AIRESPACE-SWITCHING-MIB::agentInventoryMaxNumberOfAPsSupported.0', 'AIRESPACE-SWITCHING-MIB::agentInventoryMaxNumberOfAPsSupported.0',
]; 'CISCO-LWAPP-AP-MIB::cLApGlobalAPConnectCount.0',
$data = snmp_get_multi($this->getDeviceArray(), $oids); 'CISCO-LWAPP-AP-MIB::cLApGlobalMaxApsSupported.0',
])->values();
if (isset($data[0]['clsSysApConnectCount'])) { if (isset($data['CISCO-LWAPP-AP-MIB::cLApGlobalAPConnectCount.0'])) {
return [
new WirelessSensor(
'ap-count',
$this->getDeviceId(),
'.1.3.6.1.4.1.9.9.513.1.3.35.0',
'ciscowlc',
0,
'Connected APs',
$data['CISCO-LWAPP-AP-MIB::cLApGlobalAPConnectCount.0'],
1,
1,
'sum',
null,
$data['CISCO-LWAPP-AP-MIB::cLApGlobalMaxApsSupported.0'],
0
),
];
}
if (isset($data['CISCO-LWAPP-SYS-MIB::clsSysApConnectCount.0'])) {
return [ return [
new WirelessSensor( new WirelessSensor(
'ap-count', 'ap-count',
@ -209,12 +235,12 @@ class Ciscowlc extends Cisco implements
'ciscowlc', 'ciscowlc',
0, 0,
'Connected APs', 'Connected APs',
$data[0]['clsSysApConnectCount'], $data['CISCO-LWAPP-SYS-MIB::clsSysApConnectCount.0'],
1, 1,
1, 1,
'sum', 'sum',
null, null,
$data[0]['agentInventoryMaxNumberOfAPsSupported'], $data['AIRESPACE-SWITCHING-MIB::agentInventoryMaxNumberOfAPsSupported.0'],
0 0
), ),
]; ];

View File

@ -31,7 +31,6 @@ use Illuminate\Support\Arr;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use LibreNMS\DB\SyncsModels; use LibreNMS\DB\SyncsModels;
use LibreNMS\Interfaces\Data\DataStorageInterface;
use LibreNMS\Interfaces\Discovery\IsIsDiscovery; use LibreNMS\Interfaces\Discovery\IsIsDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessCellDiscovery; use LibreNMS\Interfaces\Discovery\Sensors\WirelessCellDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessChannelDiscovery; use LibreNMS\Interfaces\Discovery\Sensors\WirelessChannelDiscovery;
@ -59,11 +58,6 @@ class Iosxe extends Ciscowlc implements
use SyncsModels; use SyncsModels;
use CiscoCellular; use CiscoCellular;
public function pollOS(DataStorageInterface $datastore): void
{
// Don't poll Ciscowlc FIXME remove when wireless-controller module exists
}
/** /**
* Array of shortened ISIS codes * Array of shortened ISIS codes
* *

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
-- CISCO-LWAPP-TC-MIB.my: Cisco LWAPP MIBs Textual Conventions -- CISCO-LWAPP-TC-MIB.my: Cisco LWAPP MIBs Textual Conventions
-- March 2006, Prasanna Viswakumar -- March 2006, Prasanna Viswakumar
-- --
-- Copyright (c) 2006, 2007, 2010-2011 by Cisco Systems Inc. -- Copyright (c) 2006-2007, 2010-2011, 2019, 2021-2022, 2024 by Cisco Systems, Inc.
-- All rights reserved. -- All rights reserved.
-- ******************************************************************* -- *******************************************************************
@ -24,7 +24,7 @@ IMPORTS
-- ******************************************************************** -- ********************************************************************
ciscoLwappTextualConventions MODULE-IDENTITY ciscoLwappTextualConventions MODULE-IDENTITY
LAST-UPDATED "201906270000Z" LAST-UPDATED "202211290000Z"
ORGANIZATION "Cisco Systems, Inc." ORGANIZATION "Cisco Systems, Inc."
CONTACT-INFO CONTACT-INFO
"Cisco Systems, "Cisco Systems,
@ -186,9 +186,15 @@ ciscoLwappTextualConventions MODULE-IDENTITY
[4] Enhanced Wireless Consortium PHY Specification, [4] Enhanced Wireless Consortium PHY Specification,
v1.27." v1.27."
REVISION "202211290000Z"
DESCRIPTION
"Added new enum value to CLApIfType."
REVISION "201608230000Z" REVISION "201608230000Z"
DESCRIPTION DESCRIPTION
"Added new textual conventions CLApMode" "Added new enum value 3 to CLDot11Band."
REVISION "201608230000Z"
DESCRIPTION
"Added new textual conventions CLApMode"
REVISION "201109130000Z" REVISION "201109130000Z"
DESCRIPTION DESCRIPTION
"Added new textual conventions CcxServiceVersion" "Added new textual conventions CcxServiceVersion"
@ -237,14 +243,26 @@ CLApIfType ::= TEXTUAL-CONVENTION
and 802.11bg. and 802.11bg.
uwb - This value indicates that this is a Ultra uwb - This value indicates that this is a Ultra
Wideband Interface." Wideband Interface.
rlan - This value indicates that this is a RLAN
interface.
dot11_6ghz - This value indicates that the radio
interface is following 802.11 6ghz standard.
dot11_xor_5_6ghz - This value indicates that the
radio interface is operating in XOR mode between
802.11a and 802.11 6ghz."
SYNTAX INTEGER { SYNTAX INTEGER {
dot11bg(1), dot11bg(1),
dot11a(2), dot11a(2),
uwb(3), uwb(3),
dot11abgn(4), dot11abgn(4),
unknown(5) rlan(5),
dot11-6ghz(6),
dot11-xor-5-6ghz(7)
} }
CLDot11Channel ::= TEXTUAL-CONVENTION CLDot11Channel ::= TEXTUAL-CONVENTION
@ -614,10 +632,14 @@ CLDot11Band ::= TEXTUAL-CONVENTION
2.4 GHz band is in use. 2.4 GHz band is in use.
band5 - This value indicates that the band5 - This value indicates that the
5 GHz band is in use." 5 GHz band is in use.
maui-6ghz - This value indicates that the
6 GHz band is in use."
SYNTAX INTEGER { SYNTAX INTEGER {
band2dot4(1), band2dot4(1),
band5(2) band5(2),
maui-6ghz(3)
} }
CLApAssocFailureReason ::= TEXTUAL-CONVENTION CLApAssocFailureReason ::= TEXTUAL-CONVENTION
@ -759,36 +781,86 @@ CcxServiceVersion ::= TEXTUAL-CONVENTION
} }
CLApMode ::= TEXTUAL-CONVENTION CLApMode ::= TEXTUAL-CONVENTION
STATUS current STATUS current
DESCRIPTION DESCRIPTION
"This textual convention defines the working "This textual convention defines the working
mode of the AP. mode of the AP.
local(0) - This mode enables the access points local(0) - This mode enables the access points
to serve the clients. to serve the clients.
monitor(1) - This mode enables the access points monitor(1) - This mode enables the access points
to monitor all of its cycles scanning to monitor all of its cycles scanning
the channels and looking for rogues. the channels and looking for rogues.
remote(2) - This mode indicates that AP is a remote remote(2) - This mode indicates that AP is a remote
edge lightweight access point. edge lightweight access point.
rogueDetector(3)- This mode enables the access points rogueDetector(3)- This mode enables the access points
to detect the rogue access points. to detect the rogue access points.
sniffer(4) - This mode enables the access points sniffer(4) - This mode enables the access points
to sniff packets in a particular channel. to sniff packets in a particular channel.
bridge(5) - This mode indicates that a root access point. bridge(5) - This mode indicates that a root access point.
is connected is connected
seConnect(6) - This mode enables the access points seConnect(6) - This mode enables the access points
to join Cisco spectrum expert and to join Cisco spectrum expert and
perform spectrum intelligence." perform spectrum intelligence.
remoteBridge(7) - This mode indicates that AP is a remote
SYNTAX INTEGER { edge lightweight access point in Bridge
(Flex + Mesh) mode.
remoteHybrid(8) - This mode is currently not used.
sensor(9) - This mode indicates the radio inside
the access point to function as a
dedicated sensor."
SYNTAX INTEGER {
local(0), local(0),
monitor(1), monitor(1),
remote(2), remote(2),
rogueDetector(3), rogueDetector(3),
sniffer(4), sniffer(4),
bridge(5), bridge(5),
seConnect(6) seConnect(6),
} remoteBridge(7),
remoteHybrid(8),
sensor(9)
}
Dscp ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"An integer that is in the range of the diffserv codepoint
values."
SYNTAX INTEGER (0..63)
CLApNtpStatus ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"This textual convention defines the NTP status.
The semantics are as follows:
notValid - This value indicates NTP status is not valid.
none - This value indicates NTP status is not received.
unreachable - This value indicates that NTP server is not
reachable.
synched - This value indicates NTP server is syched.
notSynched - This value indicates NTP server is not sycnhed.
waitSynch - This value indicates NTP server is waiting to be sycnhed.
authFail - This value indicates NTP server authentication failed.
notSuitable - This value indicates NTP server is not suitable for AP.
"
SYNTAX INTEGER {
notValid(1),
none(2),
unreachable(3),
synched(4),
notSynched(5),
waitSynch(6),
authFail(7),
notSuitable(8),
unknown(9)
}
END END

3146
tests/data/iosxe_c9800.json Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff