Created
February 16, 2013 00:44
-
-
Save kevin1024/4964855 to your computer and use it in GitHub Desktop.
Munin plugin for resque queue stats
This file contains hidden or 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/sh | |
VALS=$(curl --silent http://127.0.0.1:5678/stats.txt) | |
QUEUES=$(echo "$VALS" | grep "queues") | |
case $1 in | |
config) | |
cat <<'EOM' | |
graph_title Resque Queues | |
graph_vlabel tasks | |
EOM | |
while read -r line; do | |
name=$(echo "$line" | cut -d "=" -f 1 | tr -d " " | sed 's/queues.//g') | |
echo "${name}.label ${name}" | |
done <<< "$QUEUES" | |
exit 0;; | |
esac | |
while read -r line; do | |
name=$(echo "$line" | cut -d "=" -f 1 | tr -d " " | sed 's/queues.//g') | |
value=$(echo "$line" | cut -d "=" -f 2) | |
echo "${name}.value ${value}" | |
done <<< "$QUEUES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment