Fix version action: only output mrtg if in that mode.
authorGreg Sabino Mullane <[email protected]>
Wed, 16 Jul 2008 22:19:42 +0000 (18:19 -0400)
committerGreg Sabino Mullane <[email protected]>
Wed, 16 Jul 2008 22:19:42 +0000 (18:19 -0400)
check_postgres.pl

index 40442751e01c654e1aacc4fb583d0612504deb25..57276503d7be52a102d90412f1f1d2a3d3e76125 100755 (executable)
@@ -2944,7 +2944,7 @@ sub check_version {
                if (length $critical) {
                        if (($critfull and $critical ne $full)
                                or (!$critfull and $critical ne $version)) {
-                               do_mrtg({one => 0, msg => $full});
+                               $MRTG and do_mrtg({one => 0, msg => $full});
                                add_critical qq{version $full, but expected $critical};
                                $ok = 0;
                        }
@@ -2952,13 +2952,13 @@ sub check_version {
                elsif (length $warning) {
                        if (($warnfull and $warning ne $full)
                                or (!$warnfull and $warning ne $version)) {
-                               do_mrtg({one => 0, msg => $full});
+                               $MRTG and do_mrtg({one => 0, msg => $full});
                                add_warning qq{version $full, but expected $warning};
                                $ok = 0;
                        }
                }
                if ($ok) {
-                       do_mrtg({one => 1, msg => $full});
+                       $MRTG and do_mrtg({one => 1, msg => $full});
                        add_ok "version $full";
                }
        }