Processes & Services
Basic Definitions
- Application
- Script
- Process
- Daemon
- Thread
- Job
Monitoring and Management
|
command |
example |
function |
|
fdisk |
fdisk -l |
disk partitioner -l list disks |
|
df |
df -h |
filesystem capacity |
|
du |
du -sh /var/log |
size of each item in directory |
|
uptime |
uptime -p |
shows urrent time, uptime and load usage % past 1, 5, 15 minutes |
|
top |
top -h |
display linux processes (human readable) |
|
free |
free -h |
display amount of free and used system memory (human readable) |
|
lsof |
lsof -I :80 |
list open files (using port 80) |
|
tcpdump |
tcpdump -i eth0 |
capture packets flowing through interface eth0 |
|
ps |
ps -ef --forest |
current processes snapshot (tree diagram) |
|
kill |
kill 34448 |
terminates a process (PID) |
top
|
PID |
USER |
PR |
NI |
VIRT |
RES |
SHR |
S |
%CPU |
%MEM |
TIME+ |
COMMAND |
top columns
|
PID |
id |
|
USER |
owner |
|
PR |
focus priority |
|
NI |
the nice value |
|
VIRT |
amount of virtual memory in use |
|
RES |
amount of resident memory in use |
|
SHR |
amount of shared memory in use |
|
S |
status of the process |
|
%CPU |
share of CPU time since last update |
|
%MEM |
share of physical memory in use |
|
TIME+ |
total cpu time used (hundredths of a second) |
|
COMMAND |
name of the command or process |
Services & Daemons
|
systemctl --version |
Check if systemd is installed |
|
ps -ef | grep system |
check if systemd is running |
|
systemctl --all |
check all running services |
|
systemctl status/stop/start/restart application.service |
status/start/stop/restart application.service |
|
systemctl reload application.service |
reload the config of a service |
|
systemctl enable/disable application.service |
enable or disable at boot |
|
systemctl mask/unmask application.service |
enable or disable completely (ignore dependencies) |
Logs
|
/var/log |
log directory |
Log Examples
- boot (overwrites upon boot)
- chonyd / ntp
- cron
- maillog
- secure
- messages
- httpd
Technical Support and Analyse Server
|
sos report |
collect logs and configuration file then transfer to Redhat support server |
|
cockpit |
|
|
ping www.google.com |
verify internet connectivity |
|
rpm -qa | grep cockpit |
verify cockpit package is installed |
|
yum/dnf install cockpit -y |
install cockpit (Red Hat, CentOS) |
|
apt-get install cockpit |
install cockpit (Debian, Ubuntu) |
|
systemctl start/enable cockpit.socket |
relies on socket activation to start |
|
systemctl status cockpit |
verify |
|
systemctl status cockpit.socket |
verify |
|
firewall may need to be disabled (safe for labs) or rule created log in with root or system user can be used to manage everything including terminal access |