Skip to content

Instantly share code, notes, and snippets.

@kevin1024
Created February 16, 2013 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevin1024/4964855 to your computer and use it in GitHub Desktop.
Save kevin1024/4964855 to your computer and use it in GitHub Desktop.
Munin plugin for resque queue stats
#!/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