sensu-plugins-oracle 0.9.0 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cec71babfb0c81622f27b11746bbd60b18e2814
4
- data.tar.gz: fd82c99d46959f92ea293edfcbbae0f8d9ccad61
3
+ metadata.gz: 39ff21ac10a90bc257db19f23da70c4ae46c8270
4
+ data.tar.gz: 02bd8c303182f001b28a26bdc10a2d49cab41fd8
5
5
  SHA512:
6
- metadata.gz: 82caa5fc4353042be864b5c29c0c05083d0be1d8bae8bd0aabf9f30393a0a44579fe3db3d5429bbf82c3014ff4a67ce85b92310a6f12f93bf6c197ebca1d3271
7
- data.tar.gz: ce61e8044b6ca00224fe4850c8f3e7624586e5bc4fe8dfca071b1a7ce28960f9503c71c560c1367ff5b88c5fe9b5f80b365100532239e0d27cdb54b3ce4b8eec
6
+ metadata.gz: fcfdab4f0c1836c2b0cf0f18d17a3a1988e8fa54458b6557796f6dbe6fe5a3fe370fa25474c519a309448c4e9e55fe543d7d29a221764403b5efc620c22e1bfb
7
+ data.tar.gz: 1d5d34a7653e687b78fb7343e46c7ca1a26fbae1e294c98066067e1992ddea07d585926171fa5c9a455d687006e724aa6b9743e3f80dde624f1719265ca6f5d5
data/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
- ## 0.9.0 - 2018-11-25
1
+ ## 0.9.1 - 2018-11-25
2
2
 
3
3
  Major:
4
- - Optional limitation of output text size
4
+ - Optional limitation of output text size (alive and query)
5
5
  - Update to sensu-plugin 2.7
6
6
  - Update all gem dependencies
7
7
 
@@ -71,6 +71,12 @@ class CheckOracleAlive < Sensu::Plugin::Check::CLI
71
71
  default: 1,
72
72
  proc: proc { |v| v.to_i.zero? ? 1 : v.to_i }
73
73
 
74
+ option :limit,
75
+ description: 'Limits output size in characters',
76
+ short: '-l SIZE',
77
+ long: '--limit SIZE',
78
+ default: nil
79
+
74
80
  option :verbose,
75
81
  description: 'Shows console log messages',
76
82
  short: '-V',
@@ -112,7 +118,7 @@ class CheckOracleAlive < Sensu::Plugin::Check::CLI
112
118
  if session.alive?
113
119
  ok "Server version: #{session.server_version}"
114
120
  else
115
- critical session.error_message
121
+ critical limit(session.error_message)
116
122
  end
117
123
  end
118
124
 
@@ -135,10 +141,15 @@ class CheckOracleAlive < Sensu::Plugin::Check::CLI
135
141
  ok "All are alive (#{sessions_total}/#{sessions_total})"
136
142
  else
137
143
  message = "#{sessions_total - errors_total}/#{sessions_total} are alive"
138
- critical([message, errors].flatten.join("\n - "))
144
+ critical(limit([message, errors].flatten.join("\n - ")))
139
145
  end
140
146
 
141
147
  rescue => e
142
- unknown e.to_s
148
+ unknown limit(e.to_s)
149
+ end
150
+
151
+ def limit(message)
152
+ return message if config[:limit].nil?
153
+ message[0..config[:limit].to_i]
143
154
  end
144
155
  end
@@ -1,3 +1,3 @@
1
1
  module SensuPluginsOracle
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-oracle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors