Subversion Repositories sysadmin_scripts

Rev

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

Rev Author Line No. Line
173 rodolico 1
# getDriveInfo
2
 
151 rodolico 3
Scans all hard drives on Unix systems, using smartctl to determine parameters
173 rodolico 4
like make/model, serial number, hours uptime, etc... and sends a tab
5
delimited report to STDOUT
151 rodolico 6
 
7
Looks for file /etc/drive_bays and, if it exists, populates the physical bay
8
a drive in.
9
 
10
Looks for the following binaries and uses if they exist. Will not fail if the
11
binaries do not exist.
12
 
173 rodolico 13
- FreeBSD
14
  - geom
15
  - glabel
16
- Linux
17
  - lsblk
18
  - mdadm
19
- All systems
20
  - zpool
21
  - smartctl
22
  - uses Perl library JSON if it is available
151 rodolico 23
 
173 rodolico 24
Tested on Devuan Linux and FreeBSD
151 rodolico 25
 
173 rodolico 26
### Utilities
27
 
28
findmissing is a simple Perl script to use if you have run this program and
29
populated it with the bays the drives are in. I wrote this to handle a
30
situation where I know a drive has failed, but I have no bloody idea which
31
one it is in.
32
 
33
It will look for all drives on the system, grab the serial numbers, then
34
compare that list with [/usr/local]/etc/drive_bays,
35
[/usr/local]/etc/drives.tsv or what is sent in via STDIN (usually a pipe).
36
It wil then simpy dump the line which does NOT match.