sensu-plugins-logs 1.1.1 → 1.1.2
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 +6 -1
- data/bin/check-log.rb +3 -1
- data/lib/sensu-plugins-logs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65e160084e8cadd546a60d41bf28748123ddd4d8
|
|
4
|
+
data.tar.gz: b04f9938db78c391d666a4e54a405f165634c5a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a975a1d9f454ca8c8614e0182c9cf1fba7325ef0b964d2e4f442c874ff518830e22a33b710ee2b0a398645d7090da3eea7dfee3d9ec70de281927686bc763e68
|
|
7
|
+
data.tar.gz: 262801e029c6aa4c90f8e7440e2a957b90f3b756962090eae8efa420cf46a422b3a16bdfdaab1a5eb3da9ee56211e7264bd0cc91b14f271894b7112885d28100
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ 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
|
+
## [1.1.2] - 2017-05-25
|
|
8
|
+
### Fixed
|
|
9
|
+
- Write the state file atomically by using flock where available (@nlopes)
|
|
10
|
+
|
|
7
11
|
## [1.1.1] - 2017-05-21
|
|
8
12
|
### Changed
|
|
9
13
|
- `check-log.rb`: Fix 'crit' and 'warn' flags being ignored in search_log (@avifried1)
|
|
@@ -44,7 +48,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
|
44
48
|
### Added
|
|
45
49
|
- initial release
|
|
46
50
|
|
|
47
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.
|
|
51
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.2...HEAD
|
|
52
|
+
[1.1.2]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.1...1.1.2
|
|
48
53
|
[1.1.1]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.1.0...1.1.1
|
|
49
54
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-logs/compare/1.0.0...1.1.0
|
|
50
55
|
[0.0.4]:
|
data/bin/check-log.rb
CHANGED
|
@@ -184,6 +184,7 @@ class CheckLog < Sensu::Plugin::Check::CLI
|
|
|
184
184
|
@state_file = File.join(state_dir, File.expand_path(log_file).sub(/^([A-Z]):\//, '\1/'))
|
|
185
185
|
@bytes_to_skip = begin
|
|
186
186
|
File.open(@state_file) do |file|
|
|
187
|
+
file.flock(File::LOCK_SH) unless Gem.win_platform?
|
|
187
188
|
file.readline.to_i
|
|
188
189
|
end
|
|
189
190
|
rescue
|
|
@@ -225,7 +226,8 @@ class CheckLog < Sensu::Plugin::Check::CLI
|
|
|
225
226
|
n_warns = n_matched
|
|
226
227
|
end
|
|
227
228
|
FileUtils.mkdir_p(File.dirname(@state_file))
|
|
228
|
-
File.open(@state_file,
|
|
229
|
+
File.open(@state_file, File::RDWR | File::CREAT, 0644) do |file|
|
|
230
|
+
file.flock(File::LOCK_EX) unless Gem.win_platform?
|
|
229
231
|
file.write(@bytes_to_skip + bytes_read)
|
|
230
232
|
end
|
|
231
233
|
[n_warns, n_crits, accumulative_error]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sensu-plugins-logs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sensu-Plugins and contributors
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-05-
|
|
11
|
+
date: 2017-05-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sensu-plugin
|