[check_postgres] [commit] Fix version action: only output mrtg if in that mode.

check_postgres at bucardo.org check_postgres at bucardo.org
Wed Jul 16 22:25:02 UTC 2008


Committed by Greg Sabino Mullane <greg at endpoint.com>

Fix version action: only output mrtg if in that mode.

---
 check_postgres.pl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/check_postgres.pl b/check_postgres.pl
index 4044275..5727650 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -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";
 		}
 	}
-- 
1.5.5.4



More information about the Check_postgres mailing list