mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 10:28:36 +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
|
@ -1,60 +0,0 @@
|
|||
#!/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
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#!/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;
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Plugin to monitor incoming Postgrey
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# config (required)
|
||||
# autoconf (optional)
|
||||
#
|
||||
|
||||
|
||||
mktempfile () {
|
||||
mktemp -t
|
||||
}
|
||||
|
||||
MAIL_LOG=${logfile:-/var/log/mail.log}
|
||||
STATEFILE=/var/lib/munin/plugin-state/postgrey.offset
|
||||
LOGTAIL=${logtail:-`which logtail`}
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_title Postgrey daily filtering'
|
||||
echo 'graph_order delayed passed whitelisted'
|
||||
echo 'graph_category mail'
|
||||
echo 'graph_vlabel Count'
|
||||
echo 'graph_scale no'
|
||||
|
||||
## echo 'graph_args --base 1000 -l 0'
|
||||
echo 'delayed.label delayed'
|
||||
# echo 'delayed.type DERIVE'
|
||||
echo 'passed.label passed'
|
||||
# echo 'passed.type DERIVE'
|
||||
echo 'whitelisted.label whitelisted'
|
||||
# echo 'whitelisted.type DERIVE'
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
delayed=0
|
||||
passed=0
|
||||
whitelisted=0
|
||||
|
||||
ARGS=0
|
||||
`$LOGTAIL /etc/hosts 2>/dev/null >/dev/null`
|
||||
if [ $? = 66 ]; then
|
||||
if [ ! -n "$logtail" ]; then
|
||||
ARGS=1
|
||||
fi
|
||||
fi
|
||||
|
||||
TEMP_FILE=`mktempfile munin-postgrey.XXXXXX`
|
||||
|
||||
if [ -n "$TEMP_FILE" -a -f "$TEMP_FILE" ]
|
||||
then
|
||||
if [ $ARGS != 0 ]; then
|
||||
$LOGTAIL ${MAIL_LOG} $STATEFILE | grep 'post[fix|grey]' > ${TEMP_FILE}
|
||||
else
|
||||
$LOGTAIL ${MAIL_LOG} $STATEFILE | grep 'post[fix|grey]' > ${TEMP_FILE}
|
||||
fi
|
||||
|
||||
delayed=`grep 'Recipient address rejected.*Greylisted' ${TEMP_FILE} | wc -l`
|
||||
passed=`grep 'postgrey\[[0-9]*\]: delayed [0-9]* seconds:' ${TEMP_FILE} | wc -l`
|
||||
whitelisted=`grep 'postgrey\[[0-9]*\]: whitelisted:' ${TEMP_FILE} | wc -l`
|
||||
|
||||
/bin/rm -f $TEMP_FILE
|
||||
fi
|
||||
|
||||
echo "delayed.value ${delayed}"
|
||||
echo "passed.value ${passed}"
|
||||
echo "whitelisted.value ${whitelisted}"
|
||||
|
|
@ -1,160 +0,0 @@
|
|||
#! /usr/bin/perl
|
||||
###################################################################
|
||||
# Munins Plugin to monitor actions of postgrey greylisting daemon #
|
||||
# Version 0.1 #
|
||||
###################################################################
|
||||
|
||||
######################### Configuration ###########################
|
||||
# Usually this plugin will look in /var/log/mail.log for the #
|
||||
# output of postgrey. You can change that by setting env.logfile #
|
||||
# The state file is /var/lib/munin/plugin-state/postgrey-new.state#
|
||||
# This can be changed by setting env.statefile #
|
||||
# Keep in mind to grant enough rigths in order to open the #
|
||||
# logfiles etc. #
|
||||
# Parameters understood by this plugin #
|
||||
# #
|
||||
# config (required) #
|
||||
# autoconf (optional) #
|
||||
# #
|
||||
###################################################################
|
||||
# This plgin works with postgrey 1.31 but should also do with 1.32#
|
||||
# Tested under Debian lenny #
|
||||
###################################################################
|
||||
|
||||
|
||||
### Author Rico Sagner hellriegel@sund-xplosion.de
|
||||
### Please send bug reports to this address
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $maillog= $ENV{'logfile'} || "/var/log/mail.log";
|
||||
my $statefile= $ENV{'statefile'} || "/var/lib/munin/plugin-state/postgrey-new.state";
|
||||
|
||||
my $greylisted=0;
|
||||
my $greylisted_old=0;
|
||||
my $passes=0;
|
||||
my $passes_old=0;
|
||||
my $passes_white=0;
|
||||
my $passes_white_old=0;
|
||||
my $retry=0;
|
||||
my $retry_old=0;
|
||||
my $grey_new=0;
|
||||
my $pass_new=0;
|
||||
my $retry_new=0;
|
||||
my $passes_white_new=0;
|
||||
|
||||
if(defined $ARGV[0] and $ARGV[0] eq "autoconf") {
|
||||
if ( -f $maillog) {
|
||||
print "yes\n";
|
||||
exit 0;
|
||||
}
|
||||
else {
|
||||
print "no\n";
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(defined $ARGV[0] and $ARGV[0] eq "config") {
|
||||
print "graph_title Postgrey Actions\n";
|
||||
print "graph_order greylisted retry_early passed passed_w\n";
|
||||
print "graph_category mail\n";
|
||||
print "graph_vlabel Count\n";
|
||||
print "graph_scale no\n";
|
||||
|
||||
print "greylisted.label greylisted_reason_new\n";
|
||||
print "greylisted.type GAUGE\n";
|
||||
print "greylisted.draw AREA\n";
|
||||
print "greylisted.min 0\n";
|
||||
print "retry_early.label greylisted_retry_early\n";
|
||||
print "retry_early.type GAUGE\n";
|
||||
print "retry_early.draw AREA\n";
|
||||
print "retry_early.min 0\n";
|
||||
print "passed.label passed_found\n";
|
||||
print "passed.type GAUGE\n";
|
||||
print "passed.draw AREA\n";
|
||||
print "passed.min 0\n";
|
||||
print "passed_w.label passed_whitelisted\n";
|
||||
print "passed_w.type GAUGE\n";
|
||||
print "passed_w.draw AREA\n";
|
||||
print "passed_w.min 0\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if( -f $statefile) {
|
||||
open ( STATE ,"<$statefile");
|
||||
defined($greylisted_old=<STATE>) or $greylisted_old=0;
|
||||
defined($passes_old=<STATE>) or $passes_old=0;
|
||||
defined($retry_old=<STATE>) or $retry_old=0;
|
||||
defined($passes_white_old=<STATE>) or $passes_white_old=0;
|
||||
chomp($greylisted_old);
|
||||
chomp($passes_old);
|
||||
chomp($retry_old);
|
||||
chomp($passes_white_old);
|
||||
close STATE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
open (LOG ,"<$maillog") or die "Cannot open Maillog";
|
||||
while(my $line = <LOG>)
|
||||
{
|
||||
if($line=~m/postgrey\[/)
|
||||
{
|
||||
if($line=~m/action=greylist/) {
|
||||
if($line=~m/reason=new/)
|
||||
{
|
||||
$greylisted++;
|
||||
}
|
||||
elsif($line=~m/reason=early-retry/)
|
||||
{
|
||||
$retry++;
|
||||
}
|
||||
}
|
||||
elsif($line=~m/action=pass/) {
|
||||
if($line=~m/reason=triplet/)
|
||||
{
|
||||
$passes++;
|
||||
}
|
||||
elsif($line=~m/reason=client/)
|
||||
{
|
||||
$passes_white++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
close(LOG);
|
||||
|
||||
|
||||
open (STATE2,">$statefile");
|
||||
print STATE2 "$greylisted\n";
|
||||
print STATE2 "$passes\n";
|
||||
print STATE2 "$retry\n";
|
||||
print STATE2 "$passes_white\n";
|
||||
close STATE2;
|
||||
|
||||
if($greylisted_old>$greylisted) { $grey_new=$greylisted; }
|
||||
elsif($greylisted_old eq $greylisted) { $grey_new=0;}
|
||||
else { $grey_new=$greylisted-$greylisted_old; }
|
||||
|
||||
if($passes_old>$passes) { $pass_new=$passes;}
|
||||
elsif( $passes_old eq $passes) { $pass_new=0; }
|
||||
else { $pass_new=$passes-$passes_old; }
|
||||
|
||||
if($retry_old>$retry) { $retry_new=$retry;}
|
||||
elsif($retry_old eq $retry) { $retry_new=0;}
|
||||
else { $retry_new=$retry-$retry_old; }
|
||||
|
||||
if($passes_white_old>$passes_white) { $passes_white_new=$passes_white;}
|
||||
elsif($passes_white_old eq $passes_white) { $passes_white_new=0;}
|
||||
else { $passes_white_new=$passes_white-$passes_white_old; }
|
||||
|
||||
print "greylisted.value $grey_new\n";
|
||||
print "retry_early.value $retry_new\n";
|
||||
print "passed.value $pass_new\n";
|
||||
print "passed_w.value $passes_white_new\n";
|
||||
|
||||
exit 0;
|
Loading…
Add table
Add a link
Reference in a new issue