zabbix-api-simple 0.1.0 → 0.1.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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +2 -2
- data/lib/zabbix/api/client.rb +13 -2
- data/lib/zabbix/api/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e4b7542ca901c9a7b69721322dfa5cac8294a10c5af3c55fb1e3064f19df156
|
4
|
+
data.tar.gz: 076dd443693be95e728b601cda49dbc34a93191b62b9b14ea07b351c3cb6158a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45debfd58a35cc793df8fedf2eded4886f4c085bfdff418c35f3f35b8b2ba10973a1305eecef0650f81b4a991e3687efb86a7a1a35aa16695369a219ccd1b484
|
7
|
+
data.tar.gz: 0aebc9edd72680f02eca0b7373b2fea2877019cacf39bca631c308cb5639ea711476bba2acc332d20bfc1051a36bc1ff4636606e59cb60a10adbf89c080c7b00
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -15,7 +15,7 @@ It accomplishes these goals primarily by deferring (via Faraday) to the Zabbix A
|
|
15
15
|
Add this line to your application's Gemfile:
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
gem 'zabbix-api'
|
18
|
+
gem 'zabbix-api-simple'
|
19
19
|
```
|
20
20
|
|
21
21
|
And then execute:
|
@@ -24,7 +24,7 @@ And then execute:
|
|
24
24
|
|
25
25
|
Or install it yourself as:
|
26
26
|
|
27
|
-
$ gem install zabbix-api
|
27
|
+
$ gem install zabbix-api-simple
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
data/lib/zabbix/api/client.rb
CHANGED
@@ -35,6 +35,11 @@ module Zabbix
|
|
35
35
|
|
36
36
|
|
37
37
|
class Client
|
38
|
+
|
39
|
+
class << self
|
40
|
+
attr_accessor :last
|
41
|
+
end
|
42
|
+
|
38
43
|
|
39
44
|
@@apiurl = 'api_jsonrpc.php'
|
40
45
|
|
@@ -50,7 +55,7 @@ module Zabbix
|
|
50
55
|
:usermacro,:valuemap,:httptest].to_set
|
51
56
|
|
52
57
|
|
53
|
-
attr_reader :conn,:token
|
58
|
+
attr_reader :conn,:token
|
54
59
|
attr_accessor :zabobject
|
55
60
|
|
56
61
|
|
@@ -66,7 +71,9 @@ module Zabbix
|
|
66
71
|
|
67
72
|
def post(args)
|
68
73
|
args[:params] = [] if not args.has_key?(:params) or args[:params].nil?
|
69
|
-
|
74
|
+
last = @conn.post(@@apiurl, args)
|
75
|
+
Client.last = last
|
76
|
+
return last
|
70
77
|
end
|
71
78
|
|
72
79
|
def login(user: nil,pass: nil)
|
@@ -103,6 +110,10 @@ module Zabbix
|
|
103
110
|
end
|
104
111
|
end
|
105
112
|
|
113
|
+
def last
|
114
|
+
Client.last
|
115
|
+
end
|
116
|
+
|
106
117
|
end
|
107
118
|
|
108
119
|
end # module Api
|
data/lib/zabbix/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbix-api-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Parker
|
@@ -100,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
|
104
|
-
rubygems_version: 2.7.6
|
103
|
+
rubygems_version: 3.1.2
|
105
104
|
signing_key:
|
106
105
|
specification_version: 4
|
107
106
|
summary: Zabbix API wrapper
|