zapix3 0.1.2 → 0.1.3
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 +1 -1
- data/README.md +6 -33
- data/lib/zapix/proxies/applications.rb +1 -1
- data/lib/zapix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeb70f5993f22ff8693fabe665bb96e065e6cc89
|
4
|
+
data.tar.gz: eafa0b44b46acf5c50260d0f9f40a3016ebbeaa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7f3edb83e41ea3e88aa6ce510e9481e91ab72bb5c68d17dc7d4bf2b063bd6d754ee401e293680846d99786a7cb757f47b49805badbc86dc5da668981c9fc9e
|
7
|
+
data.tar.gz: 18f91fe9f2fc9b0a13ee6ba1f3c964a6730c7261298516b851c4e8aa7284a8bc328106a65fe7d4596180138fe7609359cafd48360e8071832acf0ba2ce70db47
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -26,6 +26,12 @@ Or install it with gem:
|
|
26
26
|
First create a remote client. Feel free to
|
27
27
|
disable the debug mode if you find it annoying.
|
28
28
|
|
29
|
+
These environment variables also need to be set:
|
30
|
+
|
31
|
+
ZABBIX_API_URL
|
32
|
+
ZABBIX_API_LOGIN
|
33
|
+
ZABBIX_API_PASSWORD
|
34
|
+
|
29
35
|
```ruby
|
30
36
|
require 'zapix'
|
31
37
|
zrc = ZabbixAPI.connect(
|
@@ -44,11 +50,6 @@ zrc = ZabbixAPI.connect(
|
|
44
50
|
zrc.hostgroups.create('test_hostgroup')
|
45
51
|
```
|
46
52
|
|
47
|
-
#### Checking if a hostgroup exists
|
48
|
-
```ruby
|
49
|
-
zrc.hostgroups.exists?('test_hostgroup')
|
50
|
-
```
|
51
|
-
|
52
53
|
#### Checking if a hostgroup has any attached hosts
|
53
54
|
```ruby
|
54
55
|
zrc.hostgroups.any_hosts?('test_hostgroup')
|
@@ -83,11 +84,6 @@ zrc.hostgroups.get_all
|
|
83
84
|
zrc.hosts.get_id('test_host')
|
84
85
|
```
|
85
86
|
|
86
|
-
#### Checking if a host exists
|
87
|
-
```ruby
|
88
|
-
zrc.hosts.exists?('test_host')
|
89
|
-
```
|
90
|
-
|
91
87
|
#### Getting all host names
|
92
88
|
```ruby
|
93
89
|
zrc.hosts.get_all
|
@@ -246,12 +242,6 @@ zrc.triggers.delete(trigger_id)
|
|
246
242
|
|
247
243
|
### Usergroups Operations
|
248
244
|
|
249
|
-
#### Checking if a usergroup exists
|
250
|
-
```ruby
|
251
|
-
zrc.usergroups.exists?({
|
252
|
-
'name' => 'test_usergroup'
|
253
|
-
})
|
254
|
-
```
|
255
245
|
#### Geting the id of a usergroup
|
256
246
|
```ruby
|
257
247
|
zrc.usergroups.get_id({
|
@@ -276,12 +266,6 @@ usergroup_id = zrc.usergroups.get_id({'name' => 'test_usergroup'})
|
|
276
266
|
zrc.usergroups.delete(usergroup_id)
|
277
267
|
```
|
278
268
|
|
279
|
-
### User Operations
|
280
|
-
#### Checking if a user exists
|
281
|
-
```ruby
|
282
|
-
zrc.users.exists?({'alias' => 'max'})
|
283
|
-
```
|
284
|
-
|
285
269
|
#### Getting the id of a user
|
286
270
|
```ruby
|
287
271
|
zrc.users.get_id({'alias' => 'max'})
|
@@ -311,11 +295,6 @@ zrc.users.create(user_options)
|
|
311
295
|
|
312
296
|
### Actions Operations
|
313
297
|
|
314
|
-
#### Checking if an action exists
|
315
|
-
```ruby
|
316
|
-
zrc.actions.exists?({'name' => 'Report problems to Zabbix administrators'})
|
317
|
-
```
|
318
|
-
|
319
298
|
#### Getting the id of an action
|
320
299
|
```ruby
|
321
300
|
zrc.actions.get_id({'name' => 'Report problems to Zabbix administrators'})
|
@@ -364,12 +343,6 @@ zrc.users.create(user_options)
|
|
364
343
|
### Remote client and tests
|
365
344
|
In order to run the rspec tests you need a running zabbix test server.
|
366
345
|
|
367
|
-
These environment variables also need to be set:
|
368
|
-
|
369
|
-
ZABBIX_API_URL
|
370
|
-
ZABBIX_API_LOGIN
|
371
|
-
ZABBIX_API_PASSWORD
|
372
|
-
|
373
346
|
### TODOs
|
374
347
|
Open source the docker-compose setup of the whole zabbix installation.
|
375
348
|
|
@@ -19,7 +19,7 @@ class Applications < Base
|
|
19
19
|
if exists?(options)
|
20
20
|
client.application_get({
|
21
21
|
'filter' => {'name' => options['name'],
|
22
|
-
'hostid' => options['hostid']}}).first['
|
22
|
+
'hostid' => options['hostid']}}).first['applicationid']
|
23
23
|
else
|
24
24
|
raise NonExistingApplication, "Application #{options['name']} does not exist !"
|
25
25
|
end
|
data/lib/zapix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zapix3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- stoyan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|