Cheers Airheads community
I had the opportunity to talk with a Customer who told me that he had a bad experience because someone else by mistake executed a configuration change on his core switch during business hours, configuration change caused the failure of some IT services. As part of the process of renewing its data network, this Customer asked me to demonstrate whether it was possible to generate a real-time alert as soon as a configuration change was executed on an Aruba AOS-CX switch.
Using the capabilities of AOS-CX in conjunction with a Python script, I was able to demonstrate to Customer that it is possible to send a real-time alert to Whatsapp as soon as a configuration change was executed. Also, I explained the biggest advantage of using Streaming Telemetry: instead of asking the switch for configuration updates at certain regular intervals, the Aruba AOS-CX switch is proactively pushing updates via Websocket, eliminating the inefficiencies of the tradicional polling model.
Here is a short 20sec video of the demo that I have made:
(view in My Videos)
Demo Flow:
Code
Commands to be entered on AOS-CX switch:
Python Script:
https://github.com/adolfobolivar/AOS-CX_Streaming-Telemetry-
Script executed:
adolfoobregon$ python3 Main.py "wss://172.16.0.101:443/rest/v1/notification" "/rest/v1/system?attributes=last_configuration_time"
How it Works?
Aruba AOS-CX switches include a real-time notifications subsystem, which is accessed through a secure Websockets connection, in this way it is possible to subscribe to real-time notifications and receive alerts when configuration changes are executed. Secure WebSocket (WSS) protocol uses HTTPS, so there is no need to open a new port on the switch side (just HTTPS), and there is no need to provide a new authentication mechanism (you must pass the session cookie).
With Twilio’s Messaging API, you can programmatically send WhatsApp messages using a shared phone number. Additional information can be found here: https://www.twilio.com/docs/sms/whatsapp/quickstart/python
Result:
“Sreaming telemetry is a new approach for network monitoring in which data is streamed from devices continuously with efficient, incremental updates. Operators can subscribe to the specific data items they need”[2].
AOS-CX switch confirms (“type”: “success”) python script has created a sucess Websocket connection and the notification of interest is "configuration changes".
Image 2
When a configuration change is done, AOS-CX switch sends a notification message in JSON format.
Image 3
References:
1. ArubaOS-CX REST API Guide for 10.02 https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-a00061987en_us&docLocale=en_US
2. http://www.openconfig.net/projects/telemetry/
3. https://www.twilio.com/docs/sms/whatsapp/quickstart/python