troubleshooting /var/log syslog.con dmesg rout lpq kill

Troubleshooting Problems in a Linux System

Types of Problems
- Hardware
- Operating System (Kernel)
- Application Software
- Configuration (change /etc files, change .dotfiles)
- User


Plan of Attack

1.Observe problem first hand
2.Formulate a guess as to cause
3.Attempt to fix
4.Go back to step 1 until fixed


Preventative Measures
- Buy supported hardware
- Stay away from untested software (Beta versions)
- Don't overclock your processor

#cd /var/log

boot.log - information about boot messages
mail.log - info about mail utility

To keep track what does each files hold:
#cd /etc/
#more syslog.conf

#man syslog.conf:
Here you can find priorities:
debug,info,notice,warning,warn,err,error,critical,alert,emerg(should be fixed imidiately),panic

#Don't log private authentication messages
*.info;mail.none;authpriv.none;cron.none
/var/log/messages

#Log all the mail messages in one place
mail.* /var/log/maillog

#Log cron stuff
cron.* /var/log/cron

#Everybody gets emergency messages
*.emerg *

* - in emergency mean that log can be appeared every where and
everybody on a system can see this message



You can log log files on a remote computer,
It's more secure way of keeping your log files


dmesg - kernel messages

dmesg | more -
shows OS, Proc MHZ,kernel info,caches,info about driver
Information about hardware


ifconfig eth0 - gives information about ethernet interface


route - shows ip routing table

lpq - shows print queue

top - displays information about proccesses that are running in your system. Every 5 sec reload
PRI - priority


ps - process status command
kill -9 PID


#cd /etc/init.d
#ls
Here stores all main processes



#/etc/init.d/sendmail restart


#lock files --- ????

#more xinetd.conf

If you want to change this config (EXAMPLE) xinetd.conf,
than you should restart /etc/xinetd.conf restart command

BUT SOMEBODY CAN USE xinetd SERVICE!!!


Better solution to do HUP!

#kill -l

#kill -1 1234 --- will hup (1) the process 1234


Troubleshooting
- Types of problems (software,etc)
- Log files (gather information,mail error, cron error)
- Tools (ifconfig, fsck) to determine what a root of the problem is
- Stop,Start,HUP

Comments

Popular posts from this blog

HAproxy logging

teamcity Automatic Agent Start under Linux

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all