Linux - Analyzing and Troubleshooting System Faults

  • Personal profile: Cloud computing network operation and maintenance professionals, understand operation and maintenance knowledge, master TCP/IP protocol, share network operation and maintenance knowledge and skills every day.
  • Motto: The sea does not shy away from water, so it can become big; the mountain does not shy away from stones, so it can grow taller.
  • Personal homepage: Xiaolihui Technology's homepage

Table of contents

log function 

Classification of log files 

 log message level

User log analysis tools:

command summary


log function 

 1>It is used to record various events that occur in the system and program operation
2>By reading the log, it is helpful for diagnosing and solving system failures

Classification of log files 

  • 1 Kernel and system logs
  •  Unified management by the system service syslog, the log format is basically similar
  • 2 user logs
  •  Record system user login and logout information
  • 3 program log
  •  Log files independently managed by various applications, the record format is not uniform

 log message level

  • 0 EMERG (emergency): a condition that would render the host system unavailable
  • 1 ALERT: A problem that requires immediate action
  • 2 CRIT (serious): more serious situation
  • 3 ERR (error): An error occurred while running
  • 4 WARNING: Events that may affect system functionality
  • 5 NOTICE (Note): Will not affect the system but worth noting
  • 6 INFO (information): general information
  • 7 DEBUG (debugging): program or system debugging information, etc.

 

User log analysis tools:

1> Query the status of the currently logged-in user: users, who, w
2> Query the history of user login: last (success), lastb (failure)

  • Save the user login, logout system and other related information
  • /var/log/lastlog: recent user login events
  • /var/log/wtmp: user login, logout and system startup and shutdown events
  • /var/run/utmp: details of each user currently logged in
  • /var/log/secure: Security events related to user authentication
  • Analysis tools users, who, w, last, lastb

command summary

Log default save location: /var/log directory  

forget ROOT password, use the command
chroot /mnt/sysimage
passwd root

View the usage of i nodes in the file system
df -i /data

The command to detect disk bad sectors: 
badblocks -sv /dev/sdb
("-v": display details "-s": display progress information)
 

Whether you come or not, the flowers will bloom for you.
Thank you for your support and attention to collection~~Welcome to CSDN

 

 

Guess you like

Origin blog.csdn.net/m0_64292323/article/details/130820615