From 55ee8373a75180e691880ffb7c5e46f5097a67d6 Mon Sep 17 00:00:00 2001
From: Someone <someone@somenet.org>
Date: Sun, 6 Oct 2013 20:38:12 +0200
Subject: [PATCH] Added graph to display all the db entry types

---
 ircsvcchans    | 18 +++++++++---------
 ircsvcdbetypes | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 ircsvcmemos    |  6 +++---
 ircsvcnicks    | 18 +++++++++---------
 4 files changed, 70 insertions(+), 21 deletions(-)
 create mode 100755 ircsvcdbetypes

diff --git a/ircsvcchans b/ircsvcchans
index 73a995d..f43ab26 100755
--- a/ircsvcchans
+++ b/ircsvcchans
@@ -29,17 +29,17 @@ if [ "$1" = "config" ]; then
     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"
+    echo "etchannelinfo.label Registered channels"
+    echo "etchannelinfo.draw LINE2"
+    echo "etchanaccess.label Accesslist entries"
+    echo "etchanaccess.draw LINE2"
+    echo "etmodelock.label ModeLocks"
+    echo "etmodelock.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
+grep -i "etchannelinfo.value" /tmp/irc/servicestats.txt
+grep -i "etchanaccess.value" /tmp/irc/servicestats.txt
+grep -i "etmodelock.value" /tmp/irc/servicestats.txt
 
 exit 0
diff --git a/ircsvcdbetypes b/ircsvcdbetypes
new file mode 100755
index 0000000..e71578f
--- /dev/null
+++ b/ircsvcdbetypes
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Copyright 2011 by Jan Vales <jan@jvales.net> (Someone <someone@somenet.org>)
+#
+#    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 <http://www.gnu.org/licenses/>.
+#
+
+
+if [ "$1" = "autoconf" ]; then
+        echo "yes"
+        exit 0
+fi
+
+if [ "$1" = "config" ]; then
+    echo "graph_title service database entry types"
+    echo "graph_info This graph shows the IRC service's database entry types."
+    echo "graph_category irc"
+#    echo "graph_order channels nickaliases nickcores"
+    echo "graph_printf %.0lf"
+    echo "graph_scale no"
+    echo "graph_args -l 0"
+
+	egrep -i "^et" /tmp/irc/servicestats.txt | sed -e 's/\.value.*/.draw LINE2/'
+	egrep -i "^et" /tmp/irc/servicestats.txt | sed -e 's/^et\([^\.]*\)\.value.*/et\1.label \1/'
+
+    echo "etchannelinfo.info Registered channels"
+    echo "etchanaccess.info Accesslist entries"
+    echo "etmodelock.info ModeLocks"
+    echo "etmemo.info Stored memos"
+    echo "etforbiddata.info Forbidden Nicks, Channelnames, ..."
+    echo "etnickalias.info Registered nicks + aliases"
+    echo "etnickcore.info Registered nicks"
+    echo "etnsmiscdata.info Misc nick data"
+    exit 0
+fi
+
+egrep -i "^et" /tmp/irc/servicestats.txt
+
+exit 0
diff --git a/ircsvcmemos b/ircsvcmemos
index 2545787..a4d5bc5 100755
--- a/ircsvcmemos
+++ b/ircsvcmemos
@@ -27,12 +27,12 @@ if [ "$1" = "config" ]; then
     echo "graph_category irc"
     echo "graph_printf %.0lf"
     echo "graph_scale no"
-    echo "memo.label Stored memos"
-    echo "memo.draw LINE2"
+    echo "etmemo.label Stored memos"
+    echo "etmemo.draw LINE2"
     exit 0
 fi
 
-grep -i "memo.value" /tmp/irc/servicestats.txt
+grep -i "etmemo.value" /tmp/irc/servicestats.txt
 
 exit 0
 
diff --git a/ircsvcnicks b/ircsvcnicks
index 7fc8422..939cb51 100755
--- a/ircsvcnicks
+++ b/ircsvcnicks
@@ -29,17 +29,17 @@ if [ "$1" = "config" ]; then
     echo "graph_printf %.0lf"
     echo "graph_scale no"
     echo "graph_args -l 0"
-    echo "nickalias.label Registered nicks + aliases"
-    echo "nickalias.draw LINE2"
-    echo "nickcore.label Registered nicks"
-    echo "nickcore.draw LINE2"
-    echo "nsmiscdata.label Misc nick data"
-    echo "nsmiscdata.draw LINE2"
+    echo "etnickalias.label Registered nicks + aliases"
+    echo "etnickalias.draw LINE2"
+    echo "etnickcore.label Registered nicks"
+    echo "etnickcore.draw LINE2"
+    echo "etnsmiscdata.label Misc nick data"
+    echo "etnsmiscdata.draw LINE2"
     exit 0
 fi
 
-grep -i "nickalias.value" /tmp/irc/servicestats.txt
-grep -i "nickcore.value" /tmp/irc/servicestats.txt
-grep -i "nsmiscdata.value" /tmp/irc/servicestats.txt
+grep -i "etnickalias.value" /tmp/irc/servicestats.txt
+grep -i "etnickcore.value" /tmp/irc/servicestats.txt
+grep -i "etnsmiscdata.value" /tmp/irc/servicestats.txt
 
 exit 0
-- 
2.43.0