moved to git default tip
authorMatthias Förste <foerste@schlittermann.de>
Wed, 24 Oct 2018 15:43:23 +0200
changeset 7 f0871534a792
parent 6 818e48975f3c
moved to git
.hgignore
.perltitdy
Makefile
README
check_drbd.pl
debian/changelog
debian/compat
debian/control
debian/copyright
debian/docs
debian/rules
debian/source/format
--- a/.hgignore	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-syntax: glob
-*.swp
-*.orig
-debian/files
-check_drbd
-
-syntax: regexp
-(build|configure)-stamp$
-debian/nagios-plugin-drbd[./]
--- a/.perltitdy	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
---paren-tightness=2
---square-bracket-tightness=2
--- a/Makefile	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-SCRIPTS = check_drbd
-CLEANFILES = ${SCRIPTS}
-DESTDIR =
-prefix = /usr
-
-plugindir = ${prefix}/lib/nagios/plugins/ius
-
-.PHONY:	all	clean install
-
-all: ${SCRIPTS}
-
-clean:
-	-rm -f ${CLEANFILES}
-
-install: all
-	install -d -m 0755 ${DESTDIR}/${plugindir}
-	install -m 0755 $(SCRIPTS) ${DESTDIR}/${plugindir}/
-
-%:	%.pl
-	@perl -c $<
-	@cp -f $< $@
-	@chmod +x $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README	Wed Oct 24 15:43:23 2018 +0200
@@ -0,0 +1,1 @@
+moved to git
--- a/check_drbd.pl	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-#! /usr/bin/perl -w
-
-#    Copyright (C) 2011-2014  Christian Arnold
-#    Copyright (C) 2014-2017  Matthias Förste
-#
-#    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, either version 3 of the License, or
-#    (at your option) any later version.
-#
-#    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, see <http://www.gnu.org/licenses/>.
-#
-#    Christian Arnold <arnold@schlittermann.de>
-#    Matthias Förste <foerste@schlittermann.de>
-
-use strict;
-use File::Basename;
-use Getopt::Long;
-use Pod::Usage;
-
-my %ERRORS = (
-    OK        => 0,
-    WARNING   => 1,
-    CRITICAL  => 2,
-    UNKNOWN   => 3,
-    DEPENDENT => 4
-);
-
-sub check_status($);
-sub version($$);
-
-my $ME      = basename $0;
-my $NAME    = 'DRBD';
-my $VERSION = "2.0";
-
-my %opt = ( file => "/proc/drbd" );
-
-MAIN: {
-    Getopt::Long::Configure('bundling');
-    GetOptions(
-        "f|file=s" => \$opt{file},
-        "h|help" => sub { pod2usage( -verbose => 1, -exitval => $ERRORS{OK} ) },
-        "m|man" => sub { pod2usage( -verbose => 2, -exitval => $ERRORS{OK} ) },
-        "V|version" => sub { version( $ME, $VERSION ); exit $ERRORS{OK}; }
-    ) or pod2usage( -verbose => 1, -exitval => $ERRORS{CRITICAL} );
-
-    check_status( $opt{file} );
-}
-
-sub check_status($) {
-    my $file = shift;
-    my ( %drbd, @warning, @critical, @ok ) = ();
-
-    unless ( -r $file ) {
-        print "$NAME CRITICAL: $file $!\n";
-        exit $ERRORS{CRITICAL};
-    }
-
-    open( FH, $file )
-      or print "$NAME CRITICAL: $file $!\n" and exit $ERRORS{CRITICAL};
-    my $r;
-    while (<FH>) {
-        chomp;
-        if (/^\s*(?<line>(?<resource>\d+):\s+cs:(?<connection_state>\S+)\s+(?:st|ro):(?<roles>\S+)\s+(?:ds|ld):(?<disk_states>\S+))/) {
-            $r = $+{resource};
-            $drbd{$r} = {
-                line             => $+{line},
-                connection_state => $+{connection_state},
-                roles            => $+{roles},
-                disk_states      => $+{disk_states}
-            };
-        } elsif (defined $r and /oos:(?<out_of_sync>\d+)/) {
-            $drbd{$r}->{out_of_sync} = $+{out_of_sync};
-            $drbd{$r}->{line} .= " oos: $+{out_of_sync}";
-        }
-    }
-    close(FH);
-
-    unless (%drbd) {
-        print "$NAME CRITICAL: $file found, but no entries\n";
-        exit $ERRORS{CRITICAL};
-    }
-
-    foreach my $dev ( map { $drbd{$_} } sort keys %drbd ) {
-        $dev->{state} = "CRITICAL", next
-          if ( $dev->{roles} ne "Primary/Secondary" )
-          and ( $dev->{roles} ne "Secondary/Primary" );
-
-        $dev->{state} = "CRITICAL", next
-          if ( $dev->{disk_states} ne "UpToDate/UpToDate" )
-          and ( $dev->{disk_states} ne "Consistent" );
-
-        $dev->{state} = "CRITICAL", next
-          if ( $dev->{out_of_sync} != 0 );
-
-        $dev->{state} = "WARNING", next
-          if $dev->{connection_state} ne "Connected";
-
-        $dev->{state} = "OK";
-    }
-
-    foreach my $dev ( map { $drbd{$_} } sort keys %drbd ) {
-        $dev->{state} eq "WARNING"  and push( @warning,  $dev->{line} ), next;
-        $dev->{state} eq "CRITICAL" and push( @critical, $dev->{line} ), next;
-        $dev->{state} eq "OK"       and push( @ok,       $dev->{line} ), next;
-    }
-
-    print("$NAME CRITICAL: @critical\n"), exit $ERRORS{CRITICAL} if @critical;
-    print("$NAME WARNING: @warning\n"),   exit $ERRORS{WARNING}  if @warning;
-    print("$NAME OK: @ok\n"),             exit $ERRORS{OK};
-}
-
-sub version($$) {
-    my $progname = shift;
-    my $version  = shift;
-
-    print <<_VERSION;
-$progname version $version
-Copyright (C) 2011-2014 by Christian Arnold and Schlittermann internet & unix support.
-Copyright (C) 2014-2017 by Matthias Förste and Schlittermann internet & unix support.
-
-$ME comes with ABSOLUTELY NO WARRANTY. This is free software,
-and you are welcome to redistribute it under certain conditions.
-See the GNU General Public Licence for details.
-_VERSION
-}
-
-__END__
-
-=head1 NAME
-
-check_drbd - nagios plugin to check drbd status
-
-=head1 SYNOPSIS
-
-check_drbd [-f|--file path]
-           [-h|--help]
-           [-m|--man]
-           [-V|--version]
-
-=head1 OPTIONS
-
-=over
-
-=item B<-f>|B<--file> I<path>
-
-Absolute path of drbd status file. (default: /proc/drbd)
-
-=item B<-h>|B<--help>
-
-Print detailed help screen.
-
-=item B<-m>|B<--man>
-
-Print manual page.
-
-=item B<-V>|B<--version>
-
-Print version information.
-
-=back
-
-=head1 DESCRIPTION
-
-This plugin check drbd status.
-
-=head1 VERSION
-
-This man page is current for version 2.0 of check_drbd.
-
-=head1 AUTHOR
-
-Written by Christian Arnold L<arnold@schlittermann.de>. Currently maintained by Matthias Förste L<foerste@schlittermann.de>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2011-2014 by Christian Arnold and Schlittermann internet & unix support.
-Copyright (C) 2014-2017 by Matthias Förste and Schlittermann internet & unix support.
-This is free software, and you are welcome to redistribute it under certain conditions.
-See the GNU General Public Licence for details.
-
-=cut
--- a/debian/changelog	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-nagios-plugin-drbd (2.1) oldstable stable; urgency=medium
-
-  * fixed match for resource numbers with more than one digit
-  * maintainer/copyright updates
-  * fixed debian package policy violations
-
- -- Matthias Förste <foerste@schlittermann.de>  Mon, 09 Jan 2017 12:23:57 +0100
-
-nagios-plugin-drbd (2.0+nmu1) oldstable stable; urgency=low
-
-  * Non-maintainer upload.
-  * Consider out of sync blocks critical 
-
- -- Matthias Förste <foerste@schlittermann.de>  Fri, 08 Aug 2014 13:35:18 +0200
-
-nagios-plugin-drbd (2.0) etch lenny squeeze; urgency=low
-
-  * Initial Release.
-
- -- Christian Arnold <arnold@schlittermann.de>  Thu, 25 Aug 2011 16:30:59 +0200
--- a/debian/compat	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-7
--- a/debian/control	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-Source: nagios-plugin-drbd
-Section: net
-Priority: extra
-Maintainer: Matthias Förste <foerste@schlittermann.de>
-Build-Depends: debhelper (>= 7.0.50~)
-Standards-Version: 3.9.6
-Homepage: https://ssl.schlittermann.de/hg/ius/nagios/nagios-plugin-drbd/
-
-Package: nagios-plugin-drbd
-Architecture: all
-Depends: ${misc:Depends}, perl-base (>= 5.8.8), perl-doc
-Description: nagios plugin to check drbd status
- This plugin check drbd status.
--- a/debian/copyright	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-This work was packaged for Debian by:
-
-    Christian Arnold <arnold@schlittermann.de> on Thu, 25 Aug 2011 16:30:59 +0200
-
-It was downloaded from:
-
-    https://keller.schlittermann.de/hg/ius/nagios/nagios-plugin-drbd/
-
-Upstream Author:
-
-    Christian Arnold <arnold@schlittermann.de>
-
-Copyright:
-
-    Copyright (C) 2011-2014 Christian Arnold and Schlittermann internet & unix support
-    Copyright (C) 2014-2017 Matthias Förste and Schlittermann internet & unix support
-
-License:
-
-    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, either version 3 of the License, or
-    (at your option) any later version.
-
-    This package 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, see <http://www.gnu.org/licenses/>.
-
-On Debian systems, the complete text of the GNU General
-Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
-
-The Debian packaging is:
-
-    Copyright (C) 2011-2014 Christian Arnold
-    Copyright (C) 2014-2017 Matthias Förste
-
-and is licensed under the GPL version 3, see above.
--- a/debian/rules	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-%:
-	dh $@ 
--- a/debian/source/format	Mon Jan 09 15:33:15 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-3.0 (native)