sensu-plugins-ipvs 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2a18f884ead49f279ad7f7ab5d5324c8113f63a8
4
+ data.tar.gz: 5ae870b7aaad1efa37ed1ad851bccffc1f3cde28
5
+ SHA512:
6
+ metadata.gz: 0a471aa97a1031486c96371f4556b9f5c76f98b1154177eef131c86a30ac2324baec4dd934d1b267985f733b075f484f99ebf6e3ef431dc6e4b93483fa5f7df9
7
+ data.tar.gz: a8f670cde373fea0f435044dff80830c2ec5790d124e5e07dae1dbb9b352d459ee3e1434de59de1e715eeb4647cc5579ec69c9f6a2aabfd4f528ae0be66c4b76
data/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
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
+ ## [1.0.1] - 2017-07-12
9
+ ### Fixed
10
+ - fixed rake by including missing require on stdlib English
11
+ - travis rubygems key
12
+
13
+ ## [1.0.0]
14
+ ### Added
15
+ - Ruby 2.3.0 & 2.4.1 testing
16
+
17
+ ### Breaking Changes
18
+ - Dropped Ruby 1.9.3 support
19
+
20
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-ipvs/compare/1.0.1...HEAD
21
+ [1.0.1]: https://github.com/sensu-plugins/sensu-plugins-ipvs/compare/1.0.0...1.0.1
22
+ [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-ipvs/compare/82c8ae8344eaa6df79655fd51e7232932f2abc5e...1.0.0
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 devops@yieldbot.com
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,18 @@
1
+ # sensu-plugins-ipvs
2
+
3
+ [![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-ipvs.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-ipvs)
4
+ [![Gem Version](https://badge.fury.io/rb/sensu-plugins-ipvs.svg)](http://badge.fury.io/rb/sensu-plugins-ipvs)
5
+ [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ipvs/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ipvs)
6
+ [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ipvs/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ipvs)
7
+ [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-ipvs.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-ipvs)
8
+
9
+ ## Functionality
10
+
11
+ ## Files
12
+ * bin/metrics-ipvs
13
+
14
+ ## Usage
15
+
16
+ ## Installation
17
+
18
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # metrics-ipvs
4
+ #
5
+ # DESCRIPTION:
6
+ # This plugin get metrics for ipvs
7
+ #
8
+ # OUTPUT:
9
+ # plain text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: sensu-plugin
16
+ #
17
+ # USAGE:
18
+ # metrics-ipvs
19
+ #
20
+ # NOTES:
21
+ #
22
+ # LICENSE:
23
+ # Marc-Andre Gatien <https://github.com/mag009>
24
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
25
+ # for details.
26
+ #
27
+ require 'sensu-plugin/metric/cli'
28
+ require 'socket'
29
+
30
+ #
31
+ #
32
+ #
33
+ class Graphite < Sensu::Plugin::Metric::CLI::Graphite
34
+ option :scheme,
35
+ description: 'Metric naming scheme, text to prepend to metric',
36
+ short: '-s SCHEME',
37
+ long: '--scheme SCHEME',
38
+ default: "#{Socket.gethostbyname(Socket.gethostname.to_s).first}.ipvs.stats"
39
+
40
+ def run
41
+ unless ipvs_output.nil?
42
+ ipvs = metrics_hash(ipvs_output)
43
+ metrics = %w(TotalConn
44
+ IncomingPkts
45
+ OutgoingPkts
46
+ IncomingBytes
47
+ OutgoingBytes
48
+ Conns_per_sec
49
+ Pkts_per_sec
50
+ IncomingBytes_per_sec
51
+ OutgoingBytes_per_sec)
52
+ c = 0
53
+ metrics.each do |parent|
54
+ output [config[:scheme], parent].join('.'), ipvs[c].hex
55
+ c += 1
56
+ end
57
+ end
58
+ ok
59
+ end
60
+
61
+ def metrics_hash(output)
62
+ ipvs = []
63
+ output.each_line do |line|
64
+ line.chomp!
65
+ next if line.empty? || !(line.split & ipvs).empty?
66
+ ipvs.push(line.gsub(/\s+/, ' ').rstrip.split(' '))
67
+ end
68
+ ipvs.join('.').split('.')
69
+ end
70
+
71
+ def ipvs_output
72
+ return `cat /proc/net/ip_vs_stats | egrep -v "Total|Conns"` if File.exist?('/proc/net/ip_vs_stats')
73
+ end
74
+ end
@@ -0,0 +1,9 @@
1
+ module SensuPluginsIpvs
2
+ module Version
3
+ MAJOR = 1
4
+ MINOR = 0
5
+ PATCH = 1
6
+
7
+ VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ require 'sensu-plugins-ipvs/version'
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sensu-plugins-ipvs
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sensu-Plugins and contributors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-07-12 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.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.5'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.5'
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: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.40.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.40.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.4'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.4'
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: This plugin provides metrics for ipvs based on `/proc/net/ip_vs_stats`.
154
+ email: "<sensu-users@googlegroups.com>"
155
+ executables:
156
+ - metrics-ipvs.rb
157
+ extensions: []
158
+ extra_rdoc_files: []
159
+ files:
160
+ - CHANGELOG.md
161
+ - LICENSE
162
+ - README.md
163
+ - bin/metrics-ipvs.rb
164
+ - lib/sensu-plugins-ipvs.rb
165
+ - lib/sensu-plugins-ipvs/version.rb
166
+ homepage: https://github.com/sensu-plugins/sensu-plugins-ipvs
167
+ licenses:
168
+ - MIT
169
+ metadata:
170
+ maintainer: sensu-plugin
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.0.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.4.5.1
193
+ signing_key:
194
+ specification_version: 4
195
+ summary: Sensu plugins to get stats of ipvs
196
+ test_files: []