From 4002e993dd5479b03e01f094d71fa2b8d1ab185c Mon Sep 17 00:00:00 2001 From: Someone Date: Wed, 28 Aug 2013 01:45:04 +0200 Subject: [PATCH] changed irc services stats plugins --- cron/ircservicestats.sh | 30 +++++++++++++++++++ cron/ircstats.pl | 2 ++ ircsvcchans | 45 +++++++++++++++++++++++++++++ ircsvcdb | 6 ++-- cron/servicestats.sh => ircsvcmemos | 26 ++++++++++++----- ircsvc => ircsvcnicks | 5 +--- 6 files changed, 100 insertions(+), 14 deletions(-) create mode 100755 cron/ircservicestats.sh create mode 100755 ircsvcchans rename cron/servicestats.sh => ircsvcmemos (56%) rename ircsvc => ircsvcnicks (83%) diff --git a/cron/ircservicestats.sh b/cron/ircservicestats.sh new file mode 100755 index 0000000..916b47e --- /dev/null +++ b/cron/ircservicestats.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Copyright 2011 by Jan Vales (Someone ) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +mkdir -p /tmp/irc/ +chmod -R 775 /tmp/irc/ &> /dev/null + +echo "dbsize.value $(du -b data/anope.db | awk '{print $1}')" > /tmp/irc/servicestats.txt +echo "dblines.value $(cat data/anope.db | wc -l)" >> /tmp/irc/servicestats.txt +echo "channelinfo.value $(egrep '^OBJECT ChannelInfo' data/anope.db | wc -l)" >> /tmp/irc/servicestats.txt +echo "nickcore.value $(egrep '^OBJECT NickCore' data/anope.db | wc -l)" >> /tmp/irc/servicestats.txt +echo "nickalias.value $(egrep '^OBJECT NickAlias' data/anope.db | wc -l)" >> /tmp/irc/servicestats.txt +echo "memo.value $(egrep '^OBJECT Memo' data/anope.db | wc -l)" >> /tmp/irc/servicestats.txt +echo "chanaccess.value $(egrep '^OBJECT ChanAccess' data/anope.db | wc -l)" >> /tmp/irc/servicestats.txt +echo "modelock.value $(egrep '^OBJECT ModeLock' data/anope.db | wc -l)" >> /tmp/irc/servicestats.txt +chmod 664 /tmp/irc/servicestats.txt &> /dev/null + diff --git a/cron/ircstats.pl b/cron/ircstats.pl index c91a6ee..c4cb527 100755 --- a/cron/ircstats.pl +++ b/cron/ircstats.pl @@ -15,6 +15,8 @@ # along with this program. If not, see . # +# consider using pybots IRCStats module instead! + require Net::IRC; mkdir("/tmp/irc", 0775); diff --git a/ircsvcchans b/ircsvcchans new file mode 100755 index 0000000..0ac134f --- /dev/null +++ b/ircsvcchans @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Copyright 2011 by Jan Vales (Someone ) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + + +if [ "$1" = "autoconf" ]; then + echo "yes" + exit 0 +fi + +if [ "$1" = "config" ]; then + echo "graph_title service registrations" + echo "graph_info This graph shows the IRC service's channel registration stats." + echo "graph_category irc" + echo "graph_order channels nickaliases nickcores" + echo "graph_printf %.0lf" + echo "graph_scale no" + echo "graph_args -l 0" + echo "channelinfo.label Registered channels" + echo "channelinfo.draw LINE2" + echo "chanaccess.label Accesslist entries" + echo "chanaccess.draw LINE2" + echo "modelock.label ModeLocks" + echo "modelock.draw LINE2" + exit 0 +fi + +grep -i "channelinfo.value" /tmp/irc/servicestats.txt +grep -i "chanaccess.value" /tmp/irc/servicestats.txt +grep -i "modelock.value" /tmp/irc/servicestats.txt + +exit 0 diff --git a/ircsvcdb b/ircsvcdb index 445f5c2..482645a 100755 --- a/ircsvcdb +++ b/ircsvcdb @@ -30,13 +30,13 @@ if [ "$1" = "config" ]; then echo "graph_args --logarithmic -l 0.1" echo "dbsize.label DB size" echo "dbsize.draw LINE2" - echo "memos.label Stored memos" - echo "memos.draw LINE2" + echo "dblines.label DB lines" + echo "dblines.draw LINE2" exit 0 fi grep -i "dbsize.value" /tmp/irc/servicestats.txt -grep -i "memos.value" /tmp/irc/servicestats.txt +grep -i "dblines.value" /tmp/irc/servicestats.txt exit 0 diff --git a/cron/servicestats.sh b/ircsvcmemos similarity index 56% rename from cron/servicestats.sh rename to ircsvcmemos index cff3d40..b865e80 100755 --- a/cron/servicestats.sh +++ b/ircsvcmemos @@ -16,12 +16,24 @@ # -mkdir -p /tmp/irc/ -chmod 775 /tmp/irc/ +if [ "$1" = "autoconf" ]; then + echo "yes" + exit 0 +fi -echo "dbsize.value `du -b data/anope.flat.db | awk '{print $1}'`" > /tmp/irc/servicestats.txt -echo "channels.value `egrep '^OBJECT ChannelInfo' data/anope.flat.db | wc -l`" >> /tmp/irc/servicestats.txt -echo "nickaliases.value `egrep '^OBJECT NickAlias' data/anope.flat.db | wc -l`" >> /tmp/irc/servicestats.txt -echo "nickcores.value `egrep '^OBJECT NickCore' data/anope.flat.db | wc -l`" >> /tmp/irc/servicestats.txt -echo "memos.value `egrep '^OBJECT Memo' data/anope.flat.db | wc -l`" >> /tmp/irc/servicestats.txt +if [ "$1" = "config" ]; then + echo "graph_title service's database" + echo "graph_info This graph shows the IRC service's stored memo count." + echo "graph_category irc" + echo "graph_order dbsize" + echo "graph_scale yes" + echo "graph_args --logarithmic -l 0.1" + echo "memos.label Stored memos" + echo "memos.draw LINE2" + exit 0 +fi + +grep -i "memos.value" /tmp/irc/servicestats.txt + +exit 0 diff --git a/ircsvc b/ircsvcnicks similarity index 83% rename from ircsvc rename to ircsvcnicks index f6f294f..8dcb56b 100755 --- a/ircsvc +++ b/ircsvcnicks @@ -23,14 +23,12 @@ fi if [ "$1" = "config" ]; then echo "graph_title service registrations" - echo "graph_info This graph shows the IRC service's registration counts. Including the count of registered channels and nicknames." + echo "graph_info This graph shows the IRC service's nick registration stats." echo "graph_category irc" echo "graph_order channels nickaliases nickcores" echo "graph_printf %.0lf" echo "graph_scale no" echo "graph_args -l 0" - echo "channels.label Registered channels" - echo "channels.draw LINE2" echo "nickaliases.label Registered nicks + aliases" echo "nickaliases.draw LINE2" echo "nickcores.label Registered nicks" @@ -38,7 +36,6 @@ if [ "$1" = "config" ]; then exit 0 fi -grep -i "channels.value" /tmp/irc/servicestats.txt grep -i "nickaliases.value" /tmp/irc/servicestats.txt grep -i "nickcores.value" /tmp/irc/servicestats.txt -- 2.43.0