English (short Version) below
Um die Anzahl meiner Kunden und deren Domains im Auge zu behalten verwende ich gerne die grafischen Möglichkeiten von Munin.
Wie man anhand "meiner" beiden Plugin hier im Forum sehen kann ist es auch nicht schwer eigene interessante Scripte zu schreiben.
sample picture:
Ich gehe dabei von einem fertig konfigurierten ispCP und Munin(-Node) aus. Mein verwendetes System ist ein Debian Etch.
1. Folgenden Code in /usr/share/munin/plugins/ispcp_vsites speichern.
Code:
#!/bin/sh
#
# Autor : Knut Herter
# Datum : 28.3.2008
# Mail : herter@systemtechnics.de
# Web : www.systemtechnics.de
#
# Dies Plugin zeigt die Anzahl der Kundensites in IspCP/vhcs2 an.
#
# 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 Virtual Sites on Server'
echo 'graph_args --upper-limit 100 -l 0'
echo 'graph_vlabel Sites on Server'
echo 'graph_category Disk'
echo 'kunden.label Kunden'
echo 'sites.label Domains'
exit 0
fi
site=`ls /var/www/virtual |wc -l`
echo "kunden.value $site"
sites=`ls /var/mail/virtual |wc -l`
echo "sites.value $sites"
2. Ausführbar machen
Code:
chmod +x /usr/share/munin/plugins/ispcp_vsites
3. Logischen Link setzen.
Code:
cd /etc/munin/plugins
ln -s /usr/share/munin/plugins/ispcp_vsites
4. Die Konfiguration des Nodes editieren.
Code:
pico /etc/munin/plugin-conf.d/munin-node
Folgendes einfügen:
Code:
[ispcp_vsites]
user root
5. Munin-Node über das neue Plugin informieren. (Meine Erfahrung hat gezeigt, dass es nicht ausreicht das/die Node neu zu starten.
Code:
dpkg-reconfigure munin-node
Fertig.
Du findest die Grafiken bei Munin im Abschnitt DISK
Download Link für das Script :
http://addons.isp-control.net/unofficial...net.tar.gz
---- ENGLISH VERSION ---
Hi,
i like using munin to monitor my server. munin should show me the amount of websites and domains.
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_vsites
Code:
#!/bin/sh
#
# Autor : Knut Herter
# Datum : 28.3.2008
# Mail : herter@systemtechnics.de
# Web : www.systemtechnics.de
#
# Dies Plugin zeigt die Anzahl der Kundensites in IspCP/vhcs2 an.
#
# 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 Virtual Sites on Server'
echo 'graph_args --upper-limit 100 -l 0'
echo 'graph_vlabel Sites on Server'
echo 'graph_category Disk'
echo 'customer.label Customer'
echo 'sites.label Domains'
exit 0
fi
site=`ls /var/www/virtual |wc -l`
echo "customer.value $site"
sites=`ls /var/mail/virtual |wc -l`
echo "sites.value $sites"
2. make it executable.
Code:
chmod +x /usr/share/munin/plugins/ispcp_vsites
3. Create the logic link
Code:
cd /etc/munin/plugins
ln -s /usr/share/munin/plugins/ispcp_vsites
4. Edit the nodes config file.
Code:
pico /etc/munin/plugin-conf.d/munin-node
Insert this:
Code:
[ispcp_vsites]
user root
5. 5. Reinitialise munin-node
Code:
dpkg-reconfigure munin-node
Done.
Download Link for the script :
http://addons.isp-control.net/unofficial...net.tar.gz
You will find the graphic below the DISK stats