Welcome|to|the four part blog series on the web-based network device monitoring tool -"johann". Part one of the series serves as an introduction to johann. In part 2, you got a look behind the scenes of how I implemented the south-bound communication between the application and the network device with the network device API RESTCONF. Part 3 of the series focuses on the web-based application itself, with a focus on the Python Web-Framework Django. In part 4 of the series, we focus on johann deployment to production.
Let me tell you story: Back in 2019, I was new in my developer relations role at Cisco DevNet, and attended one of my first developer conferences in Austria as a speaker. In my session I was showing how network devices are configured with CLI and then, of course, introduced them to NETCONF and RESTCONF.
Directly after my session, I had an interesting discussion with a group of various software developers who have never laid hands on an enterprise networking switch at all. They could not believe that nowadays this kind of CLI and text-based configuration is still being used and did not understand why NETCONF/RESTCONF was not more popular. They mostly compared it with RPCs (Remote Procedure Calls), REST APIs or other interfaces where the whole communication was nicely defined and documented.
This is where I knew, I need to explore more the capabilities of the network device API, its limitations and maybe even spread the word about it among network engineers.
At first, it started small and I only wanted to create a simple UI where any user can gain valuable information from many networking devices via RESTCONF. But it got bigger than expected: And with "it" I mean johann: Network Device Monitoring.
johann is a web-based network device monitoring tool specifically for Cisco IOS XE devices for now. It allows you to collect configuration and operational data of your networking devices in a structured way in one single database and display it on one dashboard.
At first, the user needs to add their networking devices to johann. By simply putting the IP address, username and password, johann is requesting via RESTCONF (which needs to be enabled on the device) specific configurational and operational data of the devices and putting them into the local database.
After the devices have been added, the user can view all information in a structured way directly in the browser. There is also a page for every single device with detailed information and more importantly reports are being created based on the gathered data. As an example, one graph shows the total used IOS XE versions, the memory health status of all devices and if IOx is enabled or not.
But these are just small examples: Developers can extend the code and create various graphs based on various parameters (e.g. for configurations audits). This makes it very easy for the network admin to see on one dashboard if there are switches misconfigured or not.
And there are also some other tools included: You can enable RESTCONF on your networking device directly in the dashboard. This is done via the Python library netmiko. You can also see detailed logs and request the running configuration in JSON format.
Demo GIF: Get a short overview of how johann works
johann gives you stats of all your devices in nice graphs
If you are like me, you definitely would like to know what's underneath johann. It is based on the Python Web-Framework Django. Via Python and the Python requests library, the configurational and operational data are requested from the RESTCONF interface of the device. The YANG modules and what data should be added to the SQLite database are pre-selected. If there are no parameters configured (for example no IP default gateway is set), then the value in the database will also be empty.
When devices are added or refreshed, a task is created. This is where celery and redis come into play. While the task is added to the celery task queue and the RESTCONF communication is established from there, the user can still browse around in the dashboard and gets task updates (current status and if the task is finished) from the celery task via Websockets using Django Channels. Redis as an in-memory data-storage is there to support the celery task queue and the Websocket communication.
Since Django is a web-framework, nginx is used to serve all static files (images, CSS-files, Javascript files etc.) to the user and is the point-of-contact for the web-user. To get data from the Django framework, SQLite database and establishing Websockets, daphne, an ASGI (Asynchronous Server Gateway Interface) server, is used. Therefore, nginx is also used as a reverse proxy to pass requests to daphne.
I hope that you enjoyed reading about the possibility of what you can do with the network device API NETCONF & RESTCONF with this web-based tool. But what's next for you?
This is just the beginning! After this introduction of johann, you will read in part 2 of this blog series how exactly you can get data via RESTCONF and the best practices. Stay tuned!
We'd love to hear what you think. Ask a question or leave a comment below.
And stay connected with Cisco DevNet on social!
Twitter @CiscoDevNet | Facebook | LinkedIn
Visit the new Developer Video Channel