sensu-plugins-dovecot 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2d59bed0b3099d0381e6f9338421bb58e0af67d8
4
+ data.tar.gz: a87e37ed51865231fd5723bb073fb4ace54d3596
5
+ SHA512:
6
+ metadata.gz: 190180f8efb6d88665d90dcea6fee5b8b9df8123189df355fa5a3b4f9ad607e438d5c5ebc6f47f1ca9be0a81d851629b3510120155f1e56a4eb0e18c453bf475
7
+ data.tar.gz: 47ada63fcf241845a70a94c5ae7506ab3b17be5552ccc0f4211322bda46d584bc38c14966cd11428d63a62fb8615746ebb38338586e8b09ba643004232733ace
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ #Change Log
2
+ This project adheres to [Semantic Versioning](http://semver.org/).
3
+
4
+ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
+
6
+ ## [Unreleased]
7
+
8
+ ## 0.1.0 - 2017-04-08
9
+ ### Added
10
+ - initial release
11
+
12
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/0.1.0...HEAD
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2017 Sensu-Plugins
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.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ ## sensu-plugins-dovecot
2
+
3
+ [![Build Status](https://travis-ci.org/ushis/sensu-plugins-dovecot.svg?branch=master)](https://travis-ci.org/ushis/sensu-plugins-dovecot)
4
+ [![Gem Version](https://badge.fury.io/rb/sensu-plugins-dovecot.svg)](http://badge.fury.io/rb/sensu-plugins-dovecot)
5
+ [![Code Climate](https://codeclimate.com/github/ushis/sensu-plugins-dovecot/badges/gpa.svg)](https://codeclimate.com/github/ushis/sensu-plugins-dovecot)
6
+ [![Test Coverage](https://codeclimate.com/github/ushis/sensu-plugins-dovecot/badges/coverage.svg)](https://codeclimate.com/github/ushis/sensu-plugins-dovecot)
7
+ [![Dependency Status](https://gemnasium.com/ushis/sensu-plugins-dovecot.svg)](https://gemnasium.com/ushis/sensu-plugins-dovecot)
8
+
9
+ ## Functionality
10
+
11
+ **metrics-dovecot**
12
+
13
+ Collects metrics from the Dovecot Stats API. For more information check out the [Dovecot Wiki](https://wiki2.dovecot.org/Statistics).
14
+
15
+ ## Files
16
+
17
+ * bin/metrics-dovecot.rb
18
+
19
+ ## Installation
20
+
21
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # metics-dovecot
4
+ #
5
+ # DESCRIPTION:
6
+ # Fetch metrics from Dovecot's stats api
7
+ #
8
+ # OUTPUT:
9
+ # metric data
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: sensu-plugin
16
+ #
17
+ # USAGE:
18
+ #
19
+ # NOTES:
20
+ #
21
+ # LICENSE:
22
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
23
+ # for details.
24
+ #
25
+
26
+ require 'sensu-plugin/metric/cli'
27
+ require 'socket'
28
+
29
+ class DovecotMetrics < Sensu::Plugin::Metric::CLI::Graphite
30
+ option :host,
31
+ short: '-h HOST',
32
+ long: '--host HOST',
33
+ description: 'host to connect to',
34
+ default: '127.0.0.1'
35
+
36
+ option :port,
37
+ short: '-p PORT',
38
+ long: '--port PORT',
39
+ description: 'port to connect to',
40
+ proc: proc(&:to_i),
41
+ default: '24242'
42
+
43
+ option :type,
44
+ short: '-t TYPE',
45
+ long: '--type TYPE',
46
+ description: 'dovecot stats type',
47
+ default: 'global'
48
+
49
+ option :scheme,
50
+ short: '-s SCHEME',
51
+ long: '--scheme SCHEME',
52
+ description: 'metric naming scheme',
53
+ default: "#{Socket.gethostname}.dovecot"
54
+
55
+ def run
56
+ sock = TCPSocket.new(config[:host], config[:port])
57
+ sock.write("EXPORT\t#{config[:type]}\n")
58
+ header = sock.gets.chomp.split(/\s+/)
59
+ values = sock.gets.chomp.split(/\s+/)
60
+ sock.close
61
+
62
+ # set timestamp from last_update
63
+ timestamp = values[1].to_i
64
+
65
+ # output everything except reset_timestamp and last_update
66
+ header.zip(values)[2..-1].each do |key, value|
67
+ output "#{config[:scheme]}.#{key}", value, timestamp
68
+ end
69
+
70
+ ok
71
+ end
72
+ end
@@ -0,0 +1,9 @@
1
+ module SensuPluginsDovecot
2
+ module Version
3
+ MAJOR = 0
4
+ MINOR = 1
5
+ PATCH = 0
6
+
7
+ VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ require 'sensu-plugins-dovecot/version'
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sensu-plugins-dovecot
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sensu-Plugins and contributors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-08 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.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: codeclimate-test-reporter
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: github-markup
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.10'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '10.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: redcarpet
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.40.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.40.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: yard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.8'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.8'
153
+ description: Sensu plugin for working with dovecot
154
+ email: "<sensu-users@googlegroups.com>"
155
+ executables:
156
+ - metrics-dovecot.rb
157
+ extensions: []
158
+ extra_rdoc_files: []
159
+ files:
160
+ - CHANGELOG.md
161
+ - LICENSE
162
+ - README.md
163
+ - bin/metrics-dovecot.rb
164
+ - lib/sensu-plugins-dovecot.rb
165
+ - lib/sensu-plugins-dovecot/version.rb
166
+ homepage: https://github.com/ushis/sensu-plugins-dovecot
167
+ licenses:
168
+ - MIT
169
+ metadata:
170
+ maintainer: "@ushis"
171
+ development_status: active
172
+ production_status: unstable - testing recommended
173
+ release_draft: 'false'
174
+ release_prerelease: 'false'
175
+ post_install_message: You can use the embedded Ruby by setting EMBEDDED_RUBY=true
176
+ in /etc/default/sensu
177
+ rdoc_options: []
178
+ require_paths:
179
+ - lib
180
+ required_ruby_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: 2.1.0
185
+ required_rubygems_version: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ requirements: []
191
+ rubyforge_project:
192
+ rubygems_version: 2.5.2
193
+ signing_key:
194
+ specification_version: 4
195
+ summary: Sensu plugins for dovecot
196
+ test_files: []