IO Token checking nagios plugin
This plugin can be used to monitor available IO tokens. It's pretty self-explanatory.
Edit: Fixed the bug listed in the reply
#!/bin/bash
TOKENS=`cat /proc/io_status | awk '{print $3}' | cut -d'=' -f2`
if [[ $TOKENS -lt 500000 ]]; then
echo "CRITICAL: Only $TOKENS io_tokens available"
exit 2
elif [[ $TOKENS -lt 1000000 ]]; then
echo "WARNING: Only $TOKENS io_tokens available"
exit 1
else
echo "OK: $TOKENS io_tokens available"
exit 0
fi
echo "UNKNOWN: Ack! You shouldn't have gotten here!"
exit 255
3 Replies
Looks to me like you'll never hit the critical condition though - you probably want to do the lt 50000 test before the lt 100000 test?
@TehDan:
Nice idea. Have been meaning to look at nagios for ages, I heard it was easy to write custom plugins!
Looks to me like you'll never hit the critical condition though - you probably want to do the lt 50000 test before the lt 100000 test?
Nagios plugins are SUPER EASY. Catch me on #linode if you ever have any questions, I've written a ton of stuff, and done a lot of nagios work.