From 6fbd14fea5c111a23d9074d25499991cbfa58f79 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Sun, 23 Nov 2008 05:38:47 +0000 Subject: Removing CVS/SVN tags and replacing with git-based versioning For contrib/, full tags have been imported from subversion git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c --- plugins-scripts/Makefile.am | 13 +++++++++++++ plugins-scripts/check_breeze.pl | 4 ++-- plugins-scripts/check_disk_smb.pl | 5 ++--- plugins-scripts/check_file_age.pl | 5 ++--- plugins-scripts/check_flexlm.pl | 5 ++--- plugins-scripts/check_ifoperstatus.pl | 5 ++--- plugins-scripts/check_ifstatus.pl | 5 ++--- plugins-scripts/check_ircd.pl | 5 ++--- plugins-scripts/check_log.sh | 2 +- plugins-scripts/check_mailq.pl | 5 ++--- plugins-scripts/check_mssql.pl | 3 +-- plugins-scripts/check_netdns.pl | 1 - plugins-scripts/check_ntp.pl | 5 ++--- plugins-scripts/check_oracle.sh | 2 +- plugins-scripts/check_rpc.pl | 18 ++++++++---------- plugins-scripts/check_sensors.sh | 2 +- plugins-scripts/check_wave.pl | 5 ++--- plugins-scripts/subst.in | 3 +++ plugins-scripts/t/check_file_age.t | 1 - plugins-scripts/t/check_rpc.t | 1 - plugins-scripts/t/utils.t | 1 - plugins-scripts/utils.pm.in | 3 --- 22 files changed, 48 insertions(+), 51 deletions(-) mode change 100644 => 100755 plugins-scripts/check_ifoperstatus.pl (limited to 'plugins-scripts') diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index 01fca20d..c9e3e40e 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am @@ -1,5 +1,11 @@ ## Process this file with automake to produce Makefile.in +NP-VERSION-FILE: .FORCE-NP-VERSION-FILE + @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN +-include NP-VERSION-FILE + +export NP_VERSION:= $(NP_VERSION) + SUFFIXES = .pl .sh VPATH=$(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t @@ -18,6 +24,8 @@ TESTS_ENVIRONMENT=perl -I $(top_builddir) -I $(top_srcdir) TESTS = @SCRIPT_TEST@ +all-local: NP-VERSION-FILE + test: perl -I $(top_builddir) -I $(top_srcdir) ../test.pl perl -I $(top_builddir) -I $(top_srcdir) ../test.pl t/utils.t # utils.t is excluded from above, so manually ask to test @@ -35,3 +43,8 @@ CLEANFILES=$(libexec_SCRIPTS) .sh : $(AWK) -f ./subst $< > $@ chmod +x $@ + +clean-local: + rm -f NP-VERSION-FILE + +.PHONY: .FORCE-NP-VERSION-FILE diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl index 0e9cffb8..a4e8542c 100755 --- a/plugins-scripts/check_breeze.pl +++ b/plugins-scripts/check_breeze.pl @@ -26,7 +26,7 @@ GetOptions "C=s" => \$opt_C, "community=s" => \$opt_C); if ($opt_V) { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -65,7 +65,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop This plugin reports the signal strength of a Breezecom wireless equipment diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 4f8a9a73..3f531ac7 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl @@ -16,7 +16,6 @@ # drives is a pain in the butt # 2-May-2002 - SGhosh fix for embedded perl # -# $Id$ # require 5.004; @@ -52,7 +51,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision$'); #' + print_revision($PROGNAME,'@NP_VERSION@'); #' exit $ERRORS{'OK'}; } @@ -243,7 +242,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Michael Anthon/Karl DeBisschop Perl Check SMB Disk plugin for Nagios diff --git a/plugins-scripts/check_file_age.pl b/plugins-scripts/check_file_age.pl index ca8883e5..dcd5efab 100755 --- a/plugins-scripts/check_file_age.pl +++ b/plugins-scripts/check_file_age.pl @@ -1,5 +1,4 @@ #!/bin/perl -w -# $Id$ # check_file_age.pl Copyright (C) 2003 Steven Grimm # @@ -55,7 +54,7 @@ GetOptions( "C=f" => \$opt_C, "critical-size=f" => \$opt_C); if ($opt_V) { - print_revision($PROGNAME, '$Revision$'); + print_revision($PROGNAME, '@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -102,7 +101,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME, '$Revision$'); + print_revision($PROGNAME, '@NP_VERSION@'); print "Copyright (c) 2003 Steven Grimm\n\n"; print_usage(); print "\n"; diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl index ade5843c..54d933c7 100755 --- a/plugins-scripts/check_flexlm.pl +++ b/plugins-scripts/check_flexlm.pl @@ -26,7 +26,6 @@ # initial version: 9-10-99 Ernst-Dieter Martin edmt@infineon.com # # License: GPL -# $Id$ # # lmstat output patches from Steve Rigler/Cliff Rice 13-Apr-2002 # srigler@marathonoil.com,cerice@marathonoil.com @@ -57,7 +56,7 @@ GetOptions "t=i" => \$opt_t, "timeout=i" => \$opt_t); if ($opt_V) { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -217,7 +216,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Ernst-Dieter Martin/Karl DeBisschop Check available flexlm license managers diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl old mode 100644 new mode 100755 index 75e852de..d0a1655a --- a/plugins-scripts/check_ifoperstatus.pl +++ b/plugins-scripts/check_ifoperstatus.pl @@ -25,7 +25,6 @@ # Report bugs to: nagiosplug-help@lists.sourceforge.net # # 11.01.2000 Version 1.0 -# $Id$ # # Patches from Guy Van Den Bergh to warn on ifadminstatus down interfaces # instead of critical. @@ -313,7 +312,7 @@ sub print_help() { printf "intensive. Use it sparingly or not at all. -n is used to match against\n"; printf "a much more descriptive ifName value in the IfXTable to verify that the\n"; printf "snmpkey has not changed to some other network interface after a reboot.\n\n"; - print_revision($PROGNAME, '$Revision$'); + print_revision($PROGNAME, '@NP_VERSION@'); } @@ -351,7 +350,7 @@ sub process_arguments() { } if ($opt_V) { - print_revision($PROGNAME,'$Revision$ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl index 1a168bf0..bae3ffa7 100755 --- a/plugins-scripts/check_ifstatus.pl +++ b/plugins-scripts/check_ifstatus.pl @@ -29,7 +29,6 @@ # # 11.01.2000 Version 1.0 # -# $Id$ use POSIX; use strict; @@ -255,7 +254,7 @@ sub print_help (){ printf " -t (--timeout) seconds before the plugin times out (default=$TIMEOUT)\n"; printf " -V (--version) Plugin version\n"; printf " -h (--help) usage help \n\n"; - print_revision($PROGNAME, '$Revision$'); + print_revision($PROGNAME, '@NP_VERSION@'); } @@ -285,7 +284,7 @@ sub process_arguments() { exit $ERRORS{'OK'}; } if ($opt_V) { - print_revision($PROGNAME,'$Revision$ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl index 7a90a96b..cc730cff 100755 --- a/plugins-scripts/check_ircd.pl +++ b/plugins-scripts/check_ircd.pl @@ -7,7 +7,6 @@ # # Date: 1999/09/20 # -# $Id$ # # Description: This script will check to see if an IRCD is running # about how many users it has @@ -119,7 +118,7 @@ sub print_usage () { sub print_help () { - print_revision($PROGNAME,'$Revision$ '); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Richard Mayhew/Karl DeBisschop Perl Check IRCD plugin for Nagios @@ -190,7 +189,7 @@ MAIN: "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision$ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } diff --git a/plugins-scripts/check_log.sh b/plugins-scripts/check_log.sh index 6f6e68c2..a1bfb486 100755 --- a/plugins-scripts/check_log.sh +++ b/plugins-scripts/check_log.sh @@ -71,7 +71,7 @@ TOUCH="/bin/touch" PROGNAME=`/bin/basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision$' | sed -e 's/[^0-9.]//g'` +REVISION="@NP_VERSION@" . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index c676e41a..95ef2ce1 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl @@ -22,7 +22,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# $Id$ # ############################################################################ @@ -522,7 +521,7 @@ sub process_arguments(){ ); if ($opt_V) { - print_revision($PROGNAME,'$Revision$ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -580,7 +579,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2002 Subhendu Ghosh/Carlos Canau/Benjamin Schmid\n"; print "\n"; print_usage(); diff --git a/plugins-scripts/check_mssql.pl b/plugins-scripts/check_mssql.pl index fa15476b..9a8fc511 100755 --- a/plugins-scripts/check_mssql.pl +++ b/plugins-scripts/check_mssql.pl @@ -23,7 +23,6 @@ # # Report bugs to: nagiosplug-help@lists.sourceforge.net # -# $Id$ # @@ -125,7 +124,7 @@ sub process_arguments { "V" => \$opt_V, "version" => \$opt_V); if (defined $opt_V) { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } diff --git a/plugins-scripts/check_netdns.pl b/plugins-scripts/check_netdns.pl index 6872b932..ecdbdb1a 100755 --- a/plugins-scripts/check_netdns.pl +++ b/plugins-scripts/check_netdns.pl @@ -5,7 +5,6 @@ # # Copyright 2000, virCIO, LLP # -# $Log$ # Revision 1.3 2002/05/07 05:35:49 sghosh # 2nd fix for ePN # diff --git a/plugins-scripts/check_ntp.pl b/plugins-scripts/check_ntp.pl index d4175f64..5c87e0a6 100755 --- a/plugins-scripts/check_ntp.pl +++ b/plugins-scripts/check_ntp.pl @@ -7,7 +7,6 @@ # be installed on the system, however since it's part of the ntp suite, you # should already have it installed. # -# $Id$ # # Nothing clever done in this program - its a very simple bare basics hack to # get the job done. @@ -97,7 +96,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision$ '); + print_revision($PROGNAME,'@NP_VERSION@'); exit $ERRORS{'OK'}; } @@ -443,7 +442,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2003 Bo Kersey/Karl DeBisschop\n"; print "\n"; print_usage(); diff --git a/plugins-scripts/check_oracle.sh b/plugins-scripts/check_oracle.sh index 0a8f1521..664795eb 100755 --- a/plugins-scripts/check_oracle.sh +++ b/plugins-scripts/check_oracle.sh @@ -8,7 +8,7 @@ PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision$' | sed -e 's/[^0-9.]//g'` +REVISION="@NP_VERSION@" . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index 20c204de..d2701e95 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl @@ -15,10 +15,8 @@ # # initial version: 3 May 2000 by Truongchinh Nguyen and Karl DeBisschop # Modified May 2002 Subhendu Ghosh - support for ePN and patches -# current status: $Revision$ # # Copyright Notice: GPL -# $Id$ # use strict; @@ -38,13 +36,13 @@ sub print_help (); sub print_usage (); sub in ($$); -$ENV{'BASH_ENV'}=''; +$ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; $ENV{'PATH'}=''; $ENV{'LC_ALL'}='C'; #Initialise protocol for each progname number -# 'u' for UDP, 't' for TCP +# 'u' for UDP, 't' for TCP $proto[10003]='u'; $proto[10004]='u'; $proto[10007]='u'; @@ -67,9 +65,9 @@ GetOptions( if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } # -V means display version number -if ($opt_V) { - print_revision($PROGNAME,'$Revision$ '); - exit $ERRORS{'OK'}; +if ($opt_V) { + print_revision($PROGNAME,'@NP_VERSION@'); + exit $ERRORS{'OK'}; } # Hash containing all RPC program names and numbers @@ -275,7 +273,7 @@ if (defined $opt_c ) { }else{ print "Version $vers is not an integer\n" if $verbose; } - + } }else{ get_rpcinfo(); @@ -311,7 +309,7 @@ sub get_rpcinfo { while ( $line = ) { printf "$line " if $verbose; chomp $line; - + if ( $line =~ /program $prognum version ([0-9]*) ready and waiting/ ) { $response .= " version $1"; $state = 'OK' unless $state ne 'UNKNOWN'; @@ -336,7 +334,7 @@ sub get_rpcinfo { sub print_help() { - print_revision($PROGNAME,'$Revision$ '); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2002 Karl DeBisschop/Truongchinh Nguyen/Subhendu Ghosh\n"; print "\n"; print "Check if a rpc service is registered and running using\n"; diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh index 7e1d3333..ae80fc44 100755 --- a/plugins-scripts/check_sensors.sh +++ b/plugins-scripts/check_sensors.sh @@ -4,7 +4,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin PROGNAME=`basename $0` PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision$' | sed -e 's/[^0-9.]//g'` +REVISION="@NP_VERSION@" . $PROGPATH/utils.sh diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl index fe217017..2671112a 100755 --- a/plugins-scripts/check_wave.pl +++ b/plugins-scripts/check_wave.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl -wT # -# $Id$ use strict; @@ -30,7 +29,7 @@ GetOptions "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { - print_revision($PROGNAME,'$Revision$'); #' + print_revision($PROGNAME,'@NP_VERSION@'); #' exit $ERRORS{'OK'}; } @@ -112,7 +111,7 @@ sub print_usage () { } sub print_help () { - print_revision($PROGNAME,'$Revision$'); + print_revision($PROGNAME,'@NP_VERSION@'); print "Copyright (c) 2000 Jeffery Blank/Karl DeBisschop\n"; print "\n"; print_usage(); diff --git a/plugins-scripts/subst.in b/plugins-scripts/subst.in index 89868684..80b93d9d 100644 --- a/plugins-scripts/subst.in +++ b/plugins-scripts/subst.in @@ -37,6 +37,9 @@ BEGIN { } +# Plugin revision +/@NP_VERSION@/ {sub(/@NP_VERSION@/,ENVIRON["NP_VERSION"]);} + # scripting language (first line) /^#! ?\/.*\/python/ {sub(/^#! ?\/.*\/python/,"#! @PYTHON@");} diff --git a/plugins-scripts/t/check_file_age.t b/plugins-scripts/t/check_file_age.t index 372b9f2e..384c276b 100644 --- a/plugins-scripts/t/check_file_age.t +++ b/plugins-scripts/t/check_file_age.t @@ -2,7 +2,6 @@ # # check_file_age tests # -# $Id$ # use strict; diff --git a/plugins-scripts/t/check_rpc.t b/plugins-scripts/t/check_rpc.t index 9fff0ee9..be8ae2f7 100644 --- a/plugins-scripts/t/check_rpc.t +++ b/plugins-scripts/t/check_rpc.t @@ -2,7 +2,6 @@ # # Remote Procedure Call (RPC) Tests via check_rpc # -# $Id$ # use strict; diff --git a/plugins-scripts/t/utils.t b/plugins-scripts/t/utils.t index f37f567f..9c2c5695 100644 --- a/plugins-scripts/t/utils.t +++ b/plugins-scripts/t/utils.t @@ -2,7 +2,6 @@ # # utils.pm tests # -# $Id$ # # Run with perl t/utils.t diff --git a/plugins-scripts/utils.pm.in b/plugins-scripts/utils.pm.in index 08776f18..37cd62c3 100644 --- a/plugins-scripts/utils.pm.in +++ b/plugins-scripts/utils.pm.in @@ -1,5 +1,4 @@ # Utility drawer for Nagios plugins. -# $Id$ # # This will be deprecated soon. Please use Nagios::Plugin from CPAN # for new plugins @@ -32,8 +31,6 @@ $TIMEOUT = 15; sub print_revision ($$) { my $commandName = shift; my $pluginRevision = shift; - $pluginRevision =~ s/^\$Revision: //; - $pluginRevision =~ s/ \$\s*$//; print "$commandName v$pluginRevision (@PACKAGE@ @VERSION@)\n"; print "@WARRANTY@"; } -- cgit v1.2.3