Subversion Repositories sysadmin_scripts

Rev

Rev 155 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

# getDriveInfo

Scans all hard drives on Unix systems, using smartctl to determine parameters
like make/model, serial number, hours uptime, etc... and sends a tab
delimited report to STDOUT

Looks for file /etc/drive_bays and, if it exists, populates the physical bay
a drive in.

Looks for the following binaries and uses if they exist. Will not fail if the
binaries do not exist.

- FreeBSD
  - geom
  - glabel
- Linux
  - lsblk
  - mdadm
- All systems
  - zpool
  - smartctl
  - uses Perl library JSON if it is available

Tested on Devuan Linux and FreeBSD

### Utilities

findmissing is a simple Perl script to use if you have run this program and
populated it with the bays the drives are in. I wrote this to handle a
situation where I know a drive has failed, but I have no bloody idea which
one it is in.

It will look for all drives on the system, grab the serial numbers, then
compare that list with [/usr/local]/etc/drive_bays,
[/usr/local]/etc/drives.tsv or what is sent in via STDIN (usually a pipe).
It wil then simpy dump the line which does NOT match.

Generated by GNU Enscript 1.6.5.90.