Cockpit - Highway to the admin zone

Updated: March 7, 2020

There are many Web-based admin GUI in Linux. Lots. They all have something in common - they let you monitor and manage your environment using a centralized facility. They also have something else in common, and that's the complexity of configuration. In most cases, if you like to have a robust network of hosts talking to each other, you have to sweat it. XML, JSON, events, whatever. Boring.

The Cockpit Project is an integrated and easy-to-use Web-based management tool, which I happed to discover on Fedora 30 some time ago. Well. While I wasn't too impressed with what Fedora 30 had to offer me, it is a test bed for cool and new technology. So I was quite intrigued and went abed - testing. Or rather, I strapped into the cockpit, ha ha ha, hi hi he. Indeed, let's begin.

Setup & first run

Using Cockpit turned out to be ultra-simple. I installed the software via dnf, and within seconds, I had it up and running. You can access the Web interface on the designated server on port 9090. Localhost:9090 in a browser address bar will do the trick. You can login with any user - including those without admin privileges, but then, you will be limited in what you can do.

In general, it is easy to go wrong with minimalistic interfaces, hint Gnome, but with Cockpit, the layout is quite all right, and blends visual appeal with aesthetics. By default, Cockpit will show you the System page for the server, which includes the basics like CPU, memory, disk, and network metrics.

System

If you click on the other tabs, you will get a wealth of additional information. All of this is done through the different Cockpit plugins in the background, which do the necessary probing of the filesystem and /proc and /sys bits and pieces, and you don't really need to JSON it or anything like that. With most tools of similar nature, there's the mandatory masochism of configuring tons of boring rules before you see even a single line on a graph anywhere.

Services

Applications

Dashboard & other machines

The really cool part is the Dashboard tab. Here, you have the option to monitor multiple systems. Hit the plus button to start adding new hosts. This is where it gets interesting. Cockpit uses SSH connectivity to establish connection with remote hosts.

Dashboard

Add host

This means the remote host needs to be discoverable and reachable on the network, and it needs to run SSH. Now, it also needs the Cockpit package installed. You will only learn that it is missing after you establish a connection. I decided to try a non-Fedora remote host (Ubuntu 19.10), and there, Cockpit is available in the repos, and just as easy to install. The beauty of using a popular protocol like SSH means that in the future, anything that supports SSH and can run Cockpit can be included in the monitoring. Almost like that Ozzie can do attitude.

Host identity

Cockpit service not installed

Once you sort out the problematic bits, it works fine. You will see the different machines in the list, and be able to monitor their behavior. Works without any issues. The best part is, you only need to install a single package on each host, and Cockpit handles the rest in the background.

Added host

Other features

There's more. You can use an embedded terminal, enable additional views and metrics, and of course, there's API for the nerds. It's not trivial, and requires good knowledge of JavaScript, but you can also try the starter kit, which comes with a pre-built template for creating your first extension. This is true of all monitoring systems out there - you cannot magic functionality without skill and sweat. The major difference is, the Cockpit team has sweated some for you, creating a baseline setup that includes a lot of goodies, and allows you to use the tool right away, without having to bore yourself to death with code and configuration.

Conclusion

Cockpit seems like a very handy project. It's elegant, robust and comes with a clean interface and readily usable defaults, which place it ahead of most similar programs of its nature. Sure, in the long run, you can't cheat physics. The second law of thermodynamics does require that you have expert knowledge and be able to fully understand and control the gory details behind the scene. But in the critical adoption period, between setup and first use, Cockpit does not ask for your kidney and soul right away.

The real power of Cockpit will surely be in the domain of enterprise, cloud and other buzzwordly places, but even as a home user, you can benefit from it. If you have several Linux machines, and you want to be have a quick glance at their behavior, or do some basic management, Cockpit offers a fuss-free way plus a Web interface, which means you really are portable when it comes to everyday usage. I'm quite intrigued and happy, and I'm looking forward to see how this project evolves. Recommended, so you might as well go about testing. The end.

Cheers.

You may also like: