added fix for bug in ZooKeeper returning negative min latency stat
289f40ac
Hari Sekhon
committed
1 changed file
check_zookeeper.pl
/check_zookeeper.pl-1+11
/check_zookeeper.pl
Add comment 26
Add comment 27 Tested on ZooKeeper 3.4.5 and 3.4.6 Apache, Cloudera, Hortonworks and MapR. Requires ZooKeeper 3.4 onwards due to isro and mntr 4lw checks";
Add comment 28
Add comment 29 Minus  $VERSION = "0.8";
Add comment 29 Plus  $VERSION = "0.8.1";
Add comment 30
Add comment 31 use strict;
Add comment 32 use warnings;
Add comment 246 $mntr{$_} = "N/A";
Add comment 247 next;
Add comment 248 }
Add comment 249 Plus   } elsif($_ eq "zk_min_latency"){
Add comment 250 Plus   # this can appear, handle with warning below
Add comment 251 Plus   #$mntr{"zk_min_latency"} = -681;
Add comment 252 Plus   if($mntr{$_} < 0){
Add comment 253 Plus   warning;
Add comment 254 Plus   $msg .= "min latency < 0! (run 'srst' command on ZooKeeper to reset stats to fix). ";
Add comment 255 Plus   # invalid reset to N/A
Add comment 256 Plus   $mntr{$_} = "N/A";
Add comment 257 Plus   next;
Add comment 258 Plus   }
Add comment 249 259 }
Add comment 250 260 $mntr{$_} =~ /^\d+$/ or quit "UNKNOWN", "invalid value found for mntr $_ '$mntr{$_}'";
Add comment 251 261 }