QViz - Queue Visualizer
QViz is a portable visualization software for QoS settings of your routers. Especially the kind of hell Linux's tc(8) thing is capable of making. It connects to the router using SSH and fetches the data by parsing standard iproute2 commands, which kind of tells:
- that it will be SLOW, because of Paramiko in Python's GIL and many of its bugs (if you only have less than ten connections, you're probably fine)
- that it will be CRAP, because iproute2 doesn't really focus on its output being parsed
- that it will be EASY TO USE or EXTEND, because Python is trivial to learn and the program has been designed intelligently (but coded... less so)
- that it will be READ ONLY, because making changes to remote production machines that can be configured using just about any means is impossible by design
My bachelor thesis (in Czech) describes not just the program, but the whole of Linux's and OpenBSD's QoS frameworks. They forced us to make a poster (PDF), (Inkscape SVG). Too bad you can't understand it, because it's also in Czech. But it's all trivial, anyway, and not worth looking at. Chapter 5 talks about the program, if you like deciphering weird languages with hyperlinks in them.
Requirements (USE=tk emerge -DNav paramiko)
- Python 3 with tkinter in it. Tested on 3.3.5 and 3.4.1.
- pycrypto
- python-ecdsa
- paramiko, preferably with some patches to have hmac-sha2-256 and DH group 14 support in it. I'll put these here soon.
Download (xzdec and python setup.py [install|bdist_wininst|...])
- version 1.0, SHA256: ba472ee44b64e08f85cdd195d43cee2319191456b85269de0c403b6059f10295
Beware, this code may contain dead ghoti. Run it like qviz.py. Yes, it does run on Windows. That's the whole point.
Known bugs (yes. up there, I meant it.)
- ssh_config(5) creation needs more testing, especially when the file isn't there and you refuse to create it, or SELinux decides to act up. Reported by Antonin Steinhauser, thanks!
- TcActionIpt class is missing, because Gentoo doesn't have that by default and I forgot to test it. I need to go over pylint output when I find some time. Reported by Antonin Steinhauser, thanks!
- TcActionNat shows all network masks as /32. This is a tc(8) bug we CAN'T work around, because it is due to your CPU being Stupid Endian.
- dsmark doesn't show classes with mask and value equal to zero. This is a tc(8) bug we'll have to work around.
- cls_bpf shows the immediate value of an AND instruction in decimal, and should print it in hex.
- It needs auditing to see whether we use majmin_[enc|dec]ode everywhere and correctly.
- The code isn't on github.
- The SSH backend isn't in C++11. And on github. And working well enough to be public.
- The JSON RPC frontend wasn't ported to Python 3 yet. It's probably rubbish, though.
- Planning stuff in tkinter frontend on multiple machines sometimes forgets about some of them.
- The left tree widgets aren't updating their titles when their stuff changes. Only the widget on the right.
Screenshots (don't expect real-world scenarios)
Martin Pelikán (with mailbox in 'pelikan' at the storkhole.cz server)