mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-07 14:43:13 +00:00
Category Tree: Reduce number of categories
netapp -> san
This commit is contained in:
parent
7042351e74
commit
f523f095f9
18 changed files with 14 additions and 14 deletions
60
plugins/mailman/mailman-queue-check
Executable file
60
plugins/mailman/mailman-queue-check
Executable file
|
@ -0,0 +1,60 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Plugin to monitor mailman queue
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# config (required)
|
||||
#
|
||||
# Author: Ricardo F. <rikr@esdebian.org>
|
||||
#
|
||||
#
|
||||
#%# family=manual
|
||||
#%# capabilities=
|
||||
#
|
||||
|
||||
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo "graph_title Mailman Queue"
|
||||
echo "graph_category mailinglist"
|
||||
echo "graph_args --base 1000 -l 0"
|
||||
echo "archive.label Archive"
|
||||
echo "archive.draw LINE2"
|
||||
echo "bounces.label Bounces"
|
||||
echo "bounces.draw LINE2"
|
||||
echo "commands.label Commands"
|
||||
echo "commands.draw LINE2"
|
||||
echo "in.label In"
|
||||
echo "in.draw LINE2"
|
||||
echo "news.label News"
|
||||
echo "news.draw LINE2"
|
||||
echo "out.label Out"
|
||||
echo "out.draw LINE2"
|
||||
echo "retry.label Retry"
|
||||
echo "retry.draw LINE2"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
dir_mailman='/var/lib/mailman/qfiles'
|
||||
result="archive bounces commands in news out retry"
|
||||
j=0
|
||||
|
||||
for i in $result
|
||||
do
|
||||
array[$j]=`find "$dir_mailman/$i" -type f | wc -l`
|
||||
j=`expr $j + 1`
|
||||
done
|
||||
|
||||
|
||||
echo "archive.value ${array[0]}"
|
||||
echo "bounces.value ${array[1]}"
|
||||
echo "commands.value ${array[2]}"
|
||||
echo "in.value ${array[3]}"
|
||||
echo "news.value ${array[4]}"
|
||||
echo "out.value ${array[5]}"
|
||||
echo "retry.value ${array[6]}"
|
||||
exit 0
|
||||
|
||||
|
97
plugins/mailman/mailman_subscribers
Executable file
97
plugins/mailman/mailman_subscribers
Executable file
|
@ -0,0 +1,97 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright (C) 2006-2007 Rodolphe Quiedeville <rodolphe@quiedeville.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 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.0 2007/01/17 15:57:19 rodo
|
||||
# Add total and correct family
|
||||
#
|
||||
# Revision 1.0 2006/04/30 22:44:19 rodo
|
||||
# Created by Rodolphe Quiedeville
|
||||
#
|
||||
# Need to be run as root, add the following lines ...
|
||||
#
|
||||
# [mailman_subscribers]
|
||||
# user root
|
||||
#
|
||||
# to /etc/munin/plugin-conf.d/munin-node
|
||||
#
|
||||
# Magic markers (optinal - used by munin-config and some installation
|
||||
# scripts):
|
||||
#
|
||||
#%# family=manual
|
||||
#%# capabilities=autoconf
|
||||
|
||||
use strict;
|
||||
my ($list,$desc,%lists,$label);
|
||||
|
||||
my $list_lists = "/usr/sbin/list_lists";
|
||||
(-x $list_lists) || die "Can't exec $list_lists\n";
|
||||
|
||||
my $list_members = "/usr/sbin/list_members";
|
||||
(-x $list_members) || die "Can't exec $list_members\n";
|
||||
|
||||
open(LL, "$list_lists|") or exit 4;
|
||||
while (<LL>)
|
||||
{
|
||||
($list, $desc) = (/^\s+(.*?)\s-\s(.*)$/);
|
||||
$lists{$list} = $desc if ($list);
|
||||
}
|
||||
close(LL);
|
||||
|
||||
if ($ARGV[0] and $ARGV[0] eq "config" ){
|
||||
print "graph_title Mailman subscribers\n";
|
||||
print "graph_args --base 1000 -l 0\n";
|
||||
print "graph_scale yes\n";
|
||||
print "graph_vlabel subscribers\n";
|
||||
print "graph_category mailinglist\n";
|
||||
print "graph_total Total\n";
|
||||
print 'graph_info Plugin available at <a href="http://rodolphe.quiedeville.org/hack/munin/mailman/">http://rodolphe.quiedeville.org/hack/munin/mailman/</a>'."\n";
|
||||
|
||||
my $num =0;
|
||||
while (($list,$desc) = each(%lists)) {
|
||||
$label=$list;
|
||||
$list=clean_name($list);
|
||||
print("$list.label $label\n");
|
||||
print("$list.info $desc\n");
|
||||
($num > 0) ? print("$list.draw STACK\n") : print("$list.draw AREA\n");
|
||||
$num++;
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
while (($list,$desc) = each(%lists)) {
|
||||
my $num = 0;
|
||||
open(LM, "$list_members $list|") or exit 4;
|
||||
while (<LM>)
|
||||
{
|
||||
$num++;
|
||||
}
|
||||
close(LL);
|
||||
|
||||
$list=clean_name($list);
|
||||
print("$list.value $num\n");
|
||||
}
|
||||
|
||||
sub clean_name
|
||||
{
|
||||
# http://munin-monitoring.org/wiki/notes_on_datasource_names
|
||||
my $list = shift(@_);
|
||||
$list=~s/^[^A-Za-z_]/_/;
|
||||
$list=~s/[^A-Za-z0-9_]/_/g;
|
||||
return $list;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue