little translation
(12-26-2008 05:35 PM)Knut Wrote: Hi,
i like using munin to monitor my server. munin should show me the amount of websites and emailadresses.
if someone else want to use munin to monitor his server here is the plugin.
The system requiers a complete installation of ispCP and Munin(-Node).
This plugin runs on Debian Etch.
1. Save this code over here -> /usr/share/munin/plugins/ispcp_mailuser
Code:
#!/bin/sh
#
# Autor : Knut Herter
# Datum : 26.12.2008
# Mail : herter@systemtechnics.de
# Web : www.systemtechnics.de
#
# Dies Plugin zeigt die Anzahl der angelegten Mailadresen in IspCP/vhcs2 an.
# Es wird dabei nicht zwischen einem Mailkonto oder Weiterleitung unterschieden!
#
# Wer mag kann dieses Plugin gerne lizenzfrei verwenden oder unveraendert weiter geben.
#
# Magic markers (optional - only used by munin-config and some
# installation scripts):
#
#%# family=auto
#%# capabilities=autoconf
# If run with the "autoconf"-parameter, give our opinion on wether we
# should be run on this system or not. This is optinal, and only used by
# munin-config. In the case of this plugin, we should most probably
# always be included.
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Mailaddresses on Server'
echo 'graph_args --upper-limit 1000 -l 0'
echo 'graph_vlabel Mailaddresses on Server'
echo 'graph_category postfix'
echo 'mailbox.label Mailaddresses'
exit 0
fi
# Verzeichnis der Mailkonten
VMAIL=/var/mail/virtual
# Zum testen. 1 = an , 0 = aus
DEBUG=0
#Domainliste
DOMAINLIST=`ls $VMAIL`
#Anzahl der Mailkonten zuruecksetzen
MAILANZ=0
for DOMAIN in $DOMAINLIST
do
T=`ls $VMAIL/$DOMAIN |wc -l`
if [ $DEBUG = "1" ]; then
echo $DOMAIN = $T Mailkonten
fi
MAILANZ=`expr $MAILANZ + $T`
done
echo "mailbox.value $MAILANZ"
2. make it executable.
Code:
chmod +x /usr/share/munin/plugins/ispcp_mailuser
3. Create the login link
Code:
cd /etc/munin/plugins
ln -s /usr/share/munin/plugins/ispcp_mailuser
4. Edit the nodes config file.
Code:
pico /etc/munin/plugin-conf.d/ munin-node
Insert this:
Code:
[ispcp_mailuser]
user vmail
5. Reinitialise munin-non.
Code:
dpkg-reconfigure munin-node
Done
You'll find a graphic below the postfix stats.
PS: if the skale of the stats is to high (1000 Mailacounts) just change the Plugin variable graph_args --upper-limit 1000 -l 0
the translation is not perfect i know, but i think it's possible to understand