Crates.io | hdd |
lib.rs | hdd |
version | 0.10.3 |
source | src |
created_at | 2017-11-01 15:07:43.461596 |
updated_at | 2020-06-22 23:01:17.565439 |
description | hdd: instruments for querying ATA and SCSI disks |
homepage | |
repository | https://github.com/vthriller/hdd-rs |
max_upload_size | |
id | 37676 |
size | 238,927 |
hdd
: instruments for querying ATA and SCSI disksThis is work in progress.
Mainly because I was disappointed in all the available options for putting SMART and SCSI log info into various monitoring systems.
smartctl
output (usually with regexes) are slow, ugly, unreliable hacks.smartctl
(e.g. JSON), one basically needs to rewrite a lot of ad-hoc printf
s scattered all over the source files, and it's not much easier if you decide to drop the idea of implementing some command-line switch in favour of simply changing the output format altogether. (Things are only getting more complex with smartd
.)libatasmart
(and tools that it powers) can only work with ATA devices, and only on Linux, and expecting more from that library is simply naïve.This crate can be built on Rust >= 1.21.
git clone https://github.com/vthriller/hdd-rs.git
cd hdd-rs
cargo build --release --features='bin serializable' --bin=hdd
sudo ./target/release/hdd /dev/sda attrs --json
(Sorry if that looks complicated.)
You can build static binary if, say, you want it for remote GNU/Linux system that runs older version of glibc:
rustup target add x86_64-unknown-linux-musl
),--target x86_64-unknown-linux-musl
to the cargo build
line.Put this into your Cargo.toml
:
[dependencies]
hdd = "0.10"
Platforms and transports:
SCSI/ATA translation is also supported.
¹ Note that in Linux, ATA is only supported through SAT, although SG_IO kindly emulates that for SATA (and, possibly, PATA?) disks for us.
Features:
rg 'TODO|FIXME|XXX|((?i)WTF)|unimplemented!|\b(unwrap|expect)\b' src sample-scsi/src build.rs
smartctl -r ataioctl,2
or skdump
) for CLI tool.Here goes obligatory mention of smartmontools contributors who laid foundations of what this crate currently is.
This crate is distributed under the terms of Mozilla Public License version 2.0.