Created
June 19, 2013 08:00
-
-
Save remore/5812480 to your computer and use it in GitHub Desktop.
usage: check_disk_usage.sh <SERVER-NAME>
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 | |
# usage: | |
# check_disk_usage.sh <SERVER-NAME> | |
function check_disk_usage(){ | |
local TOTAL=`snmpget -On -c public -v 1 "${1}" UCD-SNMP-MIB::dskTotal.1 | awk '{print $4}'` | |
local AVAIL=`snmpget -On -c public -v 1 "${1}" UCD-SNMP-MIB::dskAvail.1 | awk '{print $4}'` | |
local USED=`snmpget -On -c public -v 1 "${1}" UCD-SNMP-MIB::dskUsed.1 | awk '{print $4}'` | |
local PERCENT=`snmpget -On -c public -v 1 "${1}" UCD-SNMP-MIB::dskPercent.1 | awk '{print $4}'` | |
echo HDD of ${1} is ${PERCENT}% used - Total:${TOTAL}, Avail:${AVAIL}, Used:${USED} | |
} | |
check_disk_usage $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment