Monitoring remote disk usage health
Disks fill up and sometimes wear out. Even RAIDed storage systems can fail if you don't replace a faulty drive before the others fail. Monitoring the health of the storage systems is part of an administrator's job.
The job gets easier when an automated script checks the devices on the network and generates a one-line report, the date, IP address of the machine, device, capacity of device, used space, free space, percentage usage, and alert status. If the disk usage is under 80 percent, the drive status is reported as SAFE
. If the drive is getting full and needs attention, the status is reported as ALERT
.
Getting ready
The script uses SSH to log in to remote systems, collect disk usage statistics, and write them to a log file in the central machine. This script can be scheduled to run at a particular time.
The script requires a common user account on the remote machines so the disklog
script can log in to collect data. We should configure auto-login with SSH...