sensu-plugins-odoo 0.0.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 +7 -0
- data/CHANGELOG.md +9 -0
- data/LICENSE +21 -0
- data/README.md +10 -0
- data/bin/metric-odoo-filestore-objectcount.rb +93 -0
- data/lib/sensu-plugins-odoo.rb +1 -0
- data/lib/sensu-plugins-odoo/version.rb +9 -0
- metadata +227 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 19f8a3cd19b69c9b28233289fe92b9a1eaa8621d
|
4
|
+
data.tar.gz: 9ff3d5cd6806635a7c8bb747696ca7b8e7f02165
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0b5c93cb70ebd3f835351509051f6e2a95a21b0b0e458b3b70fd8b94d2b4289983835fb0a7512dc1f4fc9f1d254966772ffaf2b6fd17916d175a3a2cb3125aa2
|
7
|
+
data.tar.gz: 5d233580297d2dc9f46ca65986d069f55def0bc9eb9de85dad4193ea227705378579c533f4e15208daaf7fd0f157c0111abfbcd3f849bef00dcb332104053b1c
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,9 @@
|
|
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
|
+
## 0.0.1 - 2017-02-23
|
7
|
+
### Added
|
8
|
+
- initial release
|
9
|
+
- metric-odoo-filestore-objectcount
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Blagovest Petrov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# metric-odoo-filestore-objectcount
|
4
|
+
#
|
5
|
+
# DESCRIPTION:
|
6
|
+
#
|
7
|
+
# This plugin collects ir_attachment objects count netrics from Odoo database
|
8
|
+
#
|
9
|
+
# OUTPUT:
|
10
|
+
# metric data
|
11
|
+
#
|
12
|
+
# PLATFORMS:
|
13
|
+
# Linux
|
14
|
+
#
|
15
|
+
# DEPENDENCIES:
|
16
|
+
# gem: sensu-plugin
|
17
|
+
# gem: pg
|
18
|
+
#
|
19
|
+
# USAGE:
|
20
|
+
# ./metric-odoo-filestore-objectcount.rb -u db_user -p db_pass -h db_host -d db
|
21
|
+
#
|
22
|
+
# NOTES:
|
23
|
+
#
|
24
|
+
# LICENSE:
|
25
|
+
# Copyright (c) 2017 Blagovest Petrov <blagovest@petrovs.info>
|
26
|
+
# Released under the same terms as Sensu (the MIT license); see LICENSE
|
27
|
+
# for details.
|
28
|
+
#
|
29
|
+
|
30
|
+
require 'sensu-plugin/metric/cli'
|
31
|
+
require 'pg'
|
32
|
+
require 'socket'
|
33
|
+
|
34
|
+
class OdooIr_AttachmentMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
35
|
+
option :user,
|
36
|
+
description: 'Postgres User',
|
37
|
+
short: '-u USER',
|
38
|
+
long: '--user USER'
|
39
|
+
|
40
|
+
option :password,
|
41
|
+
description: 'Postgres Password',
|
42
|
+
short: '-p PASS',
|
43
|
+
long: '--password PASS'
|
44
|
+
|
45
|
+
option :hostname,
|
46
|
+
description: 'Hostname to login to',
|
47
|
+
short: '-h HOST',
|
48
|
+
long: '--hostname HOST',
|
49
|
+
default: 'localhost'
|
50
|
+
|
51
|
+
option :port,
|
52
|
+
description: 'Database port',
|
53
|
+
short: '-P PORT',
|
54
|
+
long: '--port PORT',
|
55
|
+
default: 5432
|
56
|
+
|
57
|
+
option :database,
|
58
|
+
description: 'Database name',
|
59
|
+
short: '-d DB',
|
60
|
+
long: '--db DB',
|
61
|
+
default: 'postgres'
|
62
|
+
|
63
|
+
option :scheme,
|
64
|
+
description: 'Metric naming scheme, text to prepend to $queue_name.$metric',
|
65
|
+
long: '--scheme SCHEME',
|
66
|
+
default: "#{Socket.gethostname}.odoo"
|
67
|
+
|
68
|
+
option :timeout,
|
69
|
+
description: 'Connection timeout (seconds)',
|
70
|
+
short: '-T TIMEOUT',
|
71
|
+
long: '--timeout TIMEOUT',
|
72
|
+
default: nil
|
73
|
+
|
74
|
+
def run
|
75
|
+
timestamp = Time.now.to_i
|
76
|
+
|
77
|
+
con = PG.connect(host: config[:hostname],
|
78
|
+
dbname: config[:database],
|
79
|
+
user: config[:user],
|
80
|
+
password: config[:password],
|
81
|
+
connect_timeout: config[:timeout])
|
82
|
+
request = [
|
83
|
+
'select count(*) from ir_attachment',
|
84
|
+
]
|
85
|
+
con.exec(request.join(' ')) do |result|
|
86
|
+
result.each do |row|
|
87
|
+
output "#{config[:scheme]}.filestore_objectcount.#{config[:database]}", row['count'], timestamp
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
ok
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'sensu-plugins-odoo/version'
|
metadata
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sensu-plugins-odoo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Blagovest Petrov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-23 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: pg
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.18.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.18.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dentaku
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.0.4
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.0.4
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.7'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.7'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: codeclimate-test-reporter
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: github-markup
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.3'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.3'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.10'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.10'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '10.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '10.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: redcarpet
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.2'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.2'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.1'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.1'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.40.0
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.40.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: yard
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.8'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.8'
|
181
|
+
description: |-
|
182
|
+
This plugin provides native Odoo ERP
|
183
|
+
instrumentation for monitoring and metrics
|
184
|
+
collection
|
185
|
+
email: "<blagovest@petrovs.info>"
|
186
|
+
executables:
|
187
|
+
- metric-odoo-filestore-objectcount.rb
|
188
|
+
extensions: []
|
189
|
+
extra_rdoc_files: []
|
190
|
+
files:
|
191
|
+
- CHANGELOG.md
|
192
|
+
- LICENSE
|
193
|
+
- README.md
|
194
|
+
- bin/metric-odoo-filestore-objectcount.rb
|
195
|
+
- lib/sensu-plugins-odoo.rb
|
196
|
+
- lib/sensu-plugins-odoo/version.rb
|
197
|
+
homepage: https://github.com/eniac111/sensu-plugins-odoo
|
198
|
+
licenses:
|
199
|
+
- MIT
|
200
|
+
metadata:
|
201
|
+
maintainer: "@eniac111"
|
202
|
+
development_status: active
|
203
|
+
production_status: unstable - testing recommended
|
204
|
+
release_draft: 'false'
|
205
|
+
release_prerelease: 'false'
|
206
|
+
post_install_message: You can use the embedded Ruby by setting EMBEDDED_RUBY=true
|
207
|
+
in /etc/default/sensu
|
208
|
+
rdoc_options: []
|
209
|
+
require_paths:
|
210
|
+
- lib
|
211
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: 2.1.0
|
216
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
|
+
requirements:
|
218
|
+
- - ">="
|
219
|
+
- !ruby/object:Gem::Version
|
220
|
+
version: '0'
|
221
|
+
requirements: []
|
222
|
+
rubyforge_project:
|
223
|
+
rubygems_version: 2.5.1
|
224
|
+
signing_key:
|
225
|
+
specification_version: 4
|
226
|
+
summary: Sensu plugins for Odoo
|
227
|
+
test_files: []
|