sensu-plugins-pdns 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4336ea124eea0e92a7b79307d7a72a637e4b90a3
4
+ data.tar.gz: 40b408ca1b9ece4e9f1017506f0ce3c1c5f2f2f8
5
+ SHA512:
6
+ metadata.gz: 8ca7508ffacaac0acd09ae03fa2a9bd6bef0d60f8976ed8910c2b08ec4be4053b00dbda5907e803872935c3ec8a1b3c0e2a67bcd84cb62cf163fe52f83d59960
7
+ data.tar.gz: 7e49054bfc34161922c2fc22f2e2d61297ebed9e2a7c6fc76f0f98ac345e9e7b3dc20896b0a7f2d681e549646195c572c05797b77fe23c25ae227c9b67d1c57f
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+ This project adheres to [Semantic Versioning](http://semver.org/).
3
+
4
+ ## [Unreleased]
5
+
6
+ ## 0.0.1 - 2017-08-27
7
+ ### Added
8
+ - Initial release
9
+
10
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-pdns/compare/0.0.1...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,22 @@
1
+ ## Sensu-plugins-pdns
2
+
3
+ [![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-pdns.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-pdns)
4
+ [![Gem Version](https://badge.fury.io/rb/sensu-plugins-pdns.svg)](http://badge.fury.io/rb/sensu-plugins-pdns)
5
+ [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-pdns.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-pdns)
6
+
7
+ ## Functionality
8
+ metrics-pdns.rb - Query PowerDNS for statistics. Record stats as metrics and output in Graphite plaintext format
9
+
10
+ Details:
11
+ [PowerDNS statistics](https://doc.powerdns.com/recursor/metrics.html)
12
+
13
+ ## Files
14
+ * bin/metrics-pdns.rb
15
+
16
+ ## Usage
17
+
18
+ ## Installation
19
+
20
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
21
+
22
+ ## Notes
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # metrics-pdns.rb
4
+ #
5
+ # DESCRIPTION:
6
+ # Extract PowerDNS recursor statistics and send them in Graphite plaintext format
7
+ #
8
+ # OUTPUT:
9
+ # plain text metric data
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: sensu-plugin
16
+ #
17
+ # USAGE:
18
+ # metrics-pdns.rb
19
+ #
20
+ # NOTES:
21
+ # Requires sudo permissions for the sensu user to run rec_control
22
+ #
23
+ # LICENSE:
24
+ # <Hammad Shah> <haashah@gmail.com>
25
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
26
+ # for details.
27
+ #
28
+
29
+ require 'sensu-plugin'
30
+ require 'sensu-plugin/metric/cli'
31
+ require 'English'
32
+ require 'socket'
33
+
34
+ class PdnsGraphite < Sensu::Plugin::Metric::CLI::Graphite
35
+ option :scheme,
36
+ description: 'Metric naming scheme, text to prepend to metric',
37
+ long: '--scheme SCHEME',
38
+ default: "#{Socket.gethostname}.pdns"
39
+
40
+ def run
41
+ metrics = `sudo rec_control get-all`.split("\n")
42
+ if $CHILD_STATUS.exitstatus > 0
43
+ critical 'Failed to dump pdns statistics. Check that the pdns process is running!'
44
+ end
45
+ metrics.each do |metric|
46
+ (key, value) = metric.split("\t")
47
+ output([config[:scheme], key].join('.'), value)
48
+ end
49
+ ok
50
+ end
51
+ end
@@ -0,0 +1 @@
1
+ require 'sensu-plugins-pdns/version'
@@ -0,0 +1,9 @@
1
+ module SensuPluginsPdns
2
+ module Version
3
+ MAJOR = 0
4
+ MINOR = 0
5
+ PATCH = 1
6
+
7
+ VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sensu-plugins-pdns
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Hammad Shah
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-08-27 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'
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'
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.15'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.15'
41
+ - !ruby/object:Gem::Dependency
42
+ name: github-markup
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.10'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.10'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '12.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '12.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: redcarpet
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.49.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.49.0
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.4'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.4'
125
+ - !ruby/object:Gem::Dependency
126
+ name: yard
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.8'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.8'
139
+ description: |-
140
+ Sensu plugin for monitoring + metrics collection of
141
+ PowerDNS recursor statistics
142
+ email:
143
+ - haashah@gmail.com
144
+ executables:
145
+ - metrics-pdns.rb
146
+ extensions: []
147
+ extra_rdoc_files: []
148
+ files:
149
+ - CHANGELOG.md
150
+ - LICENSE
151
+ - README.md
152
+ - bin/metrics-pdns.rb
153
+ - lib/sensu-plugins-pdns.rb
154
+ - lib/sensu-plugins-pdns/version.rb
155
+ homepage: https://github.com/sensu-plugins/sensu-plugins-pdns
156
+ licenses:
157
+ - MIT
158
+ metadata:
159
+ maintainer: "@haashah"
160
+ development_status: active
161
+ production_status: unstable - testing recommended
162
+ post_install_message:
163
+ rdoc_options: []
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: 2.0.0
171
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 2.6.6
179
+ signing_key:
180
+ specification_version: 4
181
+ summary: Sensu Plugins for PowerDNS metrics
182
+ test_files: []