sensu-plugins-typeperf 0.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: 7f78a5d7ca24224ba9303d3f4b1675ffc2987a20
4
+ data.tar.gz: 869f4be0b719e3987cc17a47a9937ed11c249aec
5
+ SHA512:
6
+ metadata.gz: 4841ff7fd41986b166d0077236886abd3d997016a59af48b1a7a205e2e41de7b1fd940f20b2ba39a79c93cc0b82a7ec1f7cceea6380c9b613e2df3b2b0985a83
7
+ data.tar.gz: 91918997845b470a9aee4053e728c7c1c4639d79715e845786189e8d54726b75edd143c9df3a100c2e9d589adbd3e8404e0280bd1b0aafc8cfdb2c0048e5aff1
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
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/)
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 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,20 @@
1
+ ## Sensu-Plugins-typeperf
2
+
3
+ [ ![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-typeperf.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-typeperf)
4
+ [![Gem Version](https://badge.fury.io/rb/sensu-plugins-typeperf.svg)](http://badge.fury.io/rb/sensu-plugins-typeperf)
5
+ [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-typeperf/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-typeperf)
6
+ [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-typeperf/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-typeperf)
7
+ [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-typeperf.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-typeperf)
8
+
9
+ ## Functionality
10
+
11
+ ## Files
12
+ * bin/metrics-typeperf.rb
13
+
14
+ ## Usage
15
+
16
+ ## Installation
17
+
18
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
19
+
20
+ ## Notes
@@ -0,0 +1,55 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # metrics-typeperf.rb
4
+ #
5
+ # DESCRIPTION:
6
+ #
7
+ # OUTPUT:
8
+ # metric data
9
+ #
10
+ # PLATFORMS:
11
+ # windows
12
+ #
13
+ # DEPENDENCIES:
14
+ # gem: sensu-plugin
15
+ #
16
+ # USAGE:
17
+ #
18
+ # NOTES:
19
+ # Tested on Windows 2012RC2.
20
+ #
21
+ # LICENSE:
22
+ # Inspired by the work of: Yohei Kawahara <inokara@gmail.com>
23
+ # Original Repo: https://github.com/sensu-plugins/sensu-plugins-iis
24
+ # Author: Martin Cozzi <martin@marana.in>
25
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
26
+ # for details.
27
+ #
28
+
29
+ require 'sensu-plugin/metric/cli'
30
+ require 'socket'
31
+
32
+ class Typeperf < Sensu::Plugin::Metric::CLI::Graphite
33
+ option :metric,
34
+ description: 'Name of the typeperf metric to record',
35
+ long: '--metric METRIC'
36
+
37
+ option :scheme,
38
+ description: 'Metric naming scheme, text to prepend to .$parent.$child',
39
+ long: '--scheme SCHEME',
40
+ default: "#{Socket.gethostname}"
41
+
42
+ option :occurences,
43
+ long: '--occurences OCCURENCES',
44
+ short: '-o occurences',
45
+ default: 2
46
+
47
+ def run
48
+ io = IO.popen("typeperf -sc #{config[:occurences]} \"#{config[:metric]}\"")
49
+ occurences = config[:occurences].to_i
50
+ get_requests = io.readlines[occurences + 1].split(',')[1].delete('"').to_f
51
+
52
+ output config[:scheme], get_requests
53
+ ok
54
+ end
55
+ end
@@ -0,0 +1 @@
1
+ require 'sensu-plugins-typeperf/version'
@@ -0,0 +1,9 @@
1
+ module SensuPluginsTypeperf
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,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sensu-plugins-typeperf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sensu-Plugins and contributors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-18 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: Sensu plugins for Microsoft IIS
154
+ email: <sensu-users@googlegroups.com>
155
+ executables:
156
+ - metrics-typeperf.rb
157
+ extensions: []
158
+ extra_rdoc_files: []
159
+ files:
160
+ - CHANGELOG.md
161
+ - LICENSE
162
+ - README.md
163
+ - bin/metrics-typeperf.rb
164
+ - lib/sensu-plugins-typeperf.rb
165
+ - lib/sensu-plugins-typeperf/version.rb
166
+ homepage: https://github.com/marana-inc/sensu-plugins-typeperf
167
+ licenses:
168
+ - MIT
169
+ metadata:
170
+ maintainer: marana-inc
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: 1.9.3
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.2.2
193
+ signing_key:
194
+ specification_version: 4
195
+ summary: Sensu plugins for Microsoft typeperf
196
+ test_files: []