sensu-plugins-barman-checks 0.0.3 → 0.0.4

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: 03bbb0aaed34536c05481b43bd9c268e30d9b615
4
- data.tar.gz: db700583a86523ade199db6b5409c4fb4a15b7b0
3
+ metadata.gz: 5873b0cf62fb99c24babb392522bdd9eace30912
4
+ data.tar.gz: d203ca1f69be98a587f9b9df3ead9718a4e3710f
5
5
  SHA512:
6
- metadata.gz: 59f41557878938ea94caf7c6cc05ebf3fb503d3326ca5c7df9e8ad1c3f483353d81548cd77f3fdb05c523d997c7320c203c96004d9e164761cd8cf9030cb8d84
7
- data.tar.gz: a6a370736737dd56b320f43207d375e83f0da66274c5f1dfa1ba9defd2d1ff8f68fa27a146fcb9b4892a90f6aea8077bb4335c6531b7bc78aaf918c4b464623b
6
+ metadata.gz: 6db9eb0c8feac9a3447d8c9b758f0528963531b6c02558cc34b7e34009453ec2e972aba01eabcd99cc457ca2444d973cf2eb1d11db42970006da766b16163ec9
7
+ data.tar.gz: e1f0154a73fccd4f3f85e5777a274576582ee04f28d96392f285da9a6dc09e6278710480fece0f37f05937fa5fb8ec94b33ec103e527efea275d4f1135e60d44
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+
8
+ ## 0.0.4 - 2016-11-30
9
+ ### Fixed
10
+ - Exit server loop if number of backups is 0
11
+
7
12
  ## 0.0.3 - 2016-11-30
8
13
  ### Fixed
9
14
  - The plugin now actually works
@@ -108,7 +108,10 @@ class CheckBarmanBackupStatus < Sensu::Plugin::Check::CLI
108
108
 
109
109
  backups = `sudo barman list-backup #{server} | awk '{print $2}'`.split(/\n/).map(&:strip)
110
110
 
111
- if backups.count < config[:min_backups].to_i
111
+ if backups.count < config[:min_backups].to_i && backups.count == 0
112
+ @crit << "Minimum backups not met for server #{server}. Count is #{backups.count}"
113
+ next
114
+ elsif backups.count < config[:min_backups].to_i && backups.count > 0
112
115
  @crit << "Minimum backups not met for server #{server}. Count is #{backups.count}"
113
116
  else
114
117
  puts "Number of backups for server #{server}: #{backups.count}"
@@ -118,6 +121,7 @@ class CheckBarmanBackupStatus < Sensu::Plugin::Check::CLI
118
121
  status = `sudo barman show-backup #{server} #{backup} | grep Status | awk '{print $NF}'`.strip
119
122
  unless status.casecmp('done') || status.casecmp('started')
120
123
  @crit << "Backup for server #{server} with ID #{backup} is in error state: #{status.downcase}"
124
+ next
121
125
  end
122
126
  end
123
127
 
@@ -2,7 +2,7 @@ module SensuPluginsBarmanChecks
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 3
5
+ PATCH = 4
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Brimhall