moved to git
authorSebastian Fiedler <fiedler@schlittermann.de>
Thu, 24 Jan 2019 10:28:07 +0100
changeset 5 69e41ec7fccc
parent 4 d9cd7d16a0f4
child 6 6d3fc7726354
moved to git
Makefile
check_mem.pl
debian/changelog
debian/compat
debian/control
debian/copyright
debian/docs
debian/rules
debian/source/format
--- a/Makefile	Tue Mar 31 09:25:16 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-SCRIPTS = check_mem
-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 $@
--- a/check_mem.pl	Tue Mar 31 09:25:16 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-#! /usr/bin/perl -w
-
-#    Copyright (C) 2011  Christian Arnold
-#
-#    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>
-
-use 5.010;
-use strict;
-use File::Basename;
-use Getopt::Long;
-use Pod::Usage;
-
-delete @ENV{ grep /^LC_/ => keys %ENV };
-$ENV{LANG}   = "C";
-$ENV{LC_ALL} = "C";
-
-sub version($$);
-sub get_meminfo();
-sub report($$$$);
-
-my %ERRORS = (
-    OK        => 0,
-    WARNING   => 1,
-    CRITICAL  => 2,
-    UNKNOWN   => 3,
-    DEPENDENT => 4
-);
-
-my $ME      = basename $0;
-my $NAME    = "MEM";
-my $VERSION = "0.3";
-
-my %opt = (
-    warning  => 70,
-    critical => 90
-);
-
-MAIN: {
-    Getopt::Long::Configure('bundling');
-    GetOptions(
-        "w|warning=i"  => \$opt{warning},
-        "c|critical=i" => \$opt{critical},
-        "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} );
-
-    my ( $percent, $total, $used, $free ) = get_meminfo();
-    report( $percent, $total, $used, $free );
-}
-
-sub report($$$$) {
-    my ( $percent, $total, $used, $free ) = @_;
-
-    if ( $percent >= $opt{critical} ) {
-        say
-"$NAME CRITICAL: $percent\% used memory - total: $total MB, used: $used MB, free: $free MB|MemUsed=$percent\%;$opt{warning};$opt{critical}";
-        exit $ERRORS{CRITICAL};
-    }
-    if ( $percent >= $opt{warning} ) {
-        say
-"$NAME WARNING: $percent\% used memory - total: $total MB, used: $used MB, free: $free MB|MemUsed=$percent\%;$opt{warning};$opt{critical}";
-        exit $ERRORS{WARNING};
-    }
-    say
-"$NAME OK: $percent\% used memory - total: $total MB, used: $used MB, free: $free MB|MemUsed=$percent\%;$opt{warning};$opt{critical}";
-    exit $ERRORS{OK};
-}
-
-sub get_meminfo() {
-    my ( $total, $used, $free, $percent );
-    my @cmd = ( '/usr/bin/free', '-m' );
-
-    foreach (`/usr/bin/free -m`) {
-        /^Mem:\s+(?<total>[\d.]+)/
-          and $total = $+{total}
-          and next;
-        /^.+buffers\/cache:\s+(?<used>[\d.]+)/
-          and $used = $+{used}
-          and last;
-    }
-
-    $free = ( $total - $used );
-    $percent = ( sprintf( "%.0f", ( $used / $total ) * 100 ) );
-
-    return ( $percent, $total, $used, $free );
-}
-
-sub version($$) {
-    my ( $progname, $version ) = @_;
-
-    say <<_VERSION;
-$progname version $version
-Copyright (C) 2011 by Christian Arnold 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_mem - nagios plugin to check memory usage
-
-=head1 SYNOPSIS
-
-check_mem [B<-w>|B<--warning> I<integer>] [B<-c>|B<--critical> I<integer>]
-
-check_mem [B<-h>|B<--help>]
-
-check_mem [B<-m>|B<--man>]
-
-check_mem [B<-v>|B<--version>]
-
-=head1 OPTIONS
-
-=over
-
-=item B<-w>|B<--warning> I<integer>
-
-Exit with WARNING status if memory usage in percent exceeds this value (default: 70)
-
-=item B<-c>|B<--critical> I<integer>
-
-Exit with CRITICAL status if memory usage in percent exceeds this value (default: 90)
-
-=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 nagios plugin check the memory usage.
-
-=head1 VERSION
-
-This man page is current for version 0.3 of B<check_mem>.
-
-=head1 AUTHOR
-
-Written by Christian Arnold L<arnold@schlittermann.de>
-
-=head1 COPYRIGHT
-
-Copyright (C) 2011 by Christian Arnold 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.
--- a/debian/changelog	Tue Mar 31 09:25:16 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-nagios-plugin-mem (0.4) oldstable stable; urgency=medium
-
-  * changed maintainer
-  * removed dependency on perl-doc
-
- -- Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>  Tue, 31 Mar 2015 09:24:59 +0200
-
-nagios-plugin-mem (0.3) stable; urgency=low
-
-  * fixing lintian errors and warnings 
-
- -- Christian Arnold <arnold@schlittermann.de>  Tue, 04 Oct 2011 14:32:28 +0200
-
-nagios-plugin-mem (0.2) lenny squeeze; urgency=low
-
-  * now output memory usage without buffers and cached files
-
- -- Christian Arnold <arnold@schlittermann.de>  Thu, 30 Jun 2011 15:54:29 +0200
-
-nagios-plugin-mem (0.1) lenny squeeze; urgency=low
-
-  * Initial Release.
-
- -- Christian Arnold <arnold@schlittermann.de>  Thu, 30 Jun 2011 14:27:52 +0200
--- a/debian/compat	Tue Mar 31 09:25:16 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-7
--- a/debian/control	Tue Mar 31 09:25:16 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-Source: nagios-plugin-mem
-Section: net
-Priority: extra
-Maintainer: Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
-Build-Depends: debhelper (>= 7)
-Standards-Version: 3.9.1
-Homepage: https://keller.schlittermann.de/hg/ius/nagios/nagios-plugin-mem/
-
-Package: nagios-plugin-mem
-Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends} 
-Description: nagios plugin to check the memory usage
- This nagios plugin checks the percent memory usage of the system.
--- a/debian/copyright	Tue Mar 31 09:25:16 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-This work was packaged for Debian by:
-
-    Christian Arnold <arnold@schlittermann.de> on Thu, 30 Jun 2011 14:27:52 +0200
-
-It was downloaded from:
-
-    https://keller.schlittermann.de/hg/ius/nagios/nagios-plugin-mem/
-
-Upstream Author(s):
-
-    Christian Arnold <arnold@schlittermann.de>
-
-Copyright:
-
-    Copyright (C) 2011 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 Christian Arnold <arnold@schlittermann.de>
-
-and is licensed under the GPL version 3, see above.
--- a/debian/rules	Tue Mar 31 09:25:16 2015 +0200
+++ /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	Tue Mar 31 09:25:16 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-3.0 (native)