zenoss_client 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +87 -0
- data/VERSION +1 -1
- data/zenoss_client.gemspec +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b19b969c4c6e18b9a4e012dfb56b627c5bdd43e960cdc64a8d7a9e5036df389
|
4
|
+
data.tar.gz: ab09ef31c00e1e38aa6761448c84190c7bf5ee90868d97e12f2bb1aa1eef733c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86a0b85a3e8f36c9cc1a360e4620eff9da777389b732de7083782f9d925f353df261b647b7e8b46de29a4f035d73b116e62fb9d64d5cbcb68fb7e0d2040118e
|
7
|
+
data.tar.gz: aa516bb6da3f17bc94871fdc1dda6ee0582737eda7ba5e9aee33e5095aa0b2fcf9261c152ddd30d06217c36fca1df364c2f0c9f8c69d476b08831976bf258750
|
data/README.rdoc
CHANGED
@@ -0,0 +1,87 @@
|
|
1
|
+
h1. zenoss_client: A Ruby library for JSON/REST access to Zenoss
|
2
|
+
|
3
|
+
This is a work-in-progress to create an easy to use client JSON/REST API for
|
4
|
+
Zenoss (http://www.zenoss.com) written in Ruby. I love Zenoss as a product,
|
5
|
+
but I am much more efficient in Ruby than Python so I decided to start
|
6
|
+
hacking this library together. It is very incomplete and I am just adding
|
7
|
+
functionality as I need it or it is requested.
|
8
|
+
|
9
|
+
Cheers,
|
10
|
+
|
11
|
+
Dan Wanek
|
12
|
+
|
13
|
+
h2. CHANGES SINCE THE 0.1.x BRANCH
|
14
|
+
|
15
|
+
Starting with 0.5.0 I am trying to incorporate as much of the new JSON API
|
16
|
+
into this library as possible because the type conversion hackery that was
|
17
|
+
present in the REST code is largely unnecessary. Please note that the
|
18
|
+
initialization is much different because we are using the sign-in form auth
|
19
|
+
instead of the Basic auth of the previous version. This is because the JSON
|
20
|
+
calls do not support Basic authentication.
|
21
|
+
|
22
|
+
There is still much work that needs to be done in order to fully implement
|
23
|
+
all of the JSON methods. For now many of the older features fall back to
|
24
|
+
REST and some of those will always rely on REST because they are not
|
25
|
+
currently supported in the JSON API.
|
26
|
+
|
27
|
+
|
28
|
+
h2. REQUIREMENTS:
|
29
|
+
Gems:
|
30
|
+
|
31
|
+
* tzinfo: For Python DateTime to Ruby DateTime conversion
|
32
|
+
|
33
|
+
|
34
|
+
h2. UNSUPPORTED REST METHODS:
|
35
|
+
Some methods within Zope are unsupported due to type conversion issues.
|
36
|
+
I have created a work-around but you must add a custom Python script
|
37
|
+
to Zope in order to do this. Please see this blog post for information
|
38
|
+
on how add the custom script:
|
39
|
+
|
40
|
+
http://distributed-frostbite.blogspot.com/2010/04/using-ruby-with-zenoss-part-1.html
|
41
|
+
|
42
|
+
UPDATE: The script itself is now part of the source tree and can be found here: tools/callZenossMethod.py
|
43
|
+
It should still be installed in the same fashion as the blog post steps through.
|
44
|
+
|
45
|
+
== TO USE:
|
46
|
+
A gem is now available. 'gem install zenoss_client'
|
47
|
+
|
48
|
+
<pre>
|
49
|
+
<code>
|
50
|
+
require 'zenoss'
|
51
|
+
require 'date'
|
52
|
+
|
53
|
+
server = 'https://zenhost:port/zport/dmd'
|
54
|
+
user, pass = 'zuser', 'zpass'
|
55
|
+
@zen = Zenoss.connect server, user, pass
|
56
|
+
dev = (@zen.find_devices_by_name 'myservername').first
|
57
|
+
|
58
|
+
# Get RRD data for this device
|
59
|
+
rrdpts = dev.get_rrd_data_points
|
60
|
+
datapoints = dev.fetch_rrd_value rrdpts.first.name, (DateTime.now - 1)
|
61
|
+
|
62
|
+
# Get the uptime of the device
|
63
|
+
dev.sys_uptime
|
64
|
+
|
65
|
+
# Get a list of events for this system
|
66
|
+
dev.get_events
|
67
|
+
</code>
|
68
|
+
</pre>
|
69
|
+
|
70
|
+
Have fun and let me know what needs to be fixed / added.
|
71
|
+
|
72
|
+
== Testing
|
73
|
+
You can invoke a series of minitest based spec test using the supplied
|
74
|
+
tests and rake task. Simply run the following to kick off the tests
|
75
|
+
@bundle exec rake test@
|
76
|
+
|
77
|
+
You should see output similar to the following (The number of tests will
|
78
|
+
of course grow over time):
|
79
|
+
@3 tests, 6 assertions, 0 failures, 0 errors, 0 skips@
|
80
|
+
|
81
|
+
If you get any failures, you should of course address them
|
82
|
+
|
83
|
+
Since the test suite requires a working Zenoss installation to test against,
|
84
|
+
some docker files are provided under test/docker. From a docker host, clone this
|
85
|
+
repo, cd to the appropriate test/docker/ subdirectory, and run @sh start.sh@ to
|
86
|
+
build and start the container. Once the container is running, you should be able
|
87
|
+
to run the tests as described above.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.1
|
data/zenoss_client.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
|
2
3
|
lib = File.expand_path('lib/', __FILE__)
|
3
4
|
$:.unshift lib unless $:.include?(lib)
|
4
5
|
require 'date'
|
@@ -18,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
18
19
|
gem.license = 'GPL-3.0'
|
19
20
|
gem.description = <<-EOF
|
20
21
|
This is a wrapper around the Zenoss JSON and REST APIs. For the most things it
|
21
|
-
should feel very familiar to zendmd, but there are some changes
|
22
|
+
should feel very familiar to zendmd, but there are some changes due to the merging
|
22
23
|
of the JSON and REST APIs. Please read the API docs for Zenoss and the YARDDoc for
|
23
24
|
this gem (rdoc.info).
|
24
25
|
EOF
|
@@ -30,8 +31,8 @@ Gem::Specification.new do |gem|
|
|
30
31
|
|
31
32
|
gem.required_ruby_version = '>= 2.0.0-p648'
|
32
33
|
gem.add_runtime_dependency 'httpclient', '~> 2.0'
|
33
|
-
gem.add_runtime_dependency 'tzinfo', '~> 0.
|
34
|
-
gem.add_runtime_dependency 'json', '~>
|
34
|
+
gem.add_runtime_dependency 'tzinfo', '~> 2.0.2'
|
35
|
+
gem.add_runtime_dependency 'json', '~> 2.3'
|
35
36
|
|
36
37
|
gem.add_development_dependency('rake')
|
37
38
|
gem.add_development_dependency('minitest')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zenoss_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Wanek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|