packages: munin-plugins-muninexchange/munin-plugins-muninexchange.spec, mun...

baggins baggins at pld-linux.org
Tue Dec 15 15:30:34 CET 2009


Author: baggins                      Date: Tue Dec 15 14:30:34 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- added heimdal plugins

---- Files affected:
packages/munin-plugins-muninexchange:
   munin-plugins-muninexchange.spec (1.12 -> 1.13) , munin-plugins-muninexchange-heimdal.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/munin-plugins-muninexchange/munin-plugins-muninexchange.spec
diff -u packages/munin-plugins-muninexchange/munin-plugins-muninexchange.spec:1.12 packages/munin-plugins-muninexchange/munin-plugins-muninexchange.spec:1.13
--- packages/munin-plugins-muninexchange/munin-plugins-muninexchange.spec:1.12	Fri Dec  4 00:38:07 2009
+++ packages/munin-plugins-muninexchange/munin-plugins-muninexchange.spec	Tue Dec 15 15:30:29 2009
@@ -20,6 +20,7 @@
 Patch4:		%{name}-openvpn.patch
 Patch5:		%{name}-samba.patch
 Patch6:		%{name}-apache.patch
+Patch7:		%{name}-heimdal.patch
 URL:		http://muninexchange.projects.linpro.no/
 BuildRequires:	dos2unix
 BuildRequires:	perl-devel
@@ -232,6 +233,20 @@
 Ten pakiet zawera wtyczki dla Munina z repozytorium MuninExchange,
 znajdującym się na http://muninexchange.projects.linpro.no/.
 
+%package heimdal
+Summary:	Munin plugins from MuninExchange - heimdal
+Summary(pl.UTF-8):	Wtyczki munina z MuninExchange - heimdal
+Group:		Daemons
+Requires:	munin-node
+
+%description heimdal
+This package contains plugins for Munin from MuninExchange
+repository located at http://muninexchange.projects.linpro.no/.
+
+%description -l pl.UTF-8 heimdal
+Ten pakiet zawera wtyczki dla Munina z repozytorium MuninExchange,
+znajdującym się na http://muninexchange.projects.linpro.no/.
+
 %package icecast
 Summary:	Munin plugins from MuninExchange - icecast
 Summary(pl.UTF-8):	Wtyczki munina z MuninExchange - icecast
@@ -832,6 +847,7 @@
 %patch4 -p1
 %patch5 -p1
 %patch6 -p0
+%patch7 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -839,8 +855,15 @@
 
 for i in * ; do
 	if [ -d $i ]; then
-		echo "%defattr(644,root,root,755)" >$i.list
-		(cd $i ; for f in * ; do echo "%attr(755,root,root) %{_datadir}/munin/plugins/$f" ; done) >>$i.list
+		if [ $i = "other" ]; then
+			echo "%defattr(644,root,root,755)" >other.list
+			echo "%defattr(644,root,root,755)" >heimdal.list
+			(cd $i ; for f in * ; do [[ $f = heimdal* ]] || echo "%attr(755,root,root) %{_datadir}/munin/plugins/$f" ; done) >>other.list
+			(cd $i ; for f in * ; do [[ $f = heimdal* ]] && echo "%attr(755,root,root) %{_datadir}/munin/plugins/$f" ; done) >>heimdal.list
+		else
+			echo "%defattr(644,root,root,755)" >$i.list
+			(cd $i ; for f in * ; do echo "%attr(755,root,root) %{_datadir}/munin/plugins/$f" ; done) >>$i.list
+		fi
 	fi
 done
 
@@ -868,6 +891,7 @@
 %files freeradius -f freeradius.list
 %files games -f games.list
 %files groupwise -f groupwise.list
+%files heimdal -f heimdal.list
 %files icecast -f icecast.list
 %files iperf -f iperf.list
 %files java -f java.list
@@ -917,6 +941,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.13  2009/12/15 14:30:29  baggins
+- added heimdal plugins
+
 Revision 1.12  2009/12/03 23:38:07  baggins
 - updated to 20091204
 

================================================================
Index: packages/munin-plugins-muninexchange/munin-plugins-muninexchange-heimdal.patch
diff -u /dev/null packages/munin-plugins-muninexchange/munin-plugins-muninexchange-heimdal.patch:1.1
--- /dev/null	Tue Dec 15 15:30:35 2009
+++ packages/munin-plugins-muninexchange/munin-plugins-muninexchange-heimdal.patch	Tue Dec 15 15:30:27 2009
@@ -0,0 +1,253 @@
+--- /dev/null	2009-11-24 13:50:34
++++ munin/other/heimdal_kdc_bandwidth	2009-12-15 15:10:43
+@@ -0,0 +1,79 @@
++#!/usr/bin/perl
++#
++# Plugin to monitor the amount of data sent by KDC server.
++# Based on kdc-log-analyze.pl script from heimdal.
++#
++# Contributed by Jan Rękorajski <baggins at pld-linux.org>
++#
++# Example configuration:
++#
++#  [heimdal_kdc_*]
++#	env.logdir /var/log
++#	env.logfile secure
++#
++use strict;
++use Munin::Plugin;
++
++my $LOGDIR  = $ENV{'logdir'}  || '/var/log';
++my $LOGFILE = $ENV{'logfile'} || 'secure';
++
++my $pos = undef;
++my $bw  = 0;
++
++sub parseLogfile {
++    my ($fname, $start) = @_;
++
++    my ($LOGFILE,$rotated) = tail_open($fname,$start);
++
++    my $line;
++
++    while (<$LOGFILE>) {
++	chomp ($_);
++
++	if (/sending ([0-9]+) bytes to IPv[46]:([0-9\.:a-fA-F]+)/) {
++		$bw += $1;
++	}
++    }
++    return tail_close($LOGFILE);
++}
++
++if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
++    print "no\n";
++    exit 0;
++}
++
++if ( $ARGV[0] and $ARGV[0] eq "config" ) {
++    print "graph_title Heimdal KDC bandwidth\n";
++    print "graph_args --base 1024\n";
++    print "graph_vlabel bytes / \${graph_period}\n";
++    print "graph_scale yes\n";
++    print "graph_category Heimdal\n";
++    print "bw.label Bytes sent\n";
++    print "bw.type ABSOLUTE\n";
++    exit 0;
++}
++
++my $logfile = "$LOGDIR/$LOGFILE";
++
++if (! -f $logfile) {
++    print "bw.value U\n";
++    exit 1;
++}
++
++($pos) = restore_state();
++
++if (!defined($pos)) {
++    # No state file present.  Avoid startup spike: Do not read log
++    # file up to now, but remember how large it is now, and next
++    # time read from there.
++
++    $pos = (stat $logfile)[7]; # File size
++} else {
++    $pos = parseLogfile ($logfile, $pos);
++}
++
++print "bw.value $bw\n";
++
++save_state($pos);
++
++# vim:syntax=perl
+--- /dev/null	2009-11-24 13:50:34
++++ munin/other/heimdal_kdc_requests	2009-12-15 15:10:43
+@@ -0,0 +1,168 @@
++#!/usr/bin/perl
++#
++# Plugin to monitor KDC server requests.
++# Based on kdc-log-analyze.pl script from heimdal.
++#
++# Contributed by Jan Rękorajski <baggins at pld-linux.org>
++#
++# Example configuration:
++#
++#  [heimdal_kdc_*]
++#	env.logdir /var/log
++#	env.logfile secure
++#	env.realms REALM1.COM REALM2.COM
++#
++use strict;
++use Munin::Plugin;
++
++my $LOGDIR  = $ENV{'logdir'}  || '/var/log';
++my $LOGFILE = $ENV{'logfile'} || 'secure';
++my @REALMS  = $ENV{'realms'} ? split(' ', $ENV{'realms'}) : ();
++
++my $pos    = undef;
++
++my $as_req = 0;
++my $no_such_princ = 0;
++my $tgs_req = 0;
++my $tgs_xrealm_out = 0;
++my $tgs_xrealm_in = 0;
++my $referrals = 0;
++my $pa_failed = 0;
++my %ip;
++
++$ip{'4'} = $ip{'6'} = 0;
++
++sub islocalrealm {
++	my ($princ) = @_;
++	my $realm;
++
++	foreach $realm (@REALMS) {
++		return 1 if ($princ eq $realm);
++		return 1 if ($princ =~ /[^@]+\@${realm}/);
++	}
++	return 0;
++}
++
++sub parseLogfile {
++    my ($fname, $start) = @_;
++
++    my ($LOGFILE,$rotated) = tail_open($fname,$start);
++
++    my $line;
++
++    while (<$LOGFILE>) {
++	chomp ($_);
++
++	if (/AS-REQ (.*) from IPv([46]):([0-9\.:a-fA-F]+) for (.*)$/) {
++		$as_req++;
++		$ip{$2}++;
++	} elsif (/TGS-REQ (.+) from IPv([46]):([0-9\.:a-fA-F]+) for (.*?)( \[.*\]){0,1}$/) {
++		$tgs_req++;
++		$ip{$2}++;
++
++		my $source = $1;
++		my $dest = $4;
++
++		if (!islocalrealm($source)) {
++			$tgs_xrealm_in++;
++		}
++		if ($dest =~ /krbtgt\/([^@]+)@[^@]+/) {
++			if (!islocalrealm($1)) {
++				$tgs_xrealm_out++;
++			}
++		}
++	} elsif (/: No such entry in the database/) {
++		$no_such_princ++;
++	} elsif (/Lookup .* succeeded$/) {
++		# Nothing
++	} elsif (/returning a referral to realm (.*) for server (.*) that was not found/) {
++		$referrals++;
++	} elsif (/Failed to decrypt PA-DATA -- (.+)$/) {
++		$pa_failed++;
++	}
++    }
++    return tail_close($LOGFILE);
++}
++
++if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
++    print "no\n";
++    exit 0;
++}
++
++if ( $ARGV[0] and $ARGV[0] eq "config" ) {
++    print "graph_title Heimdal KDC requests\n";
++    print "graph_args --base 1000\n";
++    print "graph_vlabel requests / \${graph_period}\n";
++    print "graph_scale yes\n";
++    print "graph_category Heimdal\n";
++    print "ipv4.label IPv4 requests\n";
++    print "ipv4.type ABSOLUTE\n";
++    print "ipv4.min 0\n";
++    print "ipv6.label IPv6 requests\n";
++    print "ipv6.type ABSOLUTE\n";
++    print "ipv6.min 0\n";
++    print "lookupfail.label Failed lookups\n";
++    print "lookupfail.type ABSOLUTE\n";
++    print "lookupfail.min 0\n";
++    print "asreq.label AS-REQ requests\n";
++    print "asreq.type ABSOLUTE\n";
++    print "asreq.min 0\n";
++    print "tgsreq.label TGS-REQ requests\n";
++    print "tgsreq.type ABSOLUTE\n";
++    print "tgsreq.min 0\n";
++    print "pafail.label Preauth failed requests\n";
++    print "pafail.type ABSOLUTE\n";
++    print "pafail.min 0\n";
++    print "xrout.label Cross-realm tgs out\n";
++    print "xrout.type ABSOLUTE\n";
++    print "xrout.min 0\n";
++    print "xrin.label Cross-realm tgs in\n";
++    print "xrin.type ABSOLUTE\n";
++    print "xrin.min 0\n";
++    print "referrals.label Referrals\n";
++    print "referrals.type ABSOLUTE\n";
++    print "referrals.min 0\n";
++    exit 0;
++}
++
++my $logfile = "$LOGDIR/$LOGFILE";
++
++if (! -f $logfile) {
++    print "ipv4.value U\n";
++    print "ipv6.value U\n";
++    print "lookupfail.value U\n";
++    print "asreq.value U\n";
++    print "tgsreq.value U\n";
++    print "pafail.value U\n";
++    print "xrout.value U\n";
++    print "xrin.value U\n";
++    print "referrals.value U\n";
++    exit 1;
++}
++
++($pos) = restore_state();
++
++if (!defined($pos)) {
++    
++    # No state file present.  Avoid startup spike: Do not read log
++    # file up to now, but remember how large it is now, and next
++    # time read from there.
++
++    $pos = (stat $logfile)[7]; # File size
++} else {
++    $pos = parseLogfile ($logfile, $pos);
++}
++
++print "ipv4.value $ip{'4'}\n";
++print "ipv6.value $ip{'6'}\n";
++print "lookupfail.value $no_such_princ\n";
++print "asreq.value $as_req\n";
++print "tgsreq.value $tgs_req\n";
++print "pafail.value $pa_failed\n";
++print "xrout.value $tgs_xrealm_out\n";
++print "xrin.value $tgs_xrealm_in\n";
++print "referrals.value $referrals\n";
++
++save_state($pos);
++
++# vim:syntax=perl
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/munin-plugins-muninexchange/munin-plugins-muninexchange.spec?r1=1.12&r2=1.13&f=u



More information about the pld-cvs-commit mailing list