#!/usr/bin/perl -T # creator : Tom Regner # created : Wed 11 Jun 2003 05:10:32 PM CEST # version : $Id: check_ifconfig,v 1.1 2003/06/12 13:17:35 tom Exp $ # copyright : (c) 2003 my company # use strict; use warnings; use Getopt::Long; use vars qw($opt_V $opt_h @opt_i @opt_n $PROGNAME $VERSION); use lib "/data/programme/nagios/libexec" ; use utils qw(%ERRORS &print_revision &support &usage &exit_); $PROGNAME = "progname"; #$VERSION = '$Revision'; # as originally posted $VERSION = '$Revision$'; # Update sub print_help (); sub print_usage (); $ENV{'PATH'}=''; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; Getopt::Long::Configure('bundling'); GetOptions ( "V" => \$opt_V, "version" => \$opt_V, "h" => \$opt_h, "help" => \$opt_h, ); if ($opt_V) { print_revision($PROGNAME,$VERSION); exit($ERRORS{'OK'}) ; } if ($opt_h) {print_help(); exit($ERRORS{'OK'});} # # main-test # # untaint args # check correctness of args my $msg = ''; # return message my $status = $ERRORS{OK}; # exit status # # perform test # exit_($status, $msg); # # subs for test-parts, recurring actions during the test, etc. # sub check { my ($stuff1, $stuff2,) = @_; my ($result, $dmsg) = (1, ""); # # do test, in case of error, change global variable $status # # assamble info into $dmsg # $msg .= $dmsg; # $msg is 'global' return $result; } # # nagios plugin-standards # sub print_usage () { } sub print_help () { print_revision($PROGNAME,$VERSION); print_usage(); support(); }