artofrf.com

Ali's Technology Blog

Menu
  • Home
  • Important Links
  • About Me
  • Tools and Scripts
Menu

Mist Switch Operator in docker

Posted on November 11, 2021November 12, 2021 by mali

First of all, I have to thank Yedu Siddalingappa from Mist and then Thomas Munzer who created the Mist Switch Operator UI.

I was working on a script to accomplish the following goals:

  • Individual port level changes on the Juniper switches using the APIs
  • View the changes
  • Allow users to only view and make changes to the access ports only and not touch the SFP (uplink) ports.

I completed my script that was menu driven and made changes to the individual port(s). Mist API’s currently don’t have support for PATCH or merge. So making a change to an individual port means you have to ensure to send push out the whole port configuration and not just part of it. This can get a little tricky, there is some GET involved, then extract related data and then do a PUT with all that data to update the port config.

Juniper Switch Port View and Updates via APIs

I am very new to programming and automation and have so much to learn, this would have added additional effort for me. When I found out about Mist Switch Port Operator script I figured why re invent the wheel. Why not use it and use my time and effort to learn it and customize it.

Next step was to download the script and figure out how to use it.

Script is located here and Thomas has added excellent and simple instructions. All you have to do is download the script and execute it. I did run into an issue where I had to add an environment variable to my “.zprofile”.

DJANGO_ALLOWED_HOSTS=127.0.0.1

All I had to do was point my browser to “127.0.0.1”, which brought me to the following screen:

Mist Switch Operator Screen

NOTE: I couldn’t get my API token to work for some reason so I used my user ID and password to login. I’ll have to trouble shoot the API token part later on.

Mist Switch Port Operator – Selecting ports

I am able to easily select a port or ports and make some basic changes to them.

  • Enable/Disable Port
  • Enable/Disable PoE
  • Enable/Disable Auto-Negotiation
  • Change VLAN

docker: (what took me so long)

While I was reading the instructions I noticed that there is a “docker image” available for this whole script as well. docker image sounds great but I needed to understand docker a bit more as I had no clue where and how to start and what exactly it is.

Little bit of search on the Google helped me understand the basics of “docker”. It was so easy to install on my Mac and get this script going. It almost made me say to myself, “why did I not do this before”. Just like when I first learned about using “YAML” files for some of my python scripts. Anyways all part of the learning process. I fired up this script in the docker. Found the container ID so that I can edit the files.

There is a small process you have to follow to accomplish this. Instead of me trying to explain it to everyone, I think it is best if I simply post the link. Editing Docker files.

Ok back to what I wanted to do. Notice in the image below SFP interfaces are listed top and bottom (xe-0/1/0 and xe-0/1/1). I needed them gone. Can I simply tell the script to not GET those interfaces and display them?

Looking through some files I found the “devices.py” file that I was simply able to modify and exclude those SFP(uplink) ports.

When I am done all I have to do is just close the script by hitting the stop button.

Docker Container/Apps

Bottom line I learned how to use this script and docker. Possibilities are endless and so much can be done using docker and this script. Much to learn here especially about django. Being able to put a UI to my scripts would be amazing. Although it was exciting to learn the basics of docker and getting this container/app running in a matter of minutes. There is certainly more to learn there.

Category: Juniper Switching, Juniper/Mist, Mist, Programming/Automation, Python

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Nile Secure Guest – Configuration and Use Case
  • WLAN Pros Toolbox
  • Nile does NAC – Configuring Trust Engine
  • WLAN Validator
  • PCAP I/O Graph Analyzer

Tags

AirDrop arista Arista AGNI Arista CV-CUE Arista NAC Arista WIPS Arista WPA3 UPSK Aruba Central Automating Mist Switch Templates Automation AWDL Configuring Switch Templates in Mist CWAP 403 EAP Format MAC Addresses Hamina Network Planner Juniper SRX300 MacBook Marvis mdns MFD8 MFD9 Mist Access Assurance MistAI Mist Auto Placement Mist MPSK Mist Wireless NaaS Networking Field Day NFD32 NileNav Nile Secure Nile Wi-Fi Social Channels Tech Field Day Troubleshooting with Marvis Troubleshooting with Mist Troubleshooting with Mist AI Troubleshooting with Wireshark Wireless Adjuster Wireless Adjuster Level II Wireless troubleshooting WLPC wlpc2023 Wyebot

Tech Blogs

  • WiFiTodd
  • CCNA Wireless
  • Cisco Full Bars
  • Packet Life
  • Havilandweb
  • Gjermund Raaen
  • Bad-Fi
  • The ASCII Construct
  • Juniper Port Checker
  • WiFrizzy
  • Spectrum Chart
  • BadgerWiFi

Recent Comments

  • Hiten Thakkar on PCAP I/O Graph Analyzer
  • mali on Deploying Nile Secure – My First NSB
  • Larry Farrish on Deploying Nile Secure – My First NSB
  • Courtney on Mist Access Point – CSV
  • ayoub chabrouk on Ubiquiti stealing the show at MFD11

Archives

  • August 2026
  • July 2026
  • March 2026
  • February 2026
  • December 2025
  • November 2025
  • October 2025
  • August 2025
  • May 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • September 2023
  • August 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • November 2022
  • October 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • May 2021
  • April 2021
  • March 2021
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • April 2019
  • March 2019
  • November 2018
  • October 2018
  • September 2018
  • May 2018
  • January 2018
  • December 2017
  • August 2017
  • January 2017
  • September 2014
  • December 2013
  • October 2013
  • May 2013
  • August 2012
  • July 2012

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Categories

  • AeroHive
  • Arista
  • Arista
  • Aruba
  • Aruba
  • Aruba Central
  • BYoD
  • Certifications
  • Cisco
  • Cisco
  • Cisco EEM Scripting
  • Cisco Routing
  • Cisco Security
  • Cisco VoIP
  • Cisco VPN
  • Cisco Wireless
  • Conferences and Meetings
  • Design
  • Ekahau
  • General
  • Hamina
  • IoT, IIoT, OT
  • Juniper Security
  • Juniper Switching
  • Juniper/Mist
  • Linux
  • Microsoft
  • Mist
  • Mist Wireless
  • Nile
  • Nile Secure
  • Nile Wi-Fi
  • Programming/Automation
  • Python
  • Ruckus
  • Ruckus Wireless
  • Ruckus/Brocade
  • Ruckus/Brocade Scripting
  • Ruckus/Brocade Switching
  • Secure Guest Service
  • Security
  • Switching
  • Tools
  • Troubleshooting
  • Trust Engine
  • Uncategorized
  • Windows
  • Wireless
  • Wireless
  • WLAN Tools
© 2026 artofrf.com | Powered by Minimalist Blog WordPress Theme