summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorGreg Sabino Mullane2012-01-16 16:49:48 +0000
committerGreg Sabino Mullane2012-01-16 16:49:48 +0000
commit87838ac11686aee893f27ae6b3a81bb571fcea57 (patch)
tree7cd7ddf6976b967353fab84bbcc1ba72ebdb85e8 /check_postgres.pl
parent0f4a6454d5a72a715474481d1f4d14bf185e2dec (diff)
Make sure we do not force cluster ids to an int, else we get exponential notation.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl8
1 files changed, 5 insertions, 3 deletions
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} = '<none>';