ObjectiveLearn how to install and take advantage of cockpit on an Ubuntu 18.04 machine
- Root permissions
- # - requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ - requires given linux commands to be executed as a regular non-privileged user
IntroductionCockpit is a web-based system administration service, which let us manage machines in a nice and easy way. Its aim is to simplify daily administration tasks, including resources, network and users monitoring and management.
Originally available for the Rhel distributions family, it was possible to install it on Ubuntu 16.04 by using an external
ppa. With Ubuntu 18.04 it has been included in the official repositories, therefore its installation has become even simpler and safer.
InstallationAs just said, the cockpit package is available in the official Ubuntu 18.04 repositories, so installing it it's just a matter of running:
# apt-get update && apt-get install cockpitFew seconds after running this command, cockpit will be installed on our system and automatically started.
Cockpit uses port
9090for its web interface, therefore we can reach it by launching our favorite web browser and typing
localhost:9090in the address bar. Here I am assuming we are on the same machine cockpit is running on: to access the service from another machine, we have to use the server ip. In this case a firewall exception is also needed for the port to be reachable.
The UAF Geophysical Institute, is looking for an experienced Linux Systems Analyst to join their team of research cyber infrastructure analysts and engineers. LOCATION: Fairbanks, Alaska, USA
The cockpit web interfaceOnce we reach the web interface, we will be prompted to login:
We must now insert our credentials in the related input fields and click on the
Log Inbutton. Once logged in we will be redirected to the main cockpit page:
Let's take a look at it. The main page section shows us some information about the machine we are running on, as the
system time. In this case I am running Ubuntu on a virtual machine, therefore the value of the hardware section is
QEMU Standard Pc.
We also have a dropdown menu which let us perform a power option on the system as restart or shutdown. On the right we can see some graphs which let us monitoring crucial system activities, in order: Cpu and memory usage, disk activity and network traffic.
The logs sectionIn the left column menu, just below the
systemsection, we can click on
logsto access to the page dedicated to system logs. Here, at the top of the page, we have two nice menus which let us filter the logs by period of time and severity, choosing between
To access detailed information about a log message, all we have to do is to click on the corresponding row: we will be redirected to a page containing the log details.
The storage sectionProceeding further we have the
storagesession. Here we have some graphs displaying disks reading and writing activities, and immediately after a status bar indicating the filesystems usage amount. We have also the option to easily add
We could inspect a specific drive by clicking on the related section on the right in the
Drivesbox: we will also be able to create a new partition table (if some conditions are respected - the disk must not be mounted, for example) on the specified drive: the operation will erase all the data on it.
The network sectionIn section dedicated to network monitoring and administration, it's possible to observe graphs about sent and received packets for each interface, and network activity in general. Details about an interface, such as its
MAC addressare visible by clicking on an interface row: here we also have the chance to enable or disable said interface. It's also possible to easily add a
vlanusing the dedicated buttons. On the bottom of the page the network logs are shown.
The accounts and services sectionsThe last two available sections are about accounts and services management. In the former we can very easily create, delete or obtain information about the users available on the system. By clicking on a specific user section we will have the option to change its password, lock its account and even add authorized public
servicessection, we will be presented with an overview of system daemons and targets. The web interface grants us the ability to start, stop, enable or disable each service, showing us its current state. Thanks to cockpit, we can also easily manage systemd
targets(the equivalent of classic system runlevels),