Diagnostic - jasper-zanjani/dotfiles GitHub Wiki

ausearch

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

date

        d   f                       r s   u          
                  I                 R                

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

df

  a             h i   k l m   o         t       x    
    B           H               P       T            

du

0 a b c         h     k l m           s         x    
    B   D               L       P     S         X    

free

Display amount of free and used memory in the system [ref][L5PMT-memory]

free -m

glances

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]

hwclock

Connection to an NTP server is necessary for a variety of services.

Linux systems have two clocks:

  1. hardware clock/real-time clock (RTC)
  2. system clock

Manually synchronize hardware clock to system clock (generally only required if no NTP server is available)

hwclock --hctosys

ioping

Displays disk latency in the same way that ping shows network latency [ref][L5PMT-disk]

iotop

lsb_release

Display version of Ubuntu

lsb_release -sc

ldd

Display dependencies of $PROGRAM

ldd $PROGRAM

lscpu

Display CPU architecture information [ref][L5PMT-cpu]

mpstat

Report processor-related statistics (part of "sysstat" package). [ref][L5PMT-network]

mpstat -P all

netstat

netstat -tulpn

nproc

Display number of CPU processors or cores [ref][L5PMT-cpu]

ntpdate

Synchronize system clock to that of an online Network Time Protocol server

ntpdate -upool.ntp.org

pmap

Report memory map of a process (part of "sysstat" package). [ref][L5PMT-network]

sar

    b   d   f               n o   q r     u v        
  A B                           P   R         W      

sosreport

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

sysbench

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

syslog

System logging facility used for messages from the kernel

uname

  a               i       m n o p   r s     v        

uptime

[ref][L5PMT-cpu]

vmstat

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
⚠️ **GitHub.com Fallback** ⚠️