sensu-plugins-barman-checks 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5873b0cf62fb99c24babb392522bdd9eace30912
4
- data.tar.gz: d203ca1f69be98a587f9b9df3ead9718a4e3710f
3
+ metadata.gz: b81b372aaffa116262d0e7513a82fff5fca4e1d7
4
+ data.tar.gz: 38d785b4dad4994c3625e04fa9d150619b73c103
5
5
  SHA512:
6
- metadata.gz: 6db9eb0c8feac9a3447d8c9b758f0528963531b6c02558cc34b7e34009453ec2e972aba01eabcd99cc457ca2444d973cf2eb1d11db42970006da766b16163ec9
7
- data.tar.gz: e1f0154a73fccd4f3f85e5777a274576582ee04f28d96392f285da9a6dc09e6278710480fece0f37f05937fa5fb8ec94b33ec103e527efea275d4f1135e60d44
6
+ metadata.gz: 87a4910384d302ebebc37327a42a90d2dfdd66512d4e24168037caf93cffb60091ee67d930bf616a9ce414b89e8b36a3d5cafcaee636b7df724ac344022b09e8
7
+ data.tar.gz: a2d87b0dd6707eb00f1a04a338cf87bf38d0fd0a4b50d1a2657617eafcc72bd70e4bbbf92ee0734de74f41468c1ec3c7f42c10cd8eebc2680f529c1af6401593
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## 0.0.5 - 2016-11-30
9
+ ### Fixed
10
+ - Fix race condition caused by barman cli where status for a backup is not available if it is in progress or failed.
11
+
8
12
  ## 0.0.4 - 2016-11-30
9
13
  ### Fixed
10
14
  - Exit server loop if number of backups is 0
@@ -118,6 +118,14 @@ class CheckBarmanBackupStatus < Sensu::Plugin::Check::CLI
118
118
  end
119
119
 
120
120
  backups.each do |backup|
121
+ stupid_barman_cli = `sudo barman list-backup #{server} | grep #{backup} | awk '{print $4}'`.strip
122
+ if stupid_barman_cli.casecmp('started')
123
+ puts "Backup ID #{backup} for server #{server} is in progress. Skipping further checking on it"
124
+ next
125
+ elsif stupid_barman_cli.casecmp('failed')
126
+ @crit << "Backup ID #{backup} for server #{server} is in failure state: #{stupid_barman_cli}"
127
+ next
128
+ end
121
129
  status = `sudo barman show-backup #{server} #{backup} | grep Status | awk '{print $NF}'`.strip
122
130
  unless status.casecmp('done') || status.casecmp('started')
123
131
  @crit << "Backup for server #{server} with ID #{backup} is in error state: #{status.downcase}"
@@ -2,7 +2,7 @@ module SensuPluginsBarmanChecks
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-barman-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Brimhall