[check_postgres] [commit] MRTG prefers a 0 a second arg, even when it arrives as undef.

check_postgres at bucardo.org check_postgres at bucardo.org
Mon Sep 22 14:14:57 UTC 2008


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

MRTG prefers a 0 a second arg, even when it arrives as undef.
Thanks to Andras Fabian for catching this.

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

diff --git a/check_postgres.pl b/check_postgres.pl
index c85b9d4..3e5749e 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -358,7 +358,7 @@ sub do_mrtg {
 	## Hashref of info to pass out for MRTG or stat
 	my $arg = shift;
 	my $one = $arg->{one} || 0;
-	my $two = $arg->{two} || '';
+	my $two = $arg->{two} || 0;
 	if ($SIMPLE) {
 		$one = $two if (length $two and $two > $one);
 		print "$one\n";
-- 
1.5.5.4



More information about the Check_postgres mailing list