| Author |
Message |
Jay
Joined: 14 Nov 2004
Posts: 122
Location: NC, USA
|
| Posted: Wed Mar 12, 2008 11:48 pm Post subject: IO Token checking nagios plugin |
|
|
I'm just all about writing stuff tonight.
This plugin can be used to monitor available IO tokens. It's pretty self-explanatory.
Edit: Fixed the bug listed in the reply
Code:
#!/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
|
|
| Back to top |
|
TehDan
Joined: 25 Nov 2004
Posts: 40
|
| Posted: Thu Mar 13, 2008 1:47 pm Post subject: |
|
|
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? |
|
| Back to top |
|
Jay
Joined: 14 Nov 2004
Posts: 122
Location: NC, USA
|
| Posted: Thu Mar 13, 2008 10:27 pm Post subject: |
|
|
| That's awfully clever of you, and awfully stupid of me. |
|
| Back to top |
|
Jay
Joined: 14 Nov 2004
Posts: 122
Location: NC, USA
|
| Posted: Thu Mar 13, 2008 10:29 pm Post subject: |
|
|
TehDan wrote: 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. |
|
| Back to top |
|
| |