Created
December 15, 2011 06:43
-
-
Save pshima/1480096 to your computer and use it in GitHub Desktop.
check_raindrops
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
# from https://github.com/petey5king/raindrops-nagios | |
#!/usr/bin/env ruby | |
#script to check the unicorn backlog | |
#requires the nagios gem, raindrops and rubygems | |
$LOAD_PATH.unshift '../lib' | |
require 'rubygems' | |
require 'raindrops' | |
require 'nagios' | |
class CheckRaindrops < Nagios::Plugin | |
def warning (x) | |
x > threshold(:warning) | |
end | |
def critical (x) | |
x > threshold(:critical) | |
end | |
def measure | |
addr = [ "/tmp/unicorn.sock" ] | |
@stats = Raindrops::Linux.unix_listener_stats(addr) | |
@stats[0].queued | |
end | |
def to_s(value) | |
"QUEUE #{status}: #{@stats[0].queued}" | |
end | |
end | |
CheckRaindrops.run! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment