Diagnostic - jasper-zanjani/dotfiles GitHub Wiki
Display audit logs from {startdate} to {enddate}
ausearch --start startdate--end enddate
Search audit logs for today for logins of UID 500
ausearch --start today --loginuid500
Metacharacters
a
b
c
d
e
g
h
j
k
l
m
n
p
r
s
t
u
w
x
y
A
B
D
F
G
H
I
M
N
R
S
T
U
V
W
X
Y
Z
Set only the year using "next year"
or "last year"
date -s "next year"
date -s "last year"
Set only the day
date -s "next day"
date -s "monday"
Display the date fifty days into the future [devconnected.com][https://devconnected.com/user-administration-complete-guide-on-linux/#Setting_an_account_expiration_date_easily]
date -d '+50days' +%F
0
a
b
c
h
k
l
m
s
x
B
D
L
P
S
X
Display amount of free and used memory in the system [ref][L5PMT-memory]
free -m
Cross-platform monitoring tool, written in Python. [ref][L5PMT-glances]
Config | Description |
---|---|
/etc/default/glances | Change value of RUN to "True" in order to have glances run on startup [ref][L5PMT-glances] |
Connection to an NTP server is necessary for a variety of services.
Linux systems have two clocks:
- hardware clock/real-time clock (RTC)
- system clock
Manually synchronize hardware clock to system clock (generally only required if no NTP server is available)
hwclock --hctosys
Displays disk latency in the same way that ping
shows network latency [ref][L5PMT-disk]
Display version of Ubuntu
lsb_release -sc
Display dependencies of $PROGRAM
ldd $PROGRAM
Display CPU architecture information [ref][L5PMT-cpu]
Report processor-related statistics (part of "sysstat" package). [ref][L5PMT-network]
mpstat -P all
netstat -tulpn
Display number of CPU processors or cores [ref][L5PMT-cpu]
Synchronize system clock to that of an online Network Time Protocol server
ntpdate -upool.ntp.org
Report memory map of a process (part of "sysstat" package). [ref][L5PMT-network]
SOS is an open-source data collection tool that can be used to collect system configuration details and diagnostic information from a Unix-like operating system. It is installed by default on Ubuntu Server. howtoforge.com
Collect system configuration details (without arguments, the report will be generated and stored in $TMPDIR
)
sosreport
Specify alternative temporary directory
sosreport --tmp-dir /opt
Specify alternative compression (xz
by default)
sosreport --compression-type gzip
Generate report for only specific plugins
sosreport -o apache --batch
Benchmark CPU by calculating prime numbers YouTube
sysbench --test=cpu --cpu-max-prime=20000 run
File I/O benchmarking YouTube
sysbench --test=fileio --file-total-size=10G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run
System logging facility used for messages from the kernel
[ref][L5PMT-cpu]
Output header | Description [ref][Eckert] |
---|---|
r |
number of processes waiting to be run |
b |
number of sleeping processes |
swpd |
amount of swap memory used (KB) |
free |
free physical memory (KB) |
buff |
memory used by buffers (KB) |
cache |
memory used as cache |
si |
memory swapped in to the disk (KB/s) |
so |
memory swapped out to the disk (KB/s) |
bi |
blocks per second sent to block devices |
bo |
blocks per second received from block devices |
in |
number of interrupts sent to the CPU per second |
cs |
number of context changes sent to the CPU per second |
us |
CPU user time |
sy |
CPU system time |
id |
CPU idle time |
wa |
time spent waiting for I/O |
st |
time stolen from a virtual machine |