From c6e8f02928bc26eaf6fbe6a9d117ac5ee8fb954e Mon Sep 17 00:00:00 2001 From: Deathjam Date: Fri, 6 Sep 2013 22:33:30 +0100 Subject: [PATCH 1/3] added tinychat plugin --- plugins/chat/tinychat_users_ | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 plugins/chat/tinychat_users_ diff --git a/plugins/chat/tinychat_users_ b/plugins/chat/tinychat_users_ new file mode 100755 index 00000000..9ace63b2 --- /dev/null +++ b/plugins/chat/tinychat_users_ @@ -0,0 +1,49 @@ +#!/bin/sh +######################### +# tinychat_users_ +######################### +# Munin Plugin to monitor the number of users a tinychat room gets. +# Author Phil Wray ( http://www.infjs.com ) +# +# Usage: +# ln -s /usr/share/munin/plugins/tinychat_users_ /etc/munin/plugins/tinychat_users_your-room +# +# Get the Tinychat Room by parsing this scripts filename. +room=${0##*tinychat_users_} + +## +# autoconf +## +if [ "$1" = "autoconf" ]; then + # Check that curl is installed + if hash curl &>/dev/null; then +echo "yes" + else +echo "no (no curl installed)" + fi +exit 0 +fi + +## +# config +## +if [ "$1" = "config" ]; then +echo "graph_title Tinychat Users for $room" + echo 'graph_vlabel Room Users' + echo 'graph_args --base 1000' + echo 'graph_scale no' + echo 'graph_vlabel Room Users' + echo 'graph_category misc' + echo 'total_count.label Room Users' + echo 'total_count.draw AREA' + exit 0 +fi + +## +# Main +## +# Get current Room Users. +tinychat_users=$(curl -s http://api.tinychat.com/${room}.json | grep -Eo 'total_count":[0-9]+' | cut -d':' -f2) + +# Output Room Users. +echo "total_count.value $tinychat_users" From 74ee8b7b1a99107426a7382faabd9e7961b9030c Mon Sep 17 00:00:00 2001 From: Deathjam Date: Sun, 8 Sep 2013 23:03:14 +0100 Subject: [PATCH 2/3] updated tinychat plugin to also monitor users broadcasting --- plugins/chat/tinychat_users_ | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/chat/tinychat_users_ b/plugins/chat/tinychat_users_ index 9ace63b2..da8b0377 100755 --- a/plugins/chat/tinychat_users_ +++ b/plugins/chat/tinychat_users_ @@ -2,12 +2,15 @@ ######################### # tinychat_users_ ######################### -# Munin Plugin to monitor the number of users a tinychat room gets. +# Munin Plugin to track monitor the number of users a tinychat room gets. # Author Phil Wray ( http://www.infjs.com ) +# +# # # Usage: # ln -s /usr/share/munin/plugins/tinychat_users_ /etc/munin/plugins/tinychat_users_your-room # + # Get the Tinychat Room by parsing this scripts filename. room=${0##*tinychat_users_} @@ -36,6 +39,8 @@ echo "graph_title Tinychat Users for $room" echo 'graph_category misc' echo 'total_count.label Room Users' echo 'total_count.draw AREA' + echo 'broadcaster_count.draw STACK' + echo 'broadcaster_count.label Broadcasting' exit 0 fi @@ -44,6 +49,7 @@ fi ## # Get current Room Users. tinychat_users=$(curl -s http://api.tinychat.com/${room}.json | grep -Eo 'total_count":[0-9]+' | cut -d':' -f2) - +broadcasting_users=$(curl -s http://api.tinychat.com/${room}.json | grep -Eo 'broadcaster_count":[0-9]+' | cut -d':' -f2) # Output Room Users. echo "total_count.value $tinychat_users" +echo "broadcaster_count.value $broadcasting_users" From cdd5c4a88fe5bb5e861660e80d27928a8435734d Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 16 Sep 2013 10:36:47 +0100 Subject: [PATCH 3/3] Update tinychat_users_ changed the graph_category --- plugins/chat/tinychat_users_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat/tinychat_users_ b/plugins/chat/tinychat_users_ index da8b0377..1a487e5a 100755 --- a/plugins/chat/tinychat_users_ +++ b/plugins/chat/tinychat_users_ @@ -36,7 +36,7 @@ echo "graph_title Tinychat Users for $room" echo 'graph_args --base 1000' echo 'graph_scale no' echo 'graph_vlabel Room Users' - echo 'graph_category misc' + echo 'graph_category Chat' echo 'total_count.label Room Users' echo 'total_count.draw AREA' echo 'broadcaster_count.draw STACK'