From: Greg Sabino Mullane Date: Mon, 16 Jan 2012 16:49:48 +0000 (-0500) Subject: Make sure we do not force cluster ids to an int, else we get exponential notation. X-Git-Tag: 2.19.0~11 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=87838ac11686aee893f27ae6b3a81bb571fcea57;p=check_postgres.git Make sure we do not force cluster ids to an int, else we get exponential notation. --- diff --git a/check_postgres.pl b/check_postgres.pl index 0b5ede8df..a946c972f 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2879,8 +2879,10 @@ sub validate_range { ) { ndie msg('range-warnbig'); } - $warning = int $warning if length $warning; - $critical = int $critical if length $critical; + if ($type !~ /string/) { + $warning = int $warning if length $warning; + $critical = int $critical if length $critical; + } } elsif ('restringex' eq $type) { if (! length $critical and ! length $warning) { @@ -3798,7 +3800,7 @@ sub check_cluster_id { ## Example: ## check_postgres_cluster_id --critical="5633695740047915125" - my ($warning, $critical) = validate_range({type => 'integer', onlyone => 1}); + my ($warning, $critical) = validate_range({type => 'integer_string', onlyone => 1}); $db->{host} = '';