Difference between revisions of "An Overview of the RHEL Cockpit Web Interface"

From Techotopia
Jump to: navigation, search
(Created page with "{{#pagetitle: An Overview of the RHEL 8 Cockpit Web Interface }} <table border="0" cellspacing="0" width="100%"><tr> <td width="20%">A Guided Tour of the RHEL GNOME 3 Deskto...")
(No difference)

Revision as of 19:03, 9 June 2019

PreviousTable of ContentsNext
A Guided Tour of the RHEL 8 GNOME 3 DesktopUsing the Bash Shell on RHEL 8


You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book.

Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($9.99) or Print ($36.99) format

Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages

Buy Print Preview Book


Although it comes equipped with the latest in Linux desktop environments, Red Hat Enterprise Linux 8 is very much a server operating system and, as such, the majority of RHEL deployments will either be to remote physical servers or as cloud-based virtual machine instances. Invariably, these systems run without a keyboard, mouse or monitor, with direct access only available via the command-prompt over a network connection. This presents a challenge in terms of administering the system from remote locations. While much can certainly be achieved via remote access to the command-line and desktop environments, this is far from a consistent and cohesive solution to the administrative and monitoring tasks that need to be performed on a daily basis on an enterprise level operating system such as RHEL 8.

This issue has been addressed with the introduction of the Cockpit web-based administration interface. This chapter will explain how to install, configure and access the Cockpit interface while also providing an overview of the key features of Cockpit, many of which will be covered in greater detail in later chapters.


Contents


An Overview of Cockpit

Cockpit is a light-weight, web-based interface that allows general system administrative tasks to be performed remotely. When installed and configured, the system administrator simply opens a local browser window and navigates to the Cockpit port on the remote server. After loading the Cockpit interface into the browser and logging in, a wide range of tasks can be performed visually using administration and monitoring tools.

Behind the scenes, Cockpit uses the same tools to perform tasks as would normally be used when working at the command-line, and updates automatically to reflect changes occurring elsewhere on the system. This allows Cockpit to be used in conjunction with other administration tools and techniques without the risk of one approach overriding another. Cockpit can also be configured to access more than one server, allowing multiple servers to be administered and monitored simultaneously through a single browser session.

Cockpit is installed by default with a wide range of tools already bundled. Cockpit also, however, allows additional extension plugins to be installed as needed. Cockpit is also designed so that you can create your own extensions using a combination of HTML and JavaScript to add missing or custom functionality.

Cockpit’s modular design also allows many features to be embedded into other web-based applications.

Installing and Enabling Cockpit

Cockpit is generally not installed on RHEL 8 by default, but can be set up and enabled in a few simple steps. The first step is to install the Cockpit package as follows:

# dnf install cockpit

Next, the Cockpit socket service needs to be enabled:

# systemctl enable --now cockpit.socket

Finally, the necessary ports need to be opened on the firewall to allow remote browser connections to reach Cockpit:

# firewall-cmd --add-service=cockpit --permanent
# firewall-cmd --reload

Accessing Cockpit

If you have access to the desktop environment of the server on which Cockpit has been installed, open a browser window and navigate to https://localhost:9090 to access the Cockpit sign in screen. If, on the other hand, the server is remote, simply navigate to the server using the domain name or IP address (for example https://myserver.com:9090).

When the connection is established, the browser may issue a warning that the connection is not secure. This is because the Cockpit service is using a self-signed certificate. Either select the option to proceed to the web site or, to avoid this message in the future, select the advanced option and add an exception for the server address.

Once connected, the browser will load the log in page shown in Figure 7-1 below:


Rhel 8 cockpit login.png


Figure 7-1

Sign in to the Cockpit interface either as root or with your a user account credentials. Note that when signed in as a user some tasks will be restricted within the Cockpit interface due to permission constraints. After signing in, Cockpit will display the System screen.

System

The System screen provides an overview of the current system including realtime performance metrics for CPU, memory, disk I/O and network usage. This screen also includes information about the system including the underlying hardware, host name, system time and whether the system software is up to date. Options are also provided to restart or shutdown the system.

Figure 7-2, for example, shows the system monitoring page of the Cockpit interface:


Rhel 8 cockpit system.png


Figure 7-2

Logs

When the Logs category is selected, Cockpit displays the contents of the systemd journal logs. Selecting a log entry will display the entire log message. The log entries are ordered with the most recent at the top and menus are included to filter the logs for different time durations and based on message severity.


Rhel 8 cockpit logs.png


Figure 7-3

Storage

Select the Storage option to review and manage the storage on the system including disks, partitions and volume groups, Network File System (NFS) mounts and RAID storage. This screen also allows disk I/O activity to be monitored in realtime and lists log output from the system udisksd service used to query and manage storage devices.


Rhel 8 cockpit storage.png


Figure 7-4

Networking

The Network screen provides information on a wide range of network related configurations and services including network interfaces and firewall settings and allows configuration changes to be made such as creating network bridges or setting up virtual networks.


Rhel 8 cockpit networking.png


Figure 7-5

Virtual Machines

Virtualization allows multiple operating system instances to run simultaneously on a single computer system, with each system running inside its own virtual machine. The Virtual Machines Cockpit extension provides a way to create and manage the virtual machine guests installed on the server.


Rhel 8 cockpit virtual machines.png


Figure 7-6

The Virtual Machines extension is not installed by default but can be added to Cockpit by running the following command:

# dnf install cockpit-machines

The use of virtualization with RHEL 8 is covered starting with the chapter entitled Installing KVM Virtualization on RHEL 8.

Accounts

Select this option to view the current user accounts configured on the system, and create accounts for additional users. The topic of user management will be covered later in the chapter entitled Managing RHEL 8 Users and Groups


Rhel 8 cockpit accounts.png


Figure 7-7

Click on an existing account to view details and make changes. The user account details page may also be used to review and add Public SSH keys to the user’s account for remote access to the server as outlined in the chapter entitled Configuring SSH Key-based Authentication on RHEL 8.

Services

This screen displays a list of the system services running on the server and allows those services to be added, removed, stopped and started.


Rhel 8 cockpit services.png


Figure 7-8

The topic of services will be covered in detail in the chapter entitled Configuring RHEL 8 systemd Units.

Applications

As previously mentioned, additional functionality can be added to Cockpit in the form of extensions. These can either be self-developed extensions, or those provided by third parties. The Applications screen lists installed extensions and allows extensions to be added or deleted.


Rhel 8 cockpit applications.png


Figure 7-9

Diagnostic Reports

When selected, this option allows a diagnostic report to be generated and downloaded to the local system for analysis. The generated report is provided in the form of a compressed archive file containing a collection of all the log files on the server system.


Rhel 8 cockpit diagnostic report.png


Figure 7-10

Kernel Dump

This screen simply displays the current KDump service status and indicates where the kernel dump file will be located in the event of a kernel crash on the system. This dump file can then be used to identify the cause of the crash. A button is provided to test the Kernel dump by triggering a kernel crash, though use of this option is not recommended on a production server system:


Rhel 8 cockpit kdump.png


Figure 7-11

SELinux

When selected, the SELinux category indicates whether SELinux policy is currently being enforced and displays any alerts generated by this security system.


Rhel 8 cockpit selinux.png


Figure 7-12

Software Updates

If any software updates are available for the system they will be listed on this screen. If updates are available, they can be installed from this screen.


Rhel 8 cockpit updates.png


Figure 7-13

Subscriptions

The Subscriptions screen displays information about the system’s Red Hat subscription status and can be used to register and unregister the system.


Rhel 8 cockpit subscription.png


Figure 7-14

Terminal

As the name suggests, the Terminal screen provides access to the command-line prompt.


Rhel 8 cockpit terminal.png


Figure 7-15

Connecting to Multiple Servers

Cockpit can be configured to administer multiple servers from within a single session. This requires that the Cockpit dashboard be installed on the primary system (in other words the system to which the initial Cockpit session will be established) To install the Cockpit dashboard package, run the following command:

# dnf install cockpit-dashboard

Once the dashboard has been installed, sign out of Cockpit and then sign in again. The dashboard will now appear in the Cockpit interface as highlighted in Figure 7-16:


Rhel 8 cockpit dashboard icon.png


Figure 7-16

When selected, the dashboard page will display performance graphs for the current system and provide a list of currently connected systems:


Rhel 8 cockpit dashboard one server.png


Figure 7-17

To add another system, click on the + button highlighted in Figure 7-17 above, enter the IP address or host name of the other system and select a color by which to distinguish this server from any others added to Cockpit before clicking on the Add button:


Rhel 8 cockpit dashboard add server.png


Figure 7-18

Enter the user name and password to be used when connecting to the other system, then click on the log in button. The newly added server will now be listed in the Cockpit dashboard and will appear in graphs represented by the previously selected color:


Rhel 8 cockpit dashboard two servers.png


Figure 7-19

To switch between systems when using Cockpit, simply use the drop down menu shown in Figure 7-20 below:


Rhel 8 cockpit choose server.png


Figure 7-20

Enabling Persistent Metrics

In a standard installation Cockpit does not retain any of the performance metric data beyond what is displayed in the short time window covered by the graphs. To retain the data collected by Cockpit, the persistent metrics feature needs to be installed. To enable persistence, display the System screen and click on the Enable persistent metrics... link highlighted in Figure 7-21:


Rhel 8 cockpit enable persistent metrics.png


Figure 7-21

Once this option has been selected, Cockpit will request permission to install the pcp-selinux packages. Once these packages have been installed, the Enable persistent metrics link will have been replaced by a control labeled Store Performance Data. When this option is enabled, the performance graphs will include additional controls allowing you to move back and forth in time to view historical data and to change the data time frame ranging from 1 hour up to 1 week:


Rhel 8 cockpit persistent data controls.png


Figure 7-22

Summary

The Cockpit web interface allows remote system administration tasks to be performed visually from within a web browser without the need to rely on a command-prompt and command-line tools. Once installed and enabled, the system administrator simply opens a web browser, connects to the remote server and signs into the Cockpit interface. Behind the scenes, Cockpit uses the same command-line tools as those available via the command prompt, thereby allowing both options to be used without the risk of configuration conflicts. Cockpit uses a modular framework allowing additional extensions to be added, and for custom extensions to be developed and integrated. A Cockpit session can be used to administer a single server, or configured to access multiple servers simultaneously.


You are reading a sample chapter from the Red Hat Enterprise Linux 8 (RHEL 8) Essentials book.

Purchase a full copy of Red Hat Enterprise Linux 8 (RHEL 8) Essentials in eBook ($9.99) or Print ($36.99) format

Red Hat Enterprise Linux 8 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters and over 250 pages

Buy Print Preview Book



PreviousTable of ContentsNext
A Guided Tour of the RHEL 8 GNOME 3 DesktopUsing the Bash Shell on RHEL 8