Streaming Telemetry: Real time notifications to Whatsapp when a configuration change is executed
08-25-2019 10:19 AM - edited 08-26-2019 06:23 AM
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:
Commands to be entered on AOS-CX switch:
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
“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”.
AOS-CX switch confirms (“type”: “success”) python script has created a sucess Websocket connection and the notification of interest is "configuration changes".
When a configuration change is done, AOS-CX switch sends a notification message in JSON format.
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