Remove the no warnings hack.
authorGreg Sabino Mullane <[email protected]>
Tue, 24 Sep 2013 19:08:30 +0000 (15:08 -0400)
committerGreg Sabino Mullane <[email protected]>
Tue, 24 Sep 2013 19:08:30 +0000 (15:08 -0400)
check_postgres.pl

index 03ab43a23440d5955335da4ba7d6a784d13ebabc..097c4cbd66ea75b1616540a67fa4a8c938dd6239 100755 (executable)
@@ -5517,10 +5517,9 @@ sub check_pgagent_jobs {
         : $critical ? 1 : 0;
 
     # Determine max time to examine.
-    my $seconds = do {
-        no warnings;
-        $warning > $critical ? $warning : $critical;
-    };
+    my $seconds = $critical;
+    $seconds = $warning if length $warning and 
+        (! length $critical or $warning > $critical);
 
     $SQL = qq{
         SELECT jlog.jlgid