zabbix-api-simple 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zabbix/api/client.rb +7 -1
- data/lib/zabbix/api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc07e3c44b9f77ae8ca40da089d206bdcdb176e03fac49184cafbe41f2bc613a
|
4
|
+
data.tar.gz: b05b2fa3bd4d1622c5dd5d079c022555bacd6264ca20a51cb843a628856a4a25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7e0fb56182ff8ff578c2ee37689a013ef56a105b1ddfe8729321f43e29a55be9f57eb7b586f79d0f508826d78a7c0256fd20a61b0cb907a4b65488c1f5514c8
|
7
|
+
data.tar.gz: 226e82097a386288806dbe3a7f7b03dc53bc22f26cfa435f72b9f833381f2017f41d124be21a77a6f35a6dc0baab0bc294230355dbb821f90ad032dbbaedc8c2
|
data/lib/zabbix/api/client.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Zabbix
|
2
2
|
module Api
|
3
|
+
UsernameChangeVersion = "6.4.0"
|
3
4
|
|
4
5
|
require 'faraday'
|
5
6
|
require 'faraday/net_http'
|
@@ -139,7 +140,12 @@ module Zabbix
|
|
139
140
|
# both :user and :pass are required. This method calls user.logic
|
140
141
|
# abd stores the returned auth token for future calls to the api
|
141
142
|
def login(user: nil,pass: nil)
|
142
|
-
|
143
|
+
version = call('apiinfo.version',{}).result
|
144
|
+
if version < UsernameChangeVersion
|
145
|
+
res =post(method: 'user.login', params: {user: user, password:pass}, auth:nil)
|
146
|
+
else
|
147
|
+
res =post(method: 'user.login', params: {username: user, password:pass}, auth:nil)
|
148
|
+
end
|
143
149
|
@token = res.body['result']
|
144
150
|
OpenStruct.new(res.body)
|
145
151
|
end
|
data/lib/zabbix/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbix-api-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Parker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.4.
|
161
|
+
rubygems_version: 3.4.10
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Zabbix API wrapper
|