sensu-plugins-barman-checks 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/bin/check-barman-backup-status.rb +5 -1
- data/lib/sensu-plugins-barman-checks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5873b0cf62fb99c24babb392522bdd9eace30912
|
4
|
+
data.tar.gz: d203ca1f69be98a587f9b9df3ead9718a4e3710f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|