Current time: 11-16-2024, 07:27 PM Hello There, Guest! (LoginRegister)


Post Reply 
[MUNIN Plugin] Kunden und Websites auf dem Server
Author Message
Knut Offline
Member
***

Posts: 736
Joined: Nov 2006
Reputation: 10
Post: #1
[MUNIN Plugin] Kunden und Websites auf dem Server
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:
[Image: 02.0172lql6za0ul1lrx.png]

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
(This post was last modified: 05-20-2009 01:58 AM by Knut.)
01-02-2009 04:28 PM
Find all posts by this user Quote this message in a reply
mr.x Offline
Development Team
*****
Dev Team

Posts: 232
Joined: Nov 2006
Reputation: 3
Post: #2
RE: [MUNIN Plugin] Kunden und Websites auf dem Server
Hi Knut,

Danke
Habe es eben mal ausprobiert. Geht super !

Jan
01-03-2009 05:52 AM
Find all posts by this user Quote this message in a reply
DaSilva Offline
Member
***

Posts: 302
Joined: Dec 2007
Reputation: 0
Post: #3
RE: [MUNIN Plugin] Kunden und Websites auf dem Server
Thanks for the handy plugins!
Can you make them dynamic like other plugins?
So that the graph always fits to the highest number?
Thanks.

And how can I add graphs for a month/year? Currently I can only see daily and weekly graphs...
(This post was last modified: 02-16-2009 04:13 AM by DaSilva.)
02-16-2009 04:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Knut Offline
Member
***

Posts: 736
Joined: Nov 2006
Reputation: 10
Post: #4
RE: [MUNIN Plugin] Kunden und Websites auf dem Server
(02-16-2009 04:13 AM)DaSilva Wrote:  Can you make them dynamic like other plugins?
So that the graph always fits to the highest number?
Thanks.

Remove this line
Code:
echo 'graph_args --upper-limit 100 -l 0'
then
Code:
dpkg-reconfigure munin-node
wait a few minutes ...

(02-16-2009 04:13 AM)DaSilva Wrote:  And how can I add graphs for a month/year? Currently I can only see daily and weekly graphs...

Hmm... klick at the images ?

EDIT: I think for monthly images wait a week, for yearly images wait a month.

Knut
(This post was last modified: 02-16-2009 04:41 AM by Knut.)
02-16-2009 04:37 AM
Find all posts by this user Quote this message in a reply
DaSilva Offline
Member
***

Posts: 302
Joined: Dec 2007
Reputation: 0
Post: #5
RE: [MUNIN Plugin] Kunden und Websites auf dem Server
Thanks Smile
02-16-2009 06:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)