X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=gnt-monitor;h=3b43a9555dabcc9a33e5ce8b27aaa9a3ddb84d65;hb=fa388da7b6c875106b4f67ea8183bb3a0592ede3;hp=368d36236688f7b7b2157d67e5394615f0191b96;hpb=868e3a351dc870988ce9f35ebbb288667b6f7d3d;p=gnt-info diff --git a/gnt-monitor b/gnt-monitor index 368d362..3b43a95 100755 --- a/gnt-monitor +++ b/gnt-monitor @@ -6,7 +6,7 @@ use POSIX; use Time::HiRes qw(time sleep); my $DEBUG = $ENV{DEBUG} || 0; -my $INFLUX = $ENV{INFLUX} || 'http://10.80.3.89:8086/write?db=gnt'; +my $INFLUX = $ENV{INFLUX} || 'http://10.80.3.89:8086/write?consistency=any&db=gnt'; my $INTERVAL = $ENV{INTERVAL} || 1; my $DC = $ENV{DC}; my $RACK = $ENV{RACK}; @@ -184,13 +184,13 @@ foreach my $instance ( keys %$stat ) { close($fh); -if ( system( 'curl', '-XPOST', $INFLUX, '--data-binary', '@/dev/shm/gnt-monitor.influx' ) == 0 ) { +if ( system( 'curl', '-s', '-XPOST', $INFLUX, '--data-binary', '@/dev/shm/gnt-monitor.influx' ) == 0 ) { } else { rename '/dev/shm/gnt-monitor.influx', '/dev/shm/gnt-monitor.influx.bug.' . scalar glob '/dev/shm/gnt-monitor.influx.bug.*'; warn "curl failed: $? $!"; } my $dt = time() - $begin_t; -sleep $INTERVAL - $dt if $dt > 0 && $dt > $INTERVAL; +sleep $INTERVAL - $dt if $dt > 0 && $dt < $INTERVAL; } #/while