sensu-plugins-docker-checks 0.0.1
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 +7 -0
- data/CHANGELOG.md +10 -0
- data/LICENSE +23 -0
- data/README.md +15 -0
- data/bin/check-docker-container.rb +44 -0
- data/lib/sensu-plugins-docker-checks.rb +1 -0
- data/lib/sensu-plugins-docker-checks/version.rb +9 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e66c6a89bc7a2e4a3a8c2ee1e945ce87b1b760cf
|
4
|
+
data.tar.gz: 464bbab9b876eee82e4866bf64bf935da4bf6031
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cda400d576c3e1acf97870d749a3e65dff128d17505641bd33226ad339cf0e65e2b9a4c9290c0b90ba0a45ee538665bb4594e54dc7ee7c0ab7bf94ef0bf2ebf7
|
7
|
+
data.tar.gz: 2645e419baed0ded27ef9df9d1046322603e9b66ee27964077e5b4e14fec293c36fba705dea57c7dd80aa21b4d66345b87756c8db2c87df9c6922cd70579c7e3
|
data/CHANGELOG.md
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Copyright (c) 2015 Matteo Cerutti
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
data/README.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Sensu plugin for monitoring Docker containers
|
2
|
+
|
3
|
+
A sensu plugin to monitor Docker containers.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
The plugin accepts the following command line options:
|
8
|
+
|
9
|
+
```
|
10
|
+
Usage: check-docker-container.rb (options)
|
11
|
+
--url <URL> Docker daemon URL (default: unix:///var/run/docker.sock)
|
12
|
+
```
|
13
|
+
|
14
|
+
## Author
|
15
|
+
Matteo Cerutti - <matteo.cerutti@hotmail.co.uk>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# check-docker-container.rb
|
4
|
+
#
|
5
|
+
# Author: Matteo Cerutti <matteo.cerutti@hotmail.co.uk>
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'sensu-plugin/check/cli'
|
9
|
+
require 'docker'
|
10
|
+
|
11
|
+
class CheckDockerContainer < Sensu::Plugin::Check::CLI
|
12
|
+
banner "Usage: #{$0} <options> <containerId>"
|
13
|
+
|
14
|
+
option :url,
|
15
|
+
:description => "Docker daemon URL (default: unix:///var/run/docker.sock)",
|
16
|
+
:long => "--url <URL>",
|
17
|
+
:default => "unix:///var/run/docker.sock"
|
18
|
+
|
19
|
+
def initialize()
|
20
|
+
super
|
21
|
+
|
22
|
+
# validate arguments
|
23
|
+
raise "Missing container ID" unless ARGV.length > 0
|
24
|
+
@container_id = ARGV.first
|
25
|
+
|
26
|
+
Docker.url = config[:url]
|
27
|
+
end
|
28
|
+
|
29
|
+
def run()
|
30
|
+
begin
|
31
|
+
container = Docker::Container.get(@container_id)
|
32
|
+
|
33
|
+
if container.info['State']['Running']
|
34
|
+
ok("Container ID '#{@container_id}' is running")
|
35
|
+
else
|
36
|
+
critical("Container ID '#{@container_id}' is not running")
|
37
|
+
end
|
38
|
+
rescue Docker::Error::NotFoundError
|
39
|
+
critical("Container ID '#{id}' not running on host (Not found)")
|
40
|
+
rescue
|
41
|
+
unknown("Failed to look up container ID '#{@container_id}' (#{$!})")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'sensu-plugins-docker-checks/version'
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sensu-plugins-docker-checks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matteo Cerutti
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sensu-plugin
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: docker-api
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.24.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.24.0
|
41
|
+
description: This plugin provides facilities for monitoring Docker containers
|
42
|
+
email: "<matteo.cerutti@hotmail.co.uk>"
|
43
|
+
executables:
|
44
|
+
- check-docker-container.rb
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- CHANGELOG.md
|
49
|
+
- LICENSE
|
50
|
+
- README.md
|
51
|
+
- bin/check-docker-container.rb
|
52
|
+
- lib/sensu-plugins-docker-checks.rb
|
53
|
+
- lib/sensu-plugins-docker-checks/version.rb
|
54
|
+
homepage: https://github.com/m4ce/sensu-plugins-docker-checks
|
55
|
+
licenses:
|
56
|
+
- MIT
|
57
|
+
metadata:
|
58
|
+
maintainer: "@m4ce"
|
59
|
+
development_status: active
|
60
|
+
production_status: stable
|
61
|
+
release_draft: 'false'
|
62
|
+
release_prerelease: 'false'
|
63
|
+
post_install_message: You can use the embedded Ruby by setting EMBEDDED_RUBY=true
|
64
|
+
in /etc/default/sensu
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 1.9.3
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.4.5.1
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: Sensu plugins for monitoring docker-checks NTP
|
84
|
+
test_files: []
|