Tuesday, July 22, 2008
Monitoring hard disk with smartmontools
To install smartmontools on fedora:
# yum install smartmontools
Make sure your hard disk is smart capable
# smartctl -i /dev/sda
smartctl version 5.37 [i386-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Model Family: Western Digital Caviar SE (Serial ATA) family
Device Model: WDC WD800JD-60LSA5
Serial Number: WD-WMAM9MA75547
Firmware Version: 10.01E03
User Capacity: 80,026,361,856 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Tue Jul 22 10:05:31 2008 MYT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Smart support is available for this hard disk and enabled
To monitor your hard disk health
# smartctl -H /dev/sda
smartctl version 5.37 [i386-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
To run test on your hard disk
# smartctl -t short /dev/sda
To see the selftest logs of smartctl
# smartctl -l selftest /dev/sda
See all options for smartctl
# smartctl -h
Manual for smartctl
# man smartctl
Wednesday, July 16, 2008
mtr, another network diagnostic tool
mtr is a network diagnostic tool that combine both traceroute and ping in one easy to use tool. As mtr starts, it investigates the network connection between the host mtr runs on and HOSTNAME, by sending packets with purposely low TTLs. It continues to send packets with low TTL, noting the response time of the intervening routers. This allows mtr to print the response percentage and response times of the internet route to HOSTNAME. The good thing about mtr is, it will run until we ask it to quit by pressing 'q'. That means we will have a live traceroute and ping that will keep updating until we ask it to stop.
To use mtr, just type:
$ mtr HOSTNAME
example:
$ mtr www.google.com
It will display the a few statistics about ping and packets, enough for us to do some basic network diagnostics work.