Created
August 12, 2016 22:56
-
-
Save NeuralGlue/01341c2291e0dd35034a26a5f20e2e8c to your computer and use it in GitHub Desktop.
This file contains 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 | |
# | |
# Check_mk | |
# plugin for freebsd based systems that have disks on /dev/ada? | |
# | |
# This plugin produces the correct output to be parsed by the smart.temperature and the smart.stats checks | |
echo '<<<smart>>>' | |
for disk in `ls /dev/ada?`; | |
do | |
VEND=ATA | |
MODEL=$(smartctl -a $disk | grep -i "device model" | sed -e "s/.*:[ ]*//g" -e "s/\ /_/g") | |
CMD="smartctl -v 9,raw48 -A $disk" | |
[ -n "$CMD" ] && $CMD | grep Always | egrep -v '^190(.*)Temperature(.*)' | sed "s|^|$disk $VEND $MODEL |" | |
done 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment