aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2011-03-18 09:37:41 +0000
committerMartin Wilke <miwi@FreeBSD.org>2011-03-18 09:37:41 +0000
commit3820de45de18bfbc980159de78b074e4f59f6094 (patch)
treed1f1253b7ea7aefdcef7e240cbf247682e08376c
parentbb0eee0de264de4ac24adb1aa88f5ce2a3d8b77d (diff)
downloadports-3820de45de18bfbc980159de78b074e4f59f6094.tar.gz
ports-3820de45de18bfbc980159de78b074e4f59f6094.zip
Notes
-rw-r--r--net-mgmt/Makefile1
-rw-r--r--net-mgmt/p5-Nagios-Plugin-LDAP/Makefile31
-rw-r--r--net-mgmt/p5-Nagios-Plugin-LDAP/distinfo2
-rw-r--r--net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-bind-master-server.patch11
-rw-r--r--net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-correct-csn-compare-multimaster.patch107
-rw-r--r--net-mgmt/p5-Nagios-Plugin-LDAP/pkg-descr4
-rw-r--r--net-mgmt/p5-Nagios-Plugin-LDAP/pkg-plist8
7 files changed, 164 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile
index 4ee4577b0a1b..76c3702d7148 100644
--- a/net-mgmt/Makefile
+++ b/net-mgmt/Makefile
@@ -193,6 +193,7 @@
SUBDIR += p5-NSNMP
SUBDIR += p5-Nagios-Object
SUBDIR += p5-Nagios-Plugin
+ SUBDIR += p5-Nagios-Plugin-LDAP
SUBDIR += p5-Nagios-Plugins-Memcached
SUBDIR += p5-Net-ACL
SUBDIR += p5-Net-Abuse-Utils
diff --git a/net-mgmt/p5-Nagios-Plugin-LDAP/Makefile b/net-mgmt/p5-Nagios-Plugin-LDAP/Makefile
new file mode 100644
index 000000000000..bbbdaaf6d54f
--- /dev/null
+++ b/net-mgmt/p5-Nagios-Plugin-LDAP/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: p5-Nagios-Plugin-LDAP
+# Date created: 01 Mar 2011
+# Whom: Alexander Kriventsov <avk@vl.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= Nagios-Plugin-LDAP
+PORTVERSION= 0.04
+CATEGORIES= net-mgmt
+MASTER_SITES= CPAN
+PKGNAMEPREFIX= p5-
+
+MAINTAINER= avk@vl.ru
+COMMENT= Nagios plugin to observe LDAP
+
+PERL_CONFIGURE= yes
+
+BUILD_DEPENDS= ${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap \
+ ${SITE_PERL}/Nagios/Plugin.pm:${PORTSDIR}/net-mgmt/p5-Nagios-Plugin \
+ ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
+ ${SITE_PERL}/${PERL_ARCH}/DateTime.pm:${PORTSDIR}/devel/p5-DateTime
+
+RUN_DEPENDS= ${BUILD_DEPENDS}
+
+MAN3= Nagios::Plugin::LDAP.3
+
+post-patch:
+ @${FIND} ${WRKSRC} -name "*.orig" -delete
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/p5-Nagios-Plugin-LDAP/distinfo b/net-mgmt/p5-Nagios-Plugin-LDAP/distinfo
new file mode 100644
index 000000000000..42e2d41a2708
--- /dev/null
+++ b/net-mgmt/p5-Nagios-Plugin-LDAP/distinfo
@@ -0,0 +1,2 @@
+SHA256 (Nagios-Plugin-LDAP-0.04.tar.gz) = 7f720b3ef24b763d9828abf96f780b110e3976de6974b40651f3da434c82f756
+SIZE (Nagios-Plugin-LDAP-0.04.tar.gz) = 22131
diff --git a/net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-bind-master-server.patch b/net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-bind-master-server.patch
new file mode 100644
index 000000000000..302a581d1ccc
--- /dev/null
+++ b/net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-bind-master-server.patch
@@ -0,0 +1,11 @@
+--- lib/Nagios/Plugin/LDAP.pm 2009-01-14 02:29:40.000000000 +0000
++++ lib/Nagios/Plugin/LDAP.pm 2009-01-15 02:17:56.000000000 +0000
+@@ -257,6 +257,7 @@
+ return 1 unless $warning or $critical;
+
+ my $src_ldap = $self->_ldap_connect($master) or return;
++ $self->_ldap_bind($src_ldap);
+
+ my $src_entry =
+ $self->_ldap_do_search($src_ldap, '(&(objectClass=*)(contextCSN=*))', 'contextCSN')
+
diff --git a/net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-correct-csn-compare-multimaster.patch b/net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-correct-csn-compare-multimaster.patch
new file mode 100644
index 000000000000..1fc05c9a5128
--- /dev/null
+++ b/net-mgmt/p5-Nagios-Plugin-LDAP/files/patch-correct-csn-compare-multimaster.patch
@@ -0,0 +1,107 @@
+--- lib/Nagios/Plugin/LDAP.pm 2010-12-10 15:57:47.000000000 +0000
++++ lib/Nagios/Plugin/LDAP.pm 2010-12-10 15:58:13.000000000 +0000
+@@ -266,44 +266,67 @@
+ $self->_ldap_do_search($dst_ldap, '(&(objectClass=*)(contextCSN=*))', 'contextCSN')
+ or return;
+
+- my $src_csn = $src_entry->get_value('contextCSN');
+- my $dst_csn = $dst_entry->get_value('contextCSN');
++ foreach my $src_current_csn (@{$src_entry->{'asn'}->{'attributes'}->[0]->{'vals'}}) {
++ my @csn=split('#',$src_current_csn);
++ my $src_server_id=$csn[2];
++
++ my $dst_current_csn;
++ my $dst_server_id;
++ foreach my $dst_temp_csn (@{$dst_entry->{'asn'}->{'attributes'}->[0]->{'vals'}}) {
++ my @temp_csn=split('#',$dst_temp_csn);
++ $dst_server_id=$temp_csn[2];
++ if ($dst_server_id eq $src_server_id){
++ $dst_current_csn=$dst_temp_csn;
++ last;
++ }
++ }
++
++ print "Host csn id: $src_server_id \n" if $verbose;
++ print "Master csn id: $dst_server_id \n" if $verbose;
++ print "Host csn: $src_current_csn \n" if $verbose;
++ print "Master csn: $dst_current_csn \n" if $verbose;
++
++ my $src_csn = $src_current_csn;
++ my $dst_csn = $dst_current_csn;
++
++ print "Master CSN = $src_csn\n" if $verbose;
++ print "Slave CSN = $dst_csn\n" if $verbose;
++
++ my ($YYYY, $MM, $DD, $hh, $mm, $ss);
++ ($YYYY, $MM, $DD, $hh, $mm, $ss) = $src_csn =~ /^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/;
++ my $src_dt = DateTime->new(
++ year => $YYYY,
++ month => $MM,
++ day => $DD,
++ hour => $hh,
++ minute => $mm,
++ second => $ss
++ );
++ ($YYYY, $MM, $DD, $hh, $mm, $ss) = $dst_csn =~ /^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/;
++ my $dst_dt = DateTime->new(
++ year => $YYYY,
++ month => $MM,
++ day => $DD,
++ hour => $hh,
++ minute => $mm,
++ second => $ss
++ );
++
++ my $delta = abs($src_dt->epoch - $dst_dt->epoch);
++
++ $self->add_message(
++ $self->check_threshold(check => $delta, warning => $warning, critical => $critical),
++ sprintf("csn id %s: %d seconds replication delta", $src_server_id,$delta));
++
++ $self->add_perfdata(
++ label => "repl$src_server_id",
++ value => $delta,
++ uom => 's',
++ threshold => $self->threshold
++ );
+
+- print "Master CSN = $src_csn\n" if $verbose;
+- print "Slave CSN = $dst_csn\n" if $verbose;
+-
+- my ($YYYY, $MM, $DD, $hh, $mm, $ss);
+- ($YYYY, $MM, $DD, $hh, $mm, $ss) = $src_csn =~ /^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/;
+- my $src_dt = DateTime->new(
+- year => $YYYY,
+- month => $MM,
+- day => $DD,
+- hour => $hh,
+- minute => $mm,
+- second => $ss
+- );
+- ($YYYY, $MM, $DD, $hh, $mm, $ss) = $dst_csn =~ /^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/;
+- my $dst_dt = DateTime->new(
+- year => $YYYY,
+- month => $MM,
+- day => $DD,
+- hour => $hh,
+- minute => $mm,
+- second => $ss
+- );
+-
+- my $delta = abs($src_dt->epoch - $dst_dt->epoch);
+-
+- $self->add_message(
+- $self->check_threshold(check => $delta, warning => $warning, critical => $critical),
+- sprintf("%d seconds replication delta", $delta));
+-
+- $self->add_perfdata(
+- label => 'repl',
+- value => $delta,
+- uom => 's',
+- threshold => $self->threshold
+- );
++ print "\n" if $verbose;
++ }
+
+ }
+
diff --git a/net-mgmt/p5-Nagios-Plugin-LDAP/pkg-descr b/net-mgmt/p5-Nagios-Plugin-LDAP/pkg-descr
new file mode 100644
index 000000000000..7335bfa6bf80
--- /dev/null
+++ b/net-mgmt/p5-Nagios-Plugin-LDAP/pkg-descr
@@ -0,0 +1,4 @@
+Nagios plugin to observe LDAP
+
+WWW: http://search.cpan.org/dist/Nagios-Plugin-LDAP/
+
diff --git a/net-mgmt/p5-Nagios-Plugin-LDAP/pkg-plist b/net-mgmt/p5-Nagios-Plugin-LDAP/pkg-plist
new file mode 100644
index 000000000000..45dded445c5a
--- /dev/null
+++ b/net-mgmt/p5-Nagios-Plugin-LDAP/pkg-plist
@@ -0,0 +1,8 @@
+%%SITE_PERL%%/%%PERL_ARCH%%/auto/Nagios/Plugin/LDAP/.packlist
+bin/check_ldap_repl
+%%SITE_PERL%%/Nagios/Plugin/LDAP.pm
+@dirrmtry %%SITE_PERL%%/Nagios/Plugin
+@dirrmtry %%SITE_PERL%%/Nagios
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Nagios/Plugin/LDAP
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Nagios/Plugin
+@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Nagios