File: 103-ejabberd-cli.patch

package info (click to toggle)
munin 1.4.5-3+deb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 4,988 kB
  • ctags: 806
  • sloc: perl: 8,936; sh: 3,105; java: 1,754; makefile: 585; python: 143
file content (64 lines) | stat: -rw-r--r-- 2,609 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Description: Ejabberd in squeeze (version 2.1.5) uses a new CLI
 This patch changes the plugin to use the new CLI.
 In addition it fixes a small bug in the vlabel for "uptime in days"
Origin: http://bugs.debian.org/597599
Bug-Debian: http://bugs.debian.org/597599
Forwarded: No. As this patch makes the plugin work with Ejabberd 2.1.5, but
 breaks earlier versions.
Author: Gerald Turner <gturner@unzane.com>
Last-Update: 2010-09-23
Index: munin-1.4.5/plugins/node.d/ejabberd_.in
===================================================================
--- munin-1.4.5.orig/plugins/node.d/ejabberd_.in	(revision 3901)
+++ munin-1.4.5/plugins/node.d/ejabberd_.in	(working copy)
@@ -220,7 +220,7 @@
 	done;
     elif [ "$MODE" = "uptime" ]; then
 	echo 'graph_title Uptime of ejabberd server'
-	echo 'uptime in days'
+	echo 'graph_vlabel uptime in days'
 	echo "uptime.label uptime"
 	echo 'uptime.draw AREA'
     fi
@@ -237,7 +237,7 @@
 if [ "$MODE" = "users" ]; then
     for host in $vhosts; do
 	formathost=$(echo $host | tr '.' '_')
-	echo "connected_users_$formathost.value $($EJCTL vhost $host stats onlineusers)"; 
+	echo "connected_users_$formathost.value $($EJCTL stats-host onlineusers $host)"; 
 	echo "connected_unique_users_$formathost.value $($EJCTL connected-users | awk -v var=$host -F/ '{users[$1]} END {for (user in users) {if (index(user,var)) {count++}} print count}')"; 
     done
     exit 0
@@ -246,7 +246,7 @@
 if [ "$MODE" = "registrations" ]; then
     for host in $vhosts; do
 	formathost=$(echo $host | tr '.' '_')
-	num=$($EJCTL vhost $host stats registeredusers)
+	num=$($EJCTL stats-host registeredusers $host)
         if [ "$?" != 0 ]; then
             num="U"
         fi
@@ -259,7 +259,7 @@
    for host in $vhosts; do
 	formathost=$(echo $host | tr '.' '_')
 		for status in $statuses; do
-			num=$($EJCTL vhost $host status-num $status)
+			num=$($EJCTL status-num-host $status $host)
 			if [ "$?" != 0 ]; then
 				num="U"
 			fi
@@ -284,12 +284,12 @@
         for host in $vhosts; do
                 for num in $days; do
                         formathost=$(echo $host | tr '.' '_')
-                        echo "usersindays_${formathost}_${num}.value $($EJCTL vhost $host num-active-users $num)";
+                        echo "usersindays_${formathost}_${num}.value $($EJCTL num-active-users $host $num)";
                 done;
         done;
 	exit 0
 fi
 
 if [ "$MODE" = "uptime" ]; then
-	echo "uptime.value $($EJCTL stats uptime-seconds | awk '{printf "%.2f", $1/86400}')"
+	echo "uptime.value $($EJCTL stats uptimeseconds | awk '{printf "%.2f", $1/86400}')"
 fi