Show Menu
Cheatography

DevOps Troubleshooting Study Guide Cheat Sheet by

A brief review of the commands found in the book DevOps Troubleshooting.

System Load

uptime
5; 10; 15 minute CPU load average
top -b -n 1
(b)atch mode; (n)times to update before closing
systat pkg
/etc/d­efa­ult­/sy­sstat 'ENABL­ED=­"­tru­e"'
iotop
top, but for disk usage
iostat
shows I/O stats for blk devices.
sar
view sysstat logs for the day
sar (-r) (-b)
-r View ram statistic ; -b view I/O statistics
sar -s 00:00:00 -e 00:00:00
view stats within range date (s)tart to (e)nd
sar -f /var/l­og/­sys­sta­t/sa**
from full path
 

Disk Management

e2label /dev/sd* /
Change the label on a ext* filesystem
blkid
locate­/print block device attributes
/etc/fstab
file systems mounted at boot.
du -ckx | sort -n
Disk Usage (c)Total (k)1k Blk Size (x) one file system. sort by number
/etc/l­ogr­ota­te.conf
edit logrotate settings
df -i
report disk space usage, (i) inodes
fsck -y -C /dev/sda*
file system check (y) yes (C) progress bar
mke2fs -n /dev/sda*
list superb­locks on a file system.
fsck -b (super­block) -y -C /dev/sda*
run fsck and repair superblock with backup

Networking Troubl­esh­ooting

ifconfig
gather inform­ation about network adapters
ethtool eth0
tool to analyze Ethernet connec­tion.
sudo route -n
check routing table, (n)o dns resolution
sudo service networking restart
restart networking service
nslookup
query dns for URL/IP
traceroute
traces route to host
nmap -p $port $ipaddr
check (p)ort range with $ipaddr
sudo netstat -lnp
show only (l)ist­ening sockets (n)umeric (p)pro­gram, shows PID and name of program
iptables -L
Show all firewall rules
iftop
top for open network connec­tions
tcpdump -n
packet dump
tcpdump (not) host/port
filter options for tcpdump
sudo tcpdump -C 10 -n -l host website | tee outputfile
run tcpdump and output to file, -C sets max size of output file
dig website
like nslookup, more inform­ative.
dig target @dns
check dns record of target against specific dns
dig target +trace
traces DNS route
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          DevOps Cheat Sheet

          More Cheat Sheets by jhaley32

          Linux