3 # Copyright 2011 by Jan Vales <jan@jvales.net> (Someone <someone@somenet.org>)
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, version 3 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 IRCNET=${0##*irccomp_}
20 NETIDLIST=$(echo ${IRCNET} | sed -e 's/_/ /g')
22 if [ "$1" = "autoconf" ]; then
27 if [ "$1" = "config" ]; then
28 echo "graph_title An IRC-Net comparison of $NETIDLIST"
29 echo "graph_info This VIRTUAL plugin compares IRC Networks"
30 echo "graph_category irc"
33 echo "graph_printf %.0lf"
35 echo "graph_args -l 0"
37 # GORDER="graph_order"
38 # for net in $NETIDLIST; do
39 # GORDER="${GORDER} ch_${net}=10;srv253:ircdlusers_${net}.channels"
40 # GORDER="${GORDER} clt_${net}=10;srv253:ircdlusers_${net}.clients"
41 # GORDER="${GORDER} srv_${net}=10;srv253:ircdlusers_${net}.servers"
46 for net in $NETIDLIST; do
47 echo "ch_${net}.label ${net}:channels"
48 echo "ch_${net}.draw LINE2"
49 echo "clt_${net}.label ${net}:clients"
50 echo "clt_${net}.draw LINE2"
51 echo "srv_${net}.label ${net}:servers"
52 echo "srv_${net}.draw LINE2"
57 for net in $NETIDLIST; do
58 grep -i "There are" /tmp/irc_${net}/lusers.txt 2>/dev/null | sed -E 's~^There are .*? on ([0-9]+) servers.*$~srv_'${net}'.value \1~'
59 grep -i "Current Global Users" /tmp/irc_${net}/lusers.txt 2>/dev/null | sed -E 's~^Current Global Users: ([0-9]+) .*$~clt_'${net}'.value \1~'
60 grep -i "channels" /tmp/irc_${net}/lusers.txt 2>/dev/null | sed -E 's~^([0-9]+).*$~ch_'${net}'.value \1~'