karate405 @Wiki
Linux commands for server troubles
最終更新:
匿名ユーザー
-
view
| contents in this page |
Log and Warning
- real time log file checking
checking last 10 lines # tail -f -n 10 /var/log/messages
- finding hidden file
find "file name" from top directory # find / -name "file name" -print but if directory path is known # find / "directory path" "file name" -print
- finding file with keyword
# grep "keyword" *
- finding file with keyword iterately
same as the grep option above, but working iterately
# find / -type f -exec grep -H "keyword" {} \;
# find / -type f -print | xargs grep "keyword"
in addition. if grep equipped "-r" option
# grep -r "keyword" *
Device
''obtain device information''
there are file with current device information and
process information under "/proc" directory
there are file with current device information and
process information under "/proc" directory
- device recognization when starting OS
# dmesg
- CPU information
# cat /proc/cpuinfo
- I/O information
# cat /proc/ioports
- device interruption address
# /proc/interrupts
- disk pertition ratio
# /proc/partitions # fdisk -l
- connection device list and vender name, type number PCI bus address
# lspci
- connection device list and vender name type number
# scanpci
- loaded module confirmation
# lsmod
Network
- check if Linux recognizes erthanet card (NIC)
# ifconfig expected result if working properly includes eth0 and UP to display
Using "ping" command
General ping command # ping "host name or IP address" ping command with packet size # ping -l "packet size" "host name or IP address"
- no responce
- respond sometimes
- average responce time changes extream
- proper responce from DNS server but no reply for
"dig"command - no responce from default gateway
- sharp responce to small packet but creeping to large
packet
Using "traceroute" command
checking till where packet is sent
checking till where packet is sent
# traceroute "host name or IP address"
Using "dig or nslookup" command
Using "netstat" command
- routing table confirmation
# netstat -rn
- checking server condition and port condition
# netstat -a
- interface status confirmation
# netstat -i
- troubles with cable or hub can be assumed if diplaying
lots of errors(*-ERR) - netork trouble is occured if ratio of received byte
(RX-OK) / (RX-ERR) exceeds 20%
Server
"telnet" command is used to check service with port
number
number
- mail(SMTP) checing
# telnet localhost 25 SMTP protocol command # EHLO "domain name" specifies client side host name and IP address and those information indicated on receiver's mail header "received" # VRFY user checkes user existence # TURN swops role in between client and server # MAIL FROM:<"sender"> specifies mail sender # RCPT TO:<"receipient"> specifies mail receiver # DATA specifies where to start writing mail body # RSET clear prompted commands before typing RSET command # HELP command displays available command # NOOP works as "keep alived packet", using as a prevention of connection time out # QUIT disconnects connection