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 +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/check-barman-backup-status.rb +8 -0
- 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: b81b372aaffa116262d0e7513a82fff5fca4e1d7
|
4
|
+
data.tar.gz: 38d785b4dad4994c3625e04fa9d150619b73c103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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}"
|