Monitoring Streaming Event
Monitoring Topic in Streaming API has multiple events in a single Topic. Currently, the subscriber cannot request filtering of specific events. Monitoring event messages are of two types:
- State message: An event is generated when there is a change in state. For example, an State event is generated when a device goes down
- Stats message: Continuous stream of statistics events are generated over an interval. The interval differs for every message and frequency varies based on multiple factors such as number of devices. An example of the Stats events are generation of switch port statistics for every switch port.
Following are the multiple monitoring device streaming events:
- Monitoring - IAP streaming event
- Monitoring - Gateway streaming event
- Monitoring - Client streaming event
- Monitoring - CX switch streaming event
- Monitoring - AOS switch streaming event
- Monitoring - Alerts
Snippet of the Monitoring Topic Protocol Buffer file
The below snippet of Monitoring topic .proto
file contains the supporting messages and enumerators used by other events in the Monitoring topic. To see the entire file check out HPE Aruba Networking Central's Streaming API page and download the protocol buffer file for Monitoring topic.
message IpAddress {
enum addr_family {
ADDR_FAMILY_INET = 2; // Internet IP Protocol
ADDR_FAMILY_INET6 = 10; // IP version 6
}
required addr_family af = 1;
required bytes addr = 2;
}
message MacAddress {
required bytes addr = 1;
}
enum Action {
ADD = 1;
DELETE = 2;
UPDATE = 3;
}
enum Status {
UP = 1;
DOWN = 2;
}
enum TunnelIndex {
PRIMARY = 0;
BACKUP = 1;
}
enum CryptoType {
CA_CERT = 0;
PSK = 1;
}
enum DataElement {
// State PB
STATE_CONTROLLER = 1;
STATE_SWITCH = 2;
STATE_SWARM = 3;
STATE_AP = 4;
STATE_VAP = 5;
STATE_RADIO = 6;
STATE_INTERFACE = 7;
STATE_NETWORK = 8;
STATE_TUNNEL = 9;
STATE_WIRELESSCLIENT = 10;
STATE_WIREDCLIENT = 11;
STATE_UPLINK = 12;
// Statistics PB
STAT_DEVICE = 13;
STAT_RADIO = 14;
STAT_VAP = 15;
STAT_INTERFACE = 16;
STAT_CLIENT = 17;
STAT_TUNNEL = 18;
STAT_MODEM = 19;
STAT_ROLE = 20;
STAT_VLAN = 21;
STAT_SSID = 22;
STAT_IPPROBE = 23;
STAT_UPLINK = 24;
STAT_UPLINKWAN = 25;
STAT_UPLINKIPPROBE = 26;
// Events PB
EVENTS_WIDS = 27;
EVENTS_ROGUE = 28;
STATS_UPLINK_SPEEDTEST = 29;
DEVICE_NEIGHBOURS = 30;
NOTIFICATIONS = 31;
SWITCH_STACK = 32;
STATE_IKE_TUNNEL = 33;
SWITCH_VLAN = 34;
STATE_VLAN = 35;
STATE_VSX = 36;
}
enum AuthType {
NONE = 1;
MAC_AUTH = 2;
DOT1X_AUTH = 3;
L3_AUTH = 4;
CONSOLE_AUTH = 5;
TELNET_AUTH = 6;
WEBUI_AUTH = 7;
SSH_AUTH = 8;
WEB_AUTH = 9;
SNMP_AUTH = 10;
SSH_NONE_AUTH = 11;
LMA_AUTH = 12;
ANY_AUTH = 13;
CAPTIVE_PORTAL = 14;
VPN_AUTH = 15;
STATEFUL_KERBEROS = 16;
RADIUS_ACCOUNTING = 17;
SECURE_ID = 18;
STATEFUL_RADIUS = 19;
SWITCH_MANAGEMENT = 20;
DOT1X_MACHINE = 21;
DOT1X_USER = 22;
DOT1X_WIRED = 23;
DOT1X_WIRED_MACHINE = 24;
DOT1X_WIRED_USER = 25;
PUB_COOKIE = 26;
TACACAS_PLUS = 27;
WIRELESS_XSEC = 28;
WIRELESS_XSEC_MACHINE = 29;
WIRELESS_XSEC_USER = 30;
WIRELESS_XSEC_WIRED = 31;
WIRELESS_XSEC_WIRED_MACHINE = 32;
WIRELESS_XSEC_WIRED_USER = 33;
STATEFUL_NTLM = 34;
RAP_AP = 35;
VIA_WEB = 36;
GENERIC_INTERFACE_SPEC = 37;
TRANSPORT_VPN = 38;
VIA_VPN = 39;
PUTN_DOT1X = 40;
PUTN_MAC = 41;
PUTN_CP = 42;
PUTN_LMA = 43;
NUM_AUTH_CLIENT = 44;
}
//The following protobuf is a collection of all the above PB structures. For
each state/stats processing, the worker will generate the Monitoring Information
protobuf and will publish it to streaming API.
message MonitoringInformation {
required string customer_id = 1;
repeated DataElement data_elements = 2;
repeated Swarm swarms = 3;
repeated Ap aps = 4;
repeated Network networks = 5;
repeated Radio radios = 6;
repeated VapInfo vaps = 7;
repeated Interface interfaces = 8;
repeated Tunnel tunnels = 9;
repeated WirelessClient wireless_clients = 10;
repeated Switch switches = 11;
repeated WiredClient wired_clients = 12;
repeated DeviceStats device_stats = 13;
repeated RadioStats radio_stats = 14;
repeated InterfaceStats interface_stats = 15;
repeated VapStats vap_stats = 16;
repeated ClientStats client_stats = 17;
repeated TunnelStats tunnel_stats = 18;
repeated WIDSEvent wids_events = 19;
repeated ModemStats modem_stats = 20;
repeated RoleStats role_stats = 21;
repeated VlanStats vlan_stats = 22;
repeated SsidStats ssid_stats = 23;
repeated TunnelIpProbeStats ipprobe_stats = 24;
repeated RogueEvent rogue_events = 25;
repeated MobilityController mobility_controllers = 26;
repeated Uplink uplinks = 27;
repeated UplinkStats uplink_stats = 28;
repeated UplinkWanStats uplink_wan_stats = 29;
repeated UplinkIpProbeStats uplink_probe_stats = 30;
repeated UplinkSpeedtest uplink_speedtest = 31;
repeated DeviceNeighbours device_neighbours = 32;
repeated Notification notification = 33;
repeated SwitchStack switch_stacks = 34;
repeated IkeTunnel ike_tunnels = 35;
optional SwitchVlanInfo switch_vlan_info = 36;
repeated Vlan vlans = 37;
optional VSXState vsx = 38;
optional uint32 timestamp = 39; // Time of occurrence of the event
}
Decoding the address field in MAC Address and IP Address
The address fields within "IpAddress" and "MacAddress" messages are of bytes
type. The bytes type is generally base64
encoded by most protocol buffer client libraries regardless of the programming language.
For Python 3 programming language, one way to decode the address field of the MAC Address and IP address from 'bytes' to 'string' format is shown below.
def get_mac_string_from_bytes(mac_bytes):
mac_addr = mac_bytes
if isinstance(mac_bytes, bytes):
mac_addr = mac_bytes.decode("latin-1")
return ':'.join('%02x' % ord(b) for b in mac_addr)
Following is an example to decode the address field of the IP Address object using the logic implemented in Python 3:
def get_ip_string_from_bytes(ip_bytes):
return '.'.join('%d' % b for b in ip_bytes)
Updated 4 months ago