From: Greg Sabino Mullane Date: Sat, 17 May 2008 13:07:11 +0000 (-0400) Subject: Add --symlinks arg as a shorter way of saying --action=rebuild_symlinks X-Git-Tag: 2.9.0~341 X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=1de96e824c92be5d1a5651106cf17f883cffcec2;p=check_postgres.git Add --symlinks arg as a shorter way of saying --action=rebuild_symlinks --- diff --git a/check_postgres.pl b/check_postgres.pl index efacda202..3ead325df 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -28,7 +28,7 @@ $Data::Dumper::Varname = 'POSTGRES'; $Data::Dumper::Indent = 2; $Data::Dumper::Useqq = 1; -our $VERSION = '1.6.0'; +our $VERSION = '1.6.1'; use vars qw/ %opt $PSQL $res $COM $SQL $db /; @@ -88,6 +88,7 @@ die $USAGE unless 'showtime=i', 'timeout|t=i', 'test', + 'symlinks', 'action=s', 'warning=s', @@ -214,15 +215,12 @@ Other options: -v, --verbose verbosity level; can be used more than once to increase the level -h, --help display this help information -t X, --timeout=X how long in seconds before we timeout. Defaults to 10 seconds. + --symlinks create named symlinks to the main program for each action Actions: Which test is determined by the --action option, or by the name of the program $action_usage -Special actions: - rebuild_symlinks - Make named symlinks to the main program for each action - rebuild_symlinks_force - Same as above, but removes existing symlinks first. - For a complete list of options and full documentation, please view the POD for this file. Two ways to do this is to run: pod2text $ME | less @@ -234,6 +232,8 @@ Or simply visit: http://bucardo.org/check_postgres/ exit; } +build_symlinks() if $opt{symlinks}; + $action =~ /\w/ or die $USAGE; ## Be nice and figure out what they meant @@ -2578,12 +2578,12 @@ check_postgres.pl - Postgres monitoring script for Nagios =head1 VERSION -This documents describes B version 1.6.0 +This documents describes B version 1.6.1 =head1 SYNOPSIS ## Create all symlinks - check_postgres.pl --action=build_symlinks + check_postgres.pl --symlinks ## Check connection to Postgres database 'pluto': check_postgres.pl --action=connection --db=pluto @@ -2759,12 +2759,12 @@ or use a program named: check_postgres_timesync All the symlinks are created for you in the current directory -if use the action "build_symlinks": +if use the option --symlinks - perl check_postgres.pl --action="build_symlinks" + perl check_postgres.pl --symlinks If the file name already exists, it will not be overwritten. If the file exists -and is a symlink, you can force it to overwrite by using "build_symlinks_force" +and is a symlink, you can force it to overwrite by using "--action=build_symlinks_force" Most actions take a B<--warning> and an B<--critical> option, indicating at what point we change from OK to WARNING, and what point we go to CRITICAL. Note that @@ -3174,7 +3174,8 @@ This action requires no other arguments, and does not connect to any databases, but simply creates symlinks in the current directory for each action, in the form Baction_nameE>. If the file already exists, it will not be overwritten. If the action is rebuild_symlinks_force, -then symlinks will be overwritten. +then symlinks will be overwritten. The option --symlinks is a shorter way of saying +--action=rebuild_symlinks =item B (symlink: C) @@ -3407,6 +3408,10 @@ Items not specifically attributed are by Greg Sabino Mullane. =item B (May 11, 2008) +Add --symlinks arg as a shortcut to --action=rebuild_symlinks + +=item B (May 11, 2008) + Add the custom_query action. =item B (May 2, 2008)