sensu-plugins-filenr 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcf10470071c9ec89b91c5c278b9d1b84bbc7bb8
4
- data.tar.gz: 4528342566d18fb348c67d4b04e1f51d9b53724f
3
+ metadata.gz: 5cdb9db7752785e78caea8e9ca72ac3d428bf7a6
4
+ data.tar.gz: 4ec26d8f66c4ad4a80b868917ac27d93a6405173
5
5
  SHA512:
6
- metadata.gz: 2deda34df2cc7679622d9118dac9f22b19cf514168c9359987f2cdda878a209d0d8df154b8c1711ec54d6e2339df706a6b93765014dc574c042192ca0d1abdb3
7
- data.tar.gz: dac0b347942f800d045e12a9ad8dfa6cf302821817eca081d8d01bd32b1e2a632f2ec9606583c7d50f7962075330aa12adf308e787db2b2776e979a44e1d9509
6
+ metadata.gz: 263b87f497f9cd115e3091766e252937d3a798e9cbddf3058e3da035b5052428506f488bd7454fe9e46cf79635bbbb2566d7730cbe9d317d2fc7b62c9bc19a07
7
+ data.tar.gz: a7ea99b563cec45351fb3168e7131ac4d5bcdfe115c1084dfdaa5cd6ab680d374b595c64600f80139ef923b5923e3d791debce71cea8df1d19e40fbfb2f76b80
@@ -1,10 +1,13 @@
1
1
  # Change Log
2
+
2
3
  This project adheres to [Semantic Versioning](http://semver.org/).
3
4
 
4
5
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
6
 
6
- ## Unreleased
7
+ ## [0.0.2] - 2017-08-29
8
+
9
+ * Added metrics support (@bergerx)
7
10
 
8
11
  ## [0.0.1] - 2015-12-28
9
- ### Added
10
- - Initial release
12
+
13
+ * Initial release
data/README.md CHANGED
@@ -2,8 +2,16 @@
2
2
 
3
3
  A sensu plugin to monitor the number of allocated file handles (file descriptors) on a system.
4
4
 
5
+ ## Files
6
+
7
+ * bin/check-filenr.rb
8
+ * bin/metrics-filenr.rb
9
+
10
+
5
11
  ## Usage
6
12
 
13
+ ### check-filenr.rb
14
+
7
15
  The plugin accepts the following command line options:
8
16
 
9
17
  ```
@@ -14,5 +22,14 @@ Usage: check-filenr.rb (options)
14
22
 
15
23
  The default critical value is set to the fs.file-max (/proc/sys/fs/file-max), whereas the warning is set to 90% of the file-max value.
16
24
 
25
+ ### metrics-filenr.rb
26
+
27
+ ```
28
+ Usage: metrics-filenr.rb (options)
29
+ -s, --scheme SCHEME Metric naming scheme, text to prepend to queue_name.metric
30
+ ```
31
+
32
+
17
33
  ## Author
34
+
18
35
  Matteo Cerutti - <matteo.cerutti@hotmail.co.uk>
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # metrics-filenr
4
+ #
5
+ # DESCRIPTION:
6
+ # This plugin collects maximum number of file handles and current usage
7
+ # for the entire system.
8
+ #
9
+ # OUTPUT:
10
+ # metrics data in graphite
11
+ #
12
+ # PLATFORMS:
13
+ # Linux
14
+ #
15
+ # DEPENDENCIES:
16
+ # gem: sensu-plugin
17
+ #
18
+ # USAGE:
19
+ # metrics-filenr.rb
20
+ #
21
+ #
22
+ # LICENCE:
23
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
24
+ # for details.
25
+ #
26
+
27
+ require 'sensu-plugin/metric/cli'
28
+ require 'socket'
29
+
30
+ #
31
+ # File Handle Metrics
32
+ #
33
+ class MetricsFileNr < Sensu::Plugin::Metric::CLI::Graphite
34
+ option :scheme,
35
+ description: 'Metric naming scheme, text to prepend to queue.metric',
36
+ short: '-s SCHEME',
37
+ long: '--scheme SCHEME',
38
+ default: "#{Socket.gethostname}.file_nr"
39
+
40
+ def run
41
+ used, unused, max = File.read('/proc/sys/fs/file-nr').split(' ').map(&:to_i)
42
+
43
+ output("#{config[:scheme]}.used", used)
44
+ output("#{config[:scheme]}.unused", unused)
45
+ output("#{config[:scheme]}.max", max)
46
+
47
+ ok
48
+ end
49
+ end
@@ -2,7 +2,7 @@ module SensuPluginsFileNr
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-filenr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Cerutti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-04 00:00:00.000000000 Z
11
+ date: 2017-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -29,6 +29,7 @@ description: This plugin provides facilities for monitoring the number of alloca
29
29
  email: "<matteo.cerutti@hotmail.co.uk>"
30
30
  executables:
31
31
  - check-filenr.rb
32
+ - metrics-filenr.rb
32
33
  extensions: []
33
34
  extra_rdoc_files: []
34
35
  files:
@@ -36,6 +37,7 @@ files:
36
37
  - LICENSE
37
38
  - README.md
38
39
  - bin/check-filenr.rb
40
+ - bin/metrics-filenr.rb
39
41
  - lib/sensu-plugins-filenr.rb
40
42
  - lib/sensu-plugins-filenr/version.rb
41
43
  homepage: https://github.com/m4ce/sensu-plugins-filenr
@@ -64,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
66
  version: '0'
65
67
  requirements: []
66
68
  rubyforge_project:
67
- rubygems_version: 2.4.5.1
69
+ rubygems_version: 2.6.8
68
70
  signing_key:
69
71
  specification_version: 4
70
72
  summary: Sensu plugins for monitoring the number of allocated file handles