Skip to content

Instantly share code, notes, and snippets.

@revmischa
Created January 17, 2012 00:27
Show Gist options
  • Save revmischa/1623790 to your computer and use it in GitHub Desktop.
Save revmischa/1623790 to your computer and use it in GitHub Desktop.
Web::Hippie::PubSub munin plugin
GRAPH_TYPE='GAUGE'
if [ "$1" = "config" ]; then
echo 'graph_title Web::Hippie::PubSub subscribers'
echo 'graph_vlabel events'
echo 'graph_category HTTP'
echo 'current_subscribers.label current subscribers'
echo "current_subscribers.type $GRAPH_TYPE"
echo 'total_subscribers.label total subscribers'
echo "total_subscribers.type $GRAPH_TYPE"
echo 'events_published.label events published'
echo "events_published.type $GRAPH_TYPE"
exit 0
fi
echo -n "current_subscribers.value "
GET http://localhost:6000/_hippie/stats | egrep -o 'current_subscribers: ([[:digit:]]+)' | egrep -o '([[:digit:]]+)' || echo 0
echo -n "total_subscribers.value "
GET http://localhost:6000/_hippie/stats | egrep -o 'total_subscribers: ([[:digit:]]+)' | egrep -o '([[:digit:]]+)' || echo 0
echo -n "events_published.value "
GET http://localhost:6000/_hippie/stats | egrep -o 'events_published: ([[:digit:]]+)' | egrep -o '([[:digit:]]+)' || echo 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment