Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Mar 13, 2008 12:48 am 
Offline
Senior Member

Joined: Sun Nov 14, 2004 6:37 pm
Posts: 138
Website: http://oldos.org
WLM: jasonlfaulkner@hotmail.com
Yahoo Messenger: jasonfncsu
AOL: jaylfaulkner
Location: NC, USA
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

_________________
Jay Faulkner
http://oldos.org


Last edited by Jay on Thu Mar 13, 2008 11:27 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Thu Mar 13, 2008 2:47 pm 
Offline
Senior Member

Joined: Thu Nov 25, 2004 10:05 am
Posts: 52
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?


Top
   
 Post subject:
PostPosted: Thu Mar 13, 2008 11:27 pm 
Offline
Senior Member

Joined: Sun Nov 14, 2004 6:37 pm
Posts: 138
Website: http://oldos.org
WLM: jasonlfaulkner@hotmail.com
Yahoo Messenger: jasonfncsu
AOL: jaylfaulkner
Location: NC, USA
That's awfully clever of you, and awfully stupid of me.

_________________
Jay Faulkner

http://oldos.org


Top
   
 Post subject:
PostPosted: Thu Mar 13, 2008 11:29 pm 
Offline
Senior Member

Joined: Sun Nov 14, 2004 6:37 pm
Posts: 138
Website: http://oldos.org
WLM: jasonlfaulkner@hotmail.com
Yahoo Messenger: jasonfncsu
AOL: jaylfaulkner
Location: NC, USA
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.

_________________
Jay Faulkner

http://oldos.org


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group