sensu-plugins-ubiquiti 1.0.0 → 1.1.0

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: 055416821c4ca116d381c700af7491647c443524
4
- data.tar.gz: 2112252bfdc21a0b006c4d68369cf47925322202
3
+ metadata.gz: 2c8dff74218d341b3647f6b212861a9d11fbd4cf
4
+ data.tar.gz: c7a871cf719ea6043e83a9bb26dcd56fcf27447c
5
5
  SHA512:
6
- metadata.gz: 32889c62501ac21086e2c60b37475f1b67f5469352a04444825c379f6ec011d05dc69b8f0b3ef6c9b34d3ab952a6ea61db0cf62136c0857d653d9035d95e75af
7
- data.tar.gz: 7081a3acf99e062d8c6c649b05b21b7bbb434f1b05f81edb6ae9140a2f7fb8d9ab4a7ad70908f7315ae12278e7e8ecdaebd633da539195a9b2f9ec57d8b2bf2c
6
+ metadata.gz: c600f7dab2651753dbc147ebb698535b3b6c1ad72bf53ef63f25d5f199fe1962a7406d14fa699dc347f1ae1308638092a6897522b63dd66361e82c578855190f
7
+ data.tar.gz: efb309d339bbddb337346d1e7594a8fb4accff68eab35f848728fae3e894829684e95843851e8994ae47e2670aa026ee181f73f9f76a1fdfbd27f7bf2bbbbb56
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.1.0] - 2016-10-26
9
+ ### Added
10
+ - Add `site_id` option for collecting metrics from a non-default site
11
+
8
12
  ## [1.0.0] - 2016-10-21
9
13
 
10
14
  Note: this release changes the check parameters due to removing the shell out to `unifi-get-stats.py`.
@@ -24,5 +28,6 @@ Note: this release changes the check parameters due to removing the shell out to
24
28
  ### Added
25
29
  - initial release of this sensu plugin repo
26
30
 
27
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-ubiquiti/compare/1.0.0...HEAD
31
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-ubiquiti/compare/1.1.0...HEAD
32
+ [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-ubiquiti/compare/1.0.0...1.1.0
28
33
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-ubiquiti/compare/0.0.1...1.0.0
@@ -15,10 +15,15 @@
15
15
  # gem: sensu-plugin
16
16
  #
17
17
  # USAGE:
18
+ # collect metrics from the default site:
18
19
  # metrics-unifi.rb -c unifi.int.mycompany.co -u admin -p unifipassword
19
20
  #
20
- # NOTES:
21
+ # collect metrics from site 'mywifi':
22
+ # metrics-unifi.rb -c unifi.int.mycompany.co -u admin -p unifipassword -S mywifi
21
23
  #
24
+ # NOTES:
25
+ # Specify the site ID if using a non-default site. The site ID can be obtained from the
26
+ # web UI e.g. /manage/s/<site>/dashboard
22
27
  #
23
28
  # LICENSE:
24
29
  # Copyright Eric Heydrick <eheydrick@gmail.com>
@@ -39,13 +44,13 @@ class UnifiMetrics < Sensu::Plugin::Metric::CLI::Graphite
39
44
  default: "#{Socket.gethostname}.unifi"
40
45
 
41
46
  option :controller,
42
- description: 'Unifi AP controller hostname',
47
+ description: 'Unifi AP controller hostname (default: unifi)',
43
48
  short: '-c HOSTNAME',
44
49
  long: '--controller HOSTNAME',
45
50
  default: 'unifi'
46
51
 
47
52
  option :username,
48
- description: 'Username',
53
+ description: 'Username (default: admin)',
49
54
  short: '-u USERNAME',
50
55
  long: '--username USERNAME',
51
56
  default: 'admin'
@@ -57,19 +62,25 @@ class UnifiMetrics < Sensu::Plugin::Metric::CLI::Graphite
57
62
  required: true
58
63
 
59
64
  option :port,
60
- description: 'Port',
65
+ description: 'Port (default: 8443)',
61
66
  short: '-P PORT',
62
67
  long: '--port PORT',
63
68
  default: 8443
64
69
 
65
70
  option :unifi_version,
66
- description: 'Unifi API version',
71
+ description: 'Unifi API version (default: v4)',
67
72
  short: '-V VERSION',
68
73
  long: '--unifi-version VERSION',
69
74
  default: 'v4'
70
75
 
76
+ option :site_id,
77
+ description: 'Site ID (default: default)',
78
+ short: '-S SITE ID',
79
+ long: '--site-id SITE ID',
80
+ default: 'default'
81
+
71
82
  def unifi_stats
72
- unifi = Unifi::Api::Controller.new(config[:controller], config[:username], config[:password], config[:port], config[:unifi_version])
83
+ unifi = Unifi::Api::Controller.new(config[:controller], config[:username], config[:password], config[:port], config[:unifi_version], config[:site_id])
73
84
  aps = unifi.get_aps
74
85
 
75
86
  metrics = Hash.new(0)
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsUbiquiti
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-ubiquiti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin