Created
June 30, 2016 00:34
-
-
Save dashbad/6186f5ed31d9384dfbc272b5aa1d844a to your computer and use it in GitHub Desktop.
collectd exec script to collect zpool capacity information
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}" | |
INTERVAL="${COLLECTD_INTERVAL:-60}" | |
while sleep "$INTERVAL"; do | |
VALUE="$(zpool list -Ho capacity)" | |
VALUE="$(echo "${VALUE: :-1}")" | |
echo "PUTVAL $HOSTNAME/zpool_capacity/percent interval=$INTERVAL N:$VALUE" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment