Instructor: All right, so this is the lecture.
This is where we are going to cover cockpit.
A cockpit is a server administration tool
sponsored by Red Hat,
focused on providing a modern looking end user-friendly
interface to manage and administer servers.
Cockpit is the easy to use, integrated, glanceable,
and open web-based interface for your servers.
The application is available
in most of the Linux distribution such as CentOS,
Red Hat, Ubuntu, and Fedora.
It is installed in Red Hat 8 by default
and it is optionally available in version 7
if you wanted to go and install from the repository.
It can monitor system resources,
add or remove accounts, monitor system usage,
shut down the system,
and perform quite a few of the task
all through very accessible web connection.
Now you're probably thinking,
hey, don't we use Command Line in Linux to perform
or manage most of the function and it's a lot easier?
Yes, for those people who still prefer
and would like to use the command line,
definitely you should.
But this web interface, if you tried one time,
I'm telling you you're definitely going to fall in love
with this interface because you could access your server
if it has this web interface running,
you could access it from anywhere remotely,
and you could also get the terminal within
that web interface.
So, I'll show you once we get into the Cockpit application.
Okay, so now we are going to cover how we could install,
configure, and manage this Cockpit application.
So, the very first we thing we have to do
is check for network connectivity
because we have to go and download that package
from the Red Hat or CentOS repository
so we could start that service.
So, in order to connect to the internet,
we need to make sure our computers,
our Linux machines have network connectivity.
And for that very easy thing to do
is just simply open up your terminal
and your Linux servers and ping www.google.com.
Or you could ping any websites on the internet
of your choice.
All right, for that I have two machines
both running side by side.
One is a Red Hat 7.
Sorry, one is Red Hat 8, and one is CentOS 7.
So, let me log into 8.
So, we'll go through both one by one.
All right, so right here on this side,
this is my Red Hat 8 and this is my CentOS 7.
All right, so let me move this on this side.
Okay, the first thing we have to do is check to see
if we have connectivity.
So, ping www.google.com.
Beautiful.
We are getting the response back.
When you see 65 bytes from www.google.com,
it means my machine has internet connectivity.
Okay, next here on Red Hat 8,
I'm going to do the same thing.
Google.com.
Okay, here I'm getting a response too.
So, both of my machines,
both of my Linux servers are up and running.
Sorry, not the Linux machines up and running,
but they are able to connect to the internet.
All right, next thing is install cockpit package
as root.
If you are not logged in as root,
then you have to do pseudo
and then run the command like yum/dnf install cockpit -y.
And that command is used for Red Hat
or CentOS Operating Systems.
If you are using Ubuntu,
you would have to use apt-get install cockpit.
All right, so let's go back into our Linux servers.
Before you go in and do the installation
or run the command of installing cockpit,
let's check to see if we already have
that package installed.
So, I have right here my Linux Red Hat 8 machine.
I'm gonna clear the screen.
And to check if I have the package installed,
I will run the command RPM,
which stands for Red Hat Package Manager.
It's just a command which will tell you
if a package has been installed on your system or not.
Then you'll use the option Q, query all, A,
and then grep, pipe it, and grep for Cockpit.
All right, it looks like I do have the package.
All the necessaries dependent packages,
everything has been installed.
Great.
Now let me do the same thing for our CentOS 7.
Let's clear the screen.
RPM-QA and grep for Cockpit.
Okay, I got the prompt back.
I didn't get anything,
so it means I do not have that package installed.
So, what I will do is I'll run the command,
yum install cockpit and -y.
The option I'm giving is because if it's going to ask me
any dependency,
do we need to install the other package
because it dependent,
I want it to answer yes.
Okay, it's going to the yum repository.
It's checking any dependencies.
It got into all the dependency as you saw up up there.
It started installing right away.
It's downloaded and installing
and the reason it didn't ask me for the confirmation
is because I had provided the -y option.
All right, beautiful.
Everything has been installed, verified.
Good.
And now I'm going to go check our RPMQA
and grep for cockpit
to see if that package has been installed.
Beautiful.
It is installed.
So, now both of my servers
have the cockpit package installed.
Coming back to the PowerPoint slide.
Next one is start and enable the service.
So, the package is there.
Now we need to start its service,
the associated service.
And the service name is cockpit.
You could use just cockpit or cockpit.service.
So, let's go back into both of our Linux machine.
So, before I start,
I wanted to check the status
if we have that service already started
and running systemCTL status cockpit.
Okay, here you notice that I have the service
loaded but it is inactive,
it's not running.
Okay, so I have to start the service here.
So, systemCTL start.
It is started, now check the status.
Beautiful.
See right here, I ran this command,
just wanted to show you.
And it says loaded,
and its active status is active and running.
Let's do the same thing on 7,
systemCTL status.
Nope, it's not loaded and it's not running.
So, we have to start the service.
It is started.
Let's check the status.
Beautiful.
Right here, see it's loaded
and it's active and running.
Now we wanted to enable it
so this way when my computer
or my Linux machine restarts,
it starts the cockpit service with it.
So, I'm just going to hit up arrow key
and I'm just going to do enable.
Okay, for Red Hat 8,
I have already enabled the service earlier.
So, next thing we have to do
is check the status of the service.
We have already checked the systemCTL status cockpit
to see if it's up and running.
We did that,
and the next thing is to access the web interface.
To access it, you have to do https://192.168.1.x,
this is the IP of your Linux machine, :9090.
So, this cockpit application,
the web interface application runs on port 9090.
So, let's go into our machines
and let's check the IP address by typing ifconfig.
And the interface that I have is ENP0S3.
I could do that, ENP0S3,
and you will see the IP address right here.
Please use IP A command if you are on a newer version
of Red Hat or CentOS system.
If you do not remember the interface ENPS3,
then you could just simply type ifconfig,
sorry, ifconfig,
and it will show all the interfaces.
But you are looking for the one right here.
So, 10.253.1.59.
For my Red Hat 8 machine,
let's clear the screen
and let's use it another command.
IPA A address.
Here I have this ENP0S3
and my IP address 10.253.1.18.
So, one is 1.18 and one is 1.59.
So, let's go into our,
let me close this.
I had that open.
So, let me go into https://10.253.1.18/9090.
Hit enter one.
1.18 is my Red Hat 8 server.
So, if I go back into my Red Hat 8 server right here,
10.250.1.18
For my CentOS 7, I have 59.
So, I could come here,
close this, and I'll type https,
for secure,
//10.253.1.59:9090.
Okay, you have to make sure
that the firewall is disabled on your Linux machine as well
for you to connect from your desktop machine
to your Linux machine.
If you do not want to disable your firewall,
you could simply go to application Firefox,
open up a web browser,
and you could simply type https://localhost
or the IP address of this machine,
which is 10.253.1.59:9090.
Hit enter and you're gonna see,
it will take you to that site.
So, it means this machine,
if I'm not getting an access from my browser,
that means the firewall is running.
So, what I could do is I could go into the Linux CentOS 7
and I could stop the firewall.
So, for that I have to do systemCTL stop firewall D.
Okay, it is stopped.
Now let's go and refresh right ahead.
We got that potential security risk message,
which means we are accessing through the secure website
port 443.
That's why we are getting this error message.
Click on advance and click accept risk and continue.
All right, beautiful.
So, now we have, right here,
this is our Red Hat 8,
and this is our CentOS 7.
All right, so let's go to Red Hat 8 first,
login as yourself, Afzal.
If you have a local user
or you could just simply log in as root.
Let's try the same thing here.
I'm sure you remember the root password.
Let's log in on both sides.
Okay, so here you'll see
you'll get a lot of different options,
a lot of different tools on the left hand side.
This is your host name of your Linux machine
and it's telling you're running
Red Hat Enterprise Linux 8.4.
Last login, the health status.
The security updates are available,
so if I click on it,
it will go fetch this updates and install them
and it will give me the health update,
it'll give me the health of my system,
the usage, CPU usage, memory usage.
If you wanted to see detailed history,
you could click on that.
System information, ID uptime,
it's been 16 minutes.
My host name, system time, domain, performance,
secure and all that information,
you could find it here.
Right from this page,
you could reboot the machine
or shut down the machine as well.
Now of course you have to log in as root
to do or perform both of these functions.
As a regular user, you cannot,
you will not get these two options.
All right, moving on to the next tab
or next option on our navigation tree.
Here we have logs.
These are the logs that we have available.
If you wanted to see error
and about critical only, emergency only,
you could see all of that.
But you could modify if you want.
If you just want info and about,
you'll see all these logs information.
Storage, this will tell you your storage information
and your device name.
Where is it mounted to, what's the size?
This is exactly as if you are running DF-H command.
You'll get both of the partition.
See right here, it's iSCSI targets
and it tells you the total size of your disc,
which is Dev SDA,
and it tells you it's 20 gig.
Store logs.
So, you have more information about your storage right here.
You'll also get more information about your reading
and writing performance.
Then we'll go to networking.
On the networking side,
you'll see it is showing you both of your interface ENPS03
and virtual adapter.
So, you could create a bond
if you have two interface
or a team,
which is both are the same team is just a newer version.
Or you could create a bridge or add a VLAN.
This can all be done through this web interface.
Isn't it cool?
Yes, I did find it very cool
where you don't have to remember every command.
But of course if you are command savvy,
you could just go in and run the commands
to create your network bonding or teaming.
Then this is about the containers.
Let's skip that for now, which we'll cover later on.
We'll come to the accounts.
If you wanted to create more accounts to your system
just like that,
you could click on create new account.
Right now my Linux machine has only two accounts,
which is Root and Afzal.
If you have more accounts, it will show up right here.
All right, next is the services.
These are all the services we have running
in our Linux machine.
It could take some time.
While it's loading,
we'll go into our CentOS 7,
and we'll see some of the information
which is pretty much similar to Red Hat 8.
So, you could get logs here,
and you could get networking where you have the same option
to add a bond, add a team, bridge VLAN.
Same thing with the accounts.
I had only two accounts on my CentOS 7 services.
This will load.
Oh, this has loaded pretty fast.
These are all the services that we have running,
which you could manage which systemCTL command.
See right here, all of them ends with .service.
You could actually right here,
click on it,
and stop the service right from your web interface.
If you go back to Red Hat 8,
and you have right here,
see it's a static enabled,
whichever that you wanted to manage the services,
you could do it right here.
Awesome.
Moving down to applications.
Here we have a list of applications that we have installed
or you could remove it.
Diagnostic report.
This is where if you are troubleshooting anything
in your computer
and you wanted to collect the logs or configuration files,
just like SOS report,
then you will have to create or generate
this report right here by clicking create report.
And this could take anywhere from two minutes
to 10 minutes depending on the size of your system.
And once you have that report generated,
then you could download and send it off to Red Hat support
so they could take a look.
Then we have kernel dump information,
reserve memory and where is it located?
SELinux functionality can be pulled from right here.
You could control your SELinux,
how you can assign,
you could enforce it or disable it,
or provide permissive information.
System software updates right here.
Whatever the update is available to you,
you could download and you could install.
You could install all updates in one shot right here,
just like as if you're running in Linux yum install
or yum update, sorry.
Yum update or yum upgrade.
Then you have subscription.
What is the subscription that you have?
It says the subscription right here,
Red Hat Enterprise for 8664.
If I expand it,
it'll tell me more information,
when it starts,
what's the status,
and when it ends.
Now another cool thing is terminal.
This is the terminal.
Let's say if you are a remote,
if you're using your web interface,
you could run the same command
that you would run on your putty
or any of the console terminal.
Isn't it cool?
This is also one of the coolest feature
of this web interface.
Moving back to CentOS 7.
Pretty much all, everything is the same.
A few of the options are not there for 7,
that are available in 8.
Then if you wanted to access the terminal the same way,
you'll come here and access the terminal.
All right.
So, spend some time on this web interface.
This is the newest feature that's been added
in a newer version of Red Hat 8.
But the good thing is that you could also install
that on version 7 if you wanted to use it
on CentOS or Red Hat 7 versions.