SSH into multiple servers, run smartctl
and aggregate results into a CSV.
-
Install
smartctl
on every host:ansible all -m shell -a 'sudo apt-get -y install smartmontools'
-
Update
smartctl
's drive database:ansible all -m shell -a 'sudo update-smart-drivedb'
-
Run SMART "long" test on every disk of every host:
ansible all -m shell -a 'smartctl --scan | cut -d "#" -f 1 | xargs -I {} smartctl -a {} -t long'
Wait a few hours for them to complete.
-
Add all hosts to be tested to
~/.ssh/config
, e.g.:Host ifill HostName ifill AddressFamily inet User ansbl ProxyJump tarbell IdentityFile ~/.ssh/mediacloud-ansbl-20200812 # <...>
-
Run
smart_aggregate.py
against all hosts:./smart_aggregate.py --host \ tarbell \ berstein \ posey \ bly \ lowery \ steinam \ woodward \ ramos \ brown \ wells \ sinclair \ bradley \ ifill \ stewart \ guerin \ > smart.csv