Quick fix to remove the 'use' of Data::Parse for the whole script.
authorGreg Sabino Mullane <[email protected]>
Wed, 4 Feb 2009 15:41:53 +0000 (10:41 -0500)
committerGreg Sabino Mullane <[email protected]>
Wed, 4 Feb 2009 15:41:53 +0000 (10:41 -0500)
check_postgres.pl

index 81586b2df95b82302b1249ad358d936a59b0bfe6..ae2c929f717f9ce62f5b14d13521d22c5bfd3f97 100755 (executable)
@@ -3749,7 +3749,13 @@ sub check_checkpoint {
        my $last = $1;
 
        ## Convert to number of seconds
-       use Date::Parse;
+       eval {
+               require Date::Parse;
+               import Date::Parse;
+       };
+       if ($@) {
+               ndie "Must install the Perl module 'Date::Parse' to use the checkpoint action";
+       }
        my $dt = str2time($last);
        if ($dt !~ /^\d+$/) {
                ndie qq{Unable to parse pg_controldata output: "$last"\n};