3. Topics To Be Covered
Contents:
1. Introduction
2. Installation of Linux / Ubuntu
3. Packages installation
4. Snapshots of Execution
5. Conclusion
6. References
3
Rajarambapu Institute of Technology , Islampur Sangli
11/21/2021
4. Linux System Monitoring
4
Rajarambapu Institute of Technology , Islampur Sangli
11/21/2021
Operating systems control our hardware and run our application on them.
How can we monitor Linux operating system?
The monitoring and maintenance of the system is most important task.
There are many commands line utilities created for this purpose.
When we speak about monitoring it is the matter of all hardwares and users such as
CPU, ethernet, Users, Memory , Storage
5. Installation of Linux / Ubuntu
5
Rajarambapu Institute of Technology , Islampur Sangli
11/21/2021
1) Download Virtual Box
2) Create a new virtual machine
3) Enter name, select operating system and version
4) Allocate memory to VM (2000MB recommended)
5) Install Ubuntu
6) Open VM, Click on new Ubuntu virtual machine and hit start button.
7) Enter your preferred name, username and password
8) The installation will continue until it is finished
9) After installation is complete, click a restart now button
10) Enter the password you have chosen and press enter
11) The Ubuntu desktop OS is ready.
6. Packages installation
6
Rajarambapu Institute of Technology , Islampur Sangli
11/21/2021
1)Vmstat - sysstat package(that include vmstat program)
2)Htop - htop packages are mostly available in modern Linux distributions and
can be installed using the default package manager from system
3)Iostat - sysstat package
4)Psacct or acct - Psacct or acct package (both are similar package)
5)Top - procps-ng package
6)Lsof - lsof package
7)Netstat - net-tools package
8)Iotop - iotop package
9)Iftop - iftop package
10)Strace ls- strace package
11)Cloudcmd & - cloudcmd package
7. Snapshots of Execution
Rajarambapu Institute of Technology , Islampur Sangli
7
top command is used to show the Linux
processes. It provides a dynamic real-
time view of the running system.
Usually, this command shows the
summary information of the system and
the list of processes or threads which
are currently managed by the Linux
Kernel.
8. Rajarambapu Institute of Technology , Islampur Sangli 8
vmstat command in Linux/Unix is a performance
monitoring command of the system as it gives the
information about processes, memory, paging, block IO, disk,
and CPU scheduling. All these functionalities makes the
command vmstat also known as virtual memory statistic
reporter
The ps command, short for Process Status, is a
command line utility that is used to display or view
information related to the processes running in a Linux
system. As we all know, Linux is a multitasking and
multiprocessing system. Therefore, multiple processes
can run concurrently without affecting each other
Using the ps aux Command in Linux. The ps aux command
is a tool to monitor processes running on your Linux
system. A process is associated with any program running
on your system, and is used to manage and monitor a
program's memory usage, processor time, and I/O resources
9. Rajarambapu Institute of Technology , Islampur Sangli 9
lsof command stands
for List Of Open File. This
command provides a list of
files that are opened.
Basically, it gives the
information to find out the
files which are opened by
which process. With one go
it lists out all open files in
output console.
10. 11/21/2021 Rajarambapu Institute of Technology , Islampur Sangli 10
iotop or Input/Output top is a command in
Linux which is used to display and monitor the
disk IO usage details and even gets a table of
existing IO utilization by the process. It is
designed in python and needs kernel modules
for its execution. It is used by system
administrators to trace the specific process
that may be causing a high disk I/O
read/writes.
Netstat command displays various
network related information such as
network connections, routing tables,
interface statistics, masquerade
connections, multicast memberships etc.,
To show both listening and non listening
sockets.
11. 11/21/2021 Rajarambapu Institute of Technology , Islampur Sangli 11
htop command in Linux system is a
command line utility that allows the user to
interactively monitor the system’s vital
resources or server’s processes in real
time. htop is a newer program compared
to top command, and it offers many
improvements over top command. htop
supports mouse operation, uses color in its
output and gives visual indications about
processor, memory and swap usage. htop
also prints full command lines for processes
and allows one to scroll both vertically and
horizontally for processes and command
lines respectively.
iftop is a network analyzing tool used by system
administrators to view the bandwidth related
stats. It shows a quick overview of the networking
activities on an interface. It stands from Interface
TOP and the top is derived from op command in
Linux. It even acts as a diagnostics to diagnose
which program is causing the problem to the
network.
12. 11/21/2021 Rajarambapu Institute of Technology , Islampur Sangli 12
ac prints out a report of connect time (in hours) based on
the logins/logouts in the current wtmp file. A total is also
printed out.
ac -p
Print time totals for each user in addition to the usual
everything-lumped-into-one value.
ac --reboots
Reboot records are NOT written at the time of a reboot, but
when the system restarts; therefore, it is impossible to know
exactly when the reboot occurred. Users may be logged in to
the system at the time of the reboot, and many ac's
automatically count the time between the login and the reboot
record against the user (even though all of that time shouldn't
be, perhaps, if the system is down for a long time, for instance.)
If you want to count this time, include the flag. For maximum
compatibility with all versions of ac, include this flag.
13. Rajarambapu Institute of Technology , Islampur Sangli 13
The iostat command is used to monitor the load on server
input/output (I/O) devices by observing the time the
devices are active compared to the average transfer rate of
the device.
Uptime Command In Linux: It is used to find out how
long the system is active (running). This command
returns set of values that involve, the current time, and
the amount of time system is in running state, number
of users currently logged into, and the load time for the
past 1, 5 and 15 minutes respectively.
The strace command can be used to intercept
and record the system calls made, and the signals
received by a process. This allows examination of
the boundary layer between the user and kernel
space which can be very useful for identifying
why a process is failing.
14. 11/21/2021 Rajarambapu Institute of Technology , Islampur Sangli 14
Cloud Commander is a file manager for the web. It includes a
command-line console and a text editor. Cloud Commander
helps you manage your server and work with files, directories
and programs in a web browser from any computer, mobile or
tablet.
The mpstat command reports on the activities of each of the
available CPUs on a multi-processor server. Mpstat also
reports on the average activities of all your server’s CPUs. It
enables you to display overall system statistics per system or
per processor.
15. Rajarambapu Institute of Technology , Islampur Sangli 15
Kill -l
To display all the available
signals .
16. Conclusion..
Conclusion :
On a system with GUI, we can achieve system monitoring using a Task
Manager or Activity Monitor. But when we work with the command line
we cannot just open up a graphical task manager. These above mentioned
commands would help in monitoring any Linux system or remote server.
Sometimes it may require more specific tools to debug an issue in Linux
system performance.
16
Rajarambapu Institute of Technology , Islampur Sangli
11/21/2021