icinga2 0.7.0.1 → 0.8.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +73 -58
- data/doc/Icinga2.html +35 -3
- data/doc/Logging.html +2 -2
- data/doc/_index.html +2 -2
- data/doc/class_list.html +1 -1
- data/doc/downtimes.md +21 -4
- data/doc/file.README.html +118 -66
- data/doc/hostgroups.md +26 -11
- data/doc/hosts.md +93 -20
- data/doc/index.html +118 -66
- data/doc/method_list.html +84 -300
- data/doc/notifications.md +42 -14
- data/doc/servicegroups.md +28 -11
- data/doc/services.md +91 -21
- data/doc/statistics.md +54 -0
- data/doc/top-level-namespace.html +1 -1
- data/doc/usergroups.md +25 -4
- data/doc/users.md +26 -29
- data/examples/test.rb +213 -76
- data/lib/icinga2.rb +256 -71
- data/lib/icinga2/converts.rb +5 -2
- data/lib/icinga2/downtimes.rb +26 -88
- data/lib/icinga2/hostgroups.rb +46 -32
- data/lib/icinga2/hosts.rb +205 -92
- data/lib/icinga2/network.rb +136 -325
- data/lib/icinga2/network.rb-SAVE +1004 -0
- data/lib/icinga2/notifications.rb +49 -72
- data/lib/icinga2/servicegroups.rb +54 -42
- data/lib/icinga2/services.rb +212 -82
- data/lib/icinga2/statistics.rb +191 -0
- data/lib/icinga2/tools.rb +28 -23
- data/lib/icinga2/usergroups.rb +49 -39
- data/lib/icinga2/users.rb +56 -61
- data/lib/icinga2/version.rb +3 -3
- metadata +5 -3
- data/lib/icinga2/status.rb +0 -210
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1b29d3023c00d7dd825a06538ff256158e19889
|
4
|
+
data.tar.gz: ad824b03bcf3036cf96982c94d0a8dd254d4ef10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2bf72e37122c2fca742d44256ea80e814acfeb6693da661499269de2bd695714c5058bb1a4eb04c6d3511a11116df058316a9418cf4e359d8c4628a9d63bd2c
|
7
|
+
data.tar.gz: fa52dd4ddb225f5d806e8b9cc2d103ab2e40f8715201d6e34ee630235be3f617b12d1dd840157651b6432430dfd0a4fbf5e410aa23df4094d1e3da0c4b54bbcc
|
data/README.md
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
# ruby-icinga2
|
2
2
|
|
3
|
-
|
3
|
+
Ruby Class for the Icinga2 API
|
4
|
+
|
5
|
+
|
4
6
|
|
5
7
|
|
6
8
|
## Requirements
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
+
* ruby version ~> 2.3
|
11
|
+
* rest-client ~> 2.0
|
12
|
+
* openssl ~> 2.0
|
13
|
+
* json ~> 2.1
|
14
|
+
|
15
|
+
## install
|
16
|
+
|
17
|
+
gem install icinga2
|
10
18
|
|
11
19
|
## usage
|
12
20
|
|
13
|
-
create an instance
|
21
|
+
create an instance
|
14
22
|
|
15
23
|
config = {
|
16
24
|
:icinga => {
|
@@ -25,79 +33,87 @@ create an instance and get information about the Icinga2 Server
|
|
25
33
|
}
|
26
34
|
}
|
27
35
|
|
28
|
-
|
29
|
-
puts i.application_data()
|
30
|
-
|
36
|
+
@icinga = Icinga::Client.new( config )
|
31
37
|
|
32
38
|
## Status
|
33
39
|
|
34
40
|
supports the following API Calls:
|
35
41
|
|
36
|
-
- [Users](doc/status.md)
|
37
|
-
* application_data
|
38
|
-
* cib_data
|
39
|
-
* api_listener
|
40
|
-
|
41
42
|
- [Users](doc/users.md)
|
42
|
-
*
|
43
|
-
*
|
44
|
-
* users(
|
45
|
-
*
|
43
|
+
* [add user](doc/users.md#add-user)
|
44
|
+
* [delete user](doc/users.md#delete-dser)
|
45
|
+
* [list users](doc/users.md#list-users)
|
46
|
+
* [check if user exists](doc/users.md#user-exists)
|
46
47
|
|
47
48
|
- [Usergroups](doc/usergroups.md)
|
48
|
-
*
|
49
|
-
*
|
50
|
-
* usergroups(
|
51
|
-
*
|
49
|
+
* [add usergroup](doc/usergroups.md#add-usergroup)
|
50
|
+
* [delete usergroup](doc/usergroups.md#delete-usergroup)
|
51
|
+
* [list usergroups](doc/usergroups.md#list-usergroups)
|
52
|
+
* [check if usergroup exists](doc/usergroups.md#usergroup-exists)
|
52
53
|
|
53
54
|
- [Hosts](doc/hosts.md)
|
54
|
-
*
|
55
|
-
*
|
56
|
-
* hosts(
|
57
|
-
*
|
58
|
-
*
|
59
|
-
*
|
60
|
-
*
|
61
|
-
*
|
55
|
+
* [add host](doc/hosts.md#add-host)
|
56
|
+
* [delete host](doc/hosts.md#delete-host)
|
57
|
+
* [list hosts](doc/hosts.md#list-hosts)
|
58
|
+
* [check if host exists](doc/hosts.md#host-exists)
|
59
|
+
* [list host objects](doc/hosts.md#list-host-objects)
|
60
|
+
* [adjusted hosts state](doc/hosts.md#hosts-adjusted)
|
61
|
+
* [count of hosts with problems](doc/hosts.md#count-hosts-with-problems)
|
62
|
+
* [list of hosts with problems](doc/hosts.md#list-hosts-with-problems)
|
63
|
+
* [count of all hosts](doc/hosts.md#count-all-hosts)
|
64
|
+
* [count hosts with problems](doc/hosts.md#count-host-problems)
|
65
|
+
* calculate host severity (protected)
|
62
66
|
|
63
67
|
- [Hostgroups](doc/hostgroups.md)
|
64
|
-
*
|
65
|
-
*
|
66
|
-
* hostgroups(
|
67
|
-
*
|
68
|
+
* [add hostgroup](doc/hostgroups.md#add-usergroup)
|
69
|
+
* [delete hostgroup](doc/hostgroups.md#delete-usergroup)
|
70
|
+
* [list hostgroups](doc/hostgroups.md#list-usergroups)
|
71
|
+
* [check if hostgroup exists](doc/hostgroups.md#usergroup-exists)
|
68
72
|
|
69
73
|
- [Services](doc/services.md)
|
70
|
-
*
|
71
|
-
*
|
72
|
-
* services(
|
73
|
-
*
|
74
|
-
*
|
75
|
-
*
|
76
|
-
*
|
77
|
-
*
|
78
|
-
*
|
74
|
+
* [add service](doc/services.md#add-service) (**this function is not operable yet!**)
|
75
|
+
* [delete service](doc/services.md#delete-service) (**not yet implemented**)
|
76
|
+
* [add service](doc/services.md#add-service) (**this function is not operable yet!**)
|
77
|
+
* [list unhandled services](doc/services.md#unhandled-services) (**not yet implemented**)
|
78
|
+
* [list services](doc/services.md#list-services)
|
79
|
+
* [check if service exists](doc/services.md#service-exists)
|
80
|
+
* [list service objects](doc/services.md#list-service-objects)
|
81
|
+
* [adjusted service state](doc/services.md#services-adjusted)
|
82
|
+
* [count services with problems](doc/services.md#count-services-with-problems)
|
83
|
+
* [list of services with problems](doc/services.md#list-services-with-problems)
|
84
|
+
* [update host](doc/services.md#update-host) (**this function is not operable yet!**)
|
85
|
+
* [count of all services](doc/services.md#count-all-services)
|
86
|
+
* [count all services with handled problems](doc/services.md#count-all-services-handled)
|
87
|
+
* calculate service severity (protected)
|
79
88
|
|
80
89
|
- [Servicegroups](doc/servicegroups.md)
|
81
|
-
*
|
82
|
-
*
|
83
|
-
* servicegroups(
|
84
|
-
*
|
90
|
+
* [add servicegroup](doc/servicegroups.md#add-servicegroup)
|
91
|
+
* [delete servicegroup](doc/servicegroups.md#delete-servicegroup)
|
92
|
+
* [list servicegroups](doc/servicegroups.md#list-servicegroup)
|
93
|
+
* [check if servicegroup exists](doc/servicegroups.md#servicegroup-exists)
|
85
94
|
|
86
95
|
- [Downtimes](doc/downtimes.md)
|
87
|
-
*
|
88
|
-
* downtimes(
|
96
|
+
* [add downtime](doc/downtimes.md#add-downtime)
|
97
|
+
* [list downtimes](doc/downtimes.md#list-downtimes)
|
89
98
|
|
90
99
|
- [Notifications](doc/notifications.md)
|
91
|
-
*
|
92
|
-
*
|
93
|
-
*
|
94
|
-
*
|
95
|
-
*
|
96
|
-
*
|
97
|
-
* notifications(
|
98
|
-
*
|
99
|
-
*
|
100
|
-
*
|
100
|
+
* [enable host notifications](doc/notifications.md#enable-host-notification)
|
101
|
+
* [disable host notifications](doc/notifications.md#disable-host-notification)
|
102
|
+
* [enable service notifications](doc/notifications.md#enable-service-notification)
|
103
|
+
* [disable service notifications](doc/notifications.md#disable-service-notification)
|
104
|
+
* [enable hostgroup notifications](doc/notifications.md#enable-hostgroup-notification)
|
105
|
+
* [disable hostgroup notifications](doc/notifications.md#disable-hostgroup-notification)
|
106
|
+
* [list all notifications](doc/notifications.md#list-notifications)
|
107
|
+
* host notification (protected)
|
108
|
+
* hostgroup notification (protected)
|
109
|
+
* service notification (protected)
|
110
|
+
|
111
|
+
- [Statistics](doc/statistics.md)
|
112
|
+
* [statistic data for latence and execution time](doc/statistics.md#stats-avg)
|
113
|
+
* [statistic data for interval data](doc/statistics.md#stats-interval)
|
114
|
+
* [statistic data for services](doc/statistics.md#stats-services)
|
115
|
+
* [statistic data for hosts](doc/statistics.md#stats-hosts)
|
116
|
+
* [queue statistics from the api](doc/statistics.md#stats-work-queue)
|
101
117
|
|
102
118
|
|
103
119
|
## create a own gem File
|
@@ -116,7 +132,6 @@ supports the following API Calls:
|
|
116
132
|
|
117
133
|
## test via CLI
|
118
134
|
|
119
|
-
#$ export ICINGA_HOST=localhost ; export ICINGA_API_USER=root ; export ICINGA_API_PASSWORD=icinga
|
120
135
|
#$ irb
|
121
136
|
2.3.0 :001 > require 'icinga2'
|
122
137
|
=> true
|
data/doc/Icinga2.html
CHANGED
@@ -79,7 +79,7 @@
|
|
79
79
|
<dl>
|
80
80
|
<dt>Defined in:</dt>
|
81
81
|
<dd>lib/icinga2.rb<span class="defines">,<br />
|
82
|
-
lib/icinga2/hosts.rb,<br /> lib/icinga2/tools.rb,<br /> lib/icinga2/users.rb,<br /> lib/icinga2/
|
82
|
+
lib/icinga2/hosts.rb,<br /> lib/icinga2/tools.rb,<br /> lib/icinga2/users.rb,<br /> lib/icinga2/network.rb,<br /> lib/icinga2/version.rb,<br /> lib/icinga2/converts.rb,<br /> lib/icinga2/services.rb,<br /> lib/icinga2/downtimes.rb,<br /> lib/icinga2/hostgroups.rb,<br /> lib/icinga2/statistics.rb,<br /> lib/icinga2/usergroups.rb,<br /> lib/icinga2/notifications.rb,<br /> lib/icinga2/servicegroups.rb</span>
|
83
83
|
</dd>
|
84
84
|
</dl>
|
85
85
|
|
@@ -100,7 +100,7 @@
|
|
100
100
|
<p class="children">
|
101
101
|
|
102
102
|
|
103
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Icinga2/Converts.html" title="Icinga2::Converts (module)">Converts</a></span>, <span class='object_link'><a href="Icinga2/Downtimes.html" title="Icinga2::Downtimes (module)">Downtimes</a></span>, <span class='object_link'><a href="Icinga2/Hostgroups.html" title="Icinga2::Hostgroups (module)">Hostgroups</a></span>, <span class='object_link'><a href="Icinga2/Hosts.html" title="Icinga2::Hosts (module)">Hosts</a></span>, <span class='object_link'><a href="Icinga2/Network.html" title="Icinga2::Network (module)">Network</a></span>, <span class='object_link'><a href="Icinga2/Notifications.html" title="Icinga2::Notifications (module)">Notifications</a></span>, <span class='object_link'><a href="Icinga2/Servicegroups.html" title="Icinga2::Servicegroups (module)">Servicegroups</a></span>, <span class='object_link'><a href="Icinga2/Services.html" title="Icinga2::Services (module)">Services</a></span>, <span class='object_link'><a href="Icinga2/
|
103
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Icinga2/Converts.html" title="Icinga2::Converts (module)">Converts</a></span>, <span class='object_link'><a href="Icinga2/Downtimes.html" title="Icinga2::Downtimes (module)">Downtimes</a></span>, <span class='object_link'><a href="Icinga2/Hostgroups.html" title="Icinga2::Hostgroups (module)">Hostgroups</a></span>, <span class='object_link'><a href="Icinga2/Hosts.html" title="Icinga2::Hosts (module)">Hosts</a></span>, <span class='object_link'><a href="Icinga2/Network.html" title="Icinga2::Network (module)">Network</a></span>, <span class='object_link'><a href="Icinga2/Notifications.html" title="Icinga2::Notifications (module)">Notifications</a></span>, <span class='object_link'><a href="Icinga2/Servicegroups.html" title="Icinga2::Servicegroups (module)">Servicegroups</a></span>, <span class='object_link'><a href="Icinga2/Services.html" title="Icinga2::Services (module)">Services</a></span>, <span class='object_link'><a href="Icinga2/Statistics.html" title="Icinga2::Statistics (module)">Statistics</a></span>, <span class='object_link'><a href="Icinga2/Tools.html" title="Icinga2::Tools (module)">Tools</a></span>, <span class='object_link'><a href="Icinga2/Usergroups.html" title="Icinga2::Usergroups (module)">Usergroups</a></span>, <span class='object_link'><a href="Icinga2/Users.html" title="Icinga2::Users (module)">Users</a></span>, <span class='object_link'><a href="Icinga2/Version.html" title="Icinga2::Version (module)">Version</a></span>
|
104
104
|
|
105
105
|
|
106
106
|
|
@@ -128,6 +128,38 @@
|
|
128
128
|
</dt>
|
129
129
|
<dd><pre class="code"><span class='int'>1</span></pre></dd>
|
130
130
|
|
131
|
+
<dt id="HOSTS_CRITICAL-constant" class="">HOSTS_CRITICAL =
|
132
|
+
<div class="docstring">
|
133
|
+
<div class="discussion">
|
134
|
+
|
135
|
+
<p>static variable for hosts critical</p>
|
136
|
+
|
137
|
+
|
138
|
+
</div>
|
139
|
+
</div>
|
140
|
+
<div class="tags">
|
141
|
+
|
142
|
+
|
143
|
+
</div>
|
144
|
+
</dt>
|
145
|
+
<dd><pre class="code"><span class='int'>2</span></pre></dd>
|
146
|
+
|
147
|
+
<dt id="HOSTS_UNKNOWN-constant" class="">HOSTS_UNKNOWN =
|
148
|
+
<div class="docstring">
|
149
|
+
<div class="discussion">
|
150
|
+
|
151
|
+
<p>static variable for hosts unknown</p>
|
152
|
+
|
153
|
+
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
<div class="tags">
|
157
|
+
|
158
|
+
|
159
|
+
</div>
|
160
|
+
</dt>
|
161
|
+
<dd><pre class="code"><span class='int'>3</span></pre></dd>
|
162
|
+
|
131
163
|
<dt id="SERVICE_STATE_WARNING-constant" class="">SERVICE_STATE_WARNING =
|
132
164
|
<div class="docstring">
|
133
165
|
<div class="discussion">
|
@@ -205,7 +237,7 @@
|
|
205
237
|
</div>
|
206
238
|
|
207
239
|
<div id="footer">
|
208
|
-
Generated on
|
240
|
+
Generated on Tue Aug 22 11:29:51 2017 by
|
209
241
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
210
242
|
0.9.9 (ruby-2.3.4).
|
211
243
|
</div>
|
data/doc/Logging.html
CHANGED
@@ -234,7 +234,7 @@ href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-amon
|
|
234
234
|
|
235
235
|
<span class='id identifier rubyid_logger'>logger</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>STDOUT</span><span class='rparen'>)</span>
|
236
236
|
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_progname'>progname</span> <span class='op'>=</span> <span class='id identifier rubyid_classname'>classname</span>
|
237
|
-
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>
|
237
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='const'>Logger</span><span class='op'>::</span><span class='const'>UNKNOWN</span>
|
238
238
|
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_datetime_format'>datetime_format</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%Y-%m-%d %H:%M:%S::%3N</span><span class='tstring_end'>'</span></span>
|
239
239
|
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_formatter'>formatter</span> <span class='op'>=</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_severity'>severity</span><span class='comma'>,</span> <span class='id identifier rubyid_datetime'>datetime</span><span class='comma'>,</span> <span class='id identifier rubyid_progname'>progname</span><span class='comma'>,</span> <span class='id identifier rubyid_msg'>msg</span><span class='op'>|</span>
|
240
240
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_datetime'>datetime</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span> <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_datetime_format'>datetime_format</span> <span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>] </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_severity'>severity</span><span class='period'>.</span><span class='id identifier rubyid_ljust'>ljust</span><span class='lparen'>(</span><span class='int'>5</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> : </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_progname'>progname</span><span class='embexpr_end'>}</span><span class='tstring_content'> - </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_msg'>msg</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
@@ -318,7 +318,7 @@ href="https://stackoverflow.com/questions/917566/ruby-share-logger-instance-amon
|
|
318
318
|
</div>
|
319
319
|
|
320
320
|
<div id="footer">
|
321
|
-
Generated on
|
321
|
+
Generated on Tue Aug 22 11:29:51 2017 by
|
322
322
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
323
323
|
0.9.9 (ruby-2.3.4).
|
324
324
|
</div>
|
data/doc/_index.html
CHANGED
@@ -202,7 +202,7 @@
|
|
202
202
|
</li>
|
203
203
|
|
204
204
|
<li>
|
205
|
-
<span class='object_link'><a href="Icinga2/
|
205
|
+
<span class='object_link'><a href="Icinga2/Statistics.html" title="Icinga2::Statistics (module)">Statistics</a></span>
|
206
206
|
|
207
207
|
<small>(Icinga2)</small>
|
208
208
|
|
@@ -275,7 +275,7 @@
|
|
275
275
|
</div>
|
276
276
|
|
277
277
|
<div id="footer">
|
278
|
-
Generated on
|
278
|
+
Generated on Tue Aug 22 11:29:51 2017 by
|
279
279
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
280
280
|
0.9.9 (ruby-2.3.4).
|
281
281
|
</div>
|
data/doc/class_list.html
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
<ul id="full_list" class="class">
|
45
45
|
<li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
|
46
|
-
<li id='object_Icinga2' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="Icinga2.html" title="Icinga2 (module)">Icinga2</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_Icinga2::Client' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Client.html" title="Icinga2::Client (class)">Client</a></span> < Object<small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Converts' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Converts.html" title="Icinga2::Converts (module)">Converts</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Downtimes' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Downtimes.html" title="Icinga2::Downtimes (module)">Downtimes</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Hostgroups' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Hostgroups.html" title="Icinga2::Hostgroups (module)">Hostgroups</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Hosts' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Hosts.html" title="Icinga2::Hosts (module)">Hosts</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Network' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Network.html" title="Icinga2::Network (module)">Network</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Notifications' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Notifications.html" title="Icinga2::Notifications (module)">Notifications</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Servicegroups' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Servicegroups.html" title="Icinga2::Servicegroups (module)">Servicegroups</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Services' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Services.html" title="Icinga2::Services (module)">Services</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::
|
46
|
+
<li id='object_Icinga2' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="Icinga2.html" title="Icinga2 (module)">Icinga2</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_Icinga2::Client' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Client.html" title="Icinga2::Client (class)">Client</a></span> < Object<small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Converts' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Converts.html" title="Icinga2::Converts (module)">Converts</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Downtimes' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Downtimes.html" title="Icinga2::Downtimes (module)">Downtimes</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Hostgroups' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Hostgroups.html" title="Icinga2::Hostgroups (module)">Hostgroups</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Hosts' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Hosts.html" title="Icinga2::Hosts (module)">Hosts</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Network' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Network.html" title="Icinga2::Network (module)">Network</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Notifications' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Notifications.html" title="Icinga2::Notifications (module)">Notifications</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Servicegroups' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Servicegroups.html" title="Icinga2::Servicegroups (module)">Servicegroups</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Services' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Services.html" title="Icinga2::Services (module)">Services</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Statistics' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Statistics.html" title="Icinga2::Statistics (module)">Statistics</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Tools' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Tools.html" title="Icinga2::Tools (module)">Tools</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Usergroups' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Usergroups.html" title="Icinga2::Usergroups (module)">Usergroups</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Users' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Users.html" title="Icinga2::Users (module)">Users</a></span><small class='search_info'>Icinga2</small></div></li><li id='object_Icinga2::Version' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Icinga2/Version.html" title="Icinga2::Version (module)">Version</a></span><small class='search_info'>Icinga2</small></div></li></ul></li><li id='object_Logging' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Logging.html" title="Logging (module)">Logging</a></span><small class='search_info'>Top Level Namespace</small></div></li>
|
47
47
|
|
48
48
|
</ul>
|
49
49
|
</div>
|
data/doc/downtimes.md
CHANGED
@@ -1,8 +1,25 @@
|
|
1
1
|
# Icinga2 - Downtimes
|
2
2
|
|
3
3
|
|
4
|
-
## add
|
5
|
-
add_downtime()
|
4
|
+
## <a name="add-downtime"></a>add a downtime
|
5
|
+
add_downtime( params )
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
### Example
|
8
|
+
|
9
|
+
param = {
|
10
|
+
name: 'test',
|
11
|
+
type: 'service',
|
12
|
+
host: 'icinga2',
|
13
|
+
comment: 'test downtime',
|
14
|
+
author: 'icingaadmin',
|
15
|
+
start_time: Time.now.to_i,
|
16
|
+
end_time: Time.now.to_i + 20
|
17
|
+
}
|
18
|
+
@icinga.add_downtime( param )
|
19
|
+
|
20
|
+
|
21
|
+
## <a name="list-downtimes"></a>list all downtimes
|
22
|
+
downtimes
|
23
|
+
|
24
|
+
### Example
|
25
|
+
@icinga.downtimes
|
data/doc/file.README.html
CHANGED
@@ -60,16 +60,27 @@
|
|
60
60
|
<div id="content"><div id='filecontents'>
|
61
61
|
<h1 id="label-ruby-icinga2">ruby-icinga2</h1>
|
62
62
|
|
63
|
-
<p>
|
63
|
+
<p>Ruby Class for the Icinga2 API</p>
|
64
64
|
|
65
65
|
<h2 id="label-Requirements">Requirements</h2>
|
66
|
+
<ul><li>
|
67
|
+
<p>ruby version ~> 2.3</p>
|
68
|
+
</li><li>
|
69
|
+
<p>rest-client ~> 2.0</p>
|
70
|
+
</li><li>
|
71
|
+
<p>openssl ~> 2.0</p>
|
72
|
+
</li><li>
|
73
|
+
<p>json ~> 2.1</p>
|
74
|
+
</li></ul>
|
75
|
+
|
76
|
+
<h2 id="label-install">install</h2>
|
66
77
|
|
67
|
-
<pre class="code ruby"><code class="ruby">gem install
|
68
|
-
|
78
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_icinga2'>icinga2</span>
|
79
|
+
</code></pre>
|
69
80
|
|
70
81
|
<h2 id="label-usage">usage</h2>
|
71
82
|
|
72
|
-
<p>create an instance
|
83
|
+
<p>create an instance</p>
|
73
84
|
|
74
85
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_config'>config</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
75
86
|
<span class='symbol'>:icinga</span> <span class='op'>=></span> <span class='lbrace'>{</span>
|
@@ -84,141 +95,183 @@ gem install json --no-rdoc --no-ri</code></pre>
|
|
84
95
|
<span class='rbrace'>}</span>
|
85
96
|
<span class='rbrace'>}</span>
|
86
97
|
|
87
|
-
<span class='
|
88
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_application_data'>application_data</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
98
|
+
<span class='ivar'>@icinga</span> <span class='op'>=</span> <span class='const'>Icinga</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='id identifier rubyid_config'>config</span> <span class='rparen'>)</span>
|
89
99
|
</code></pre>
|
90
100
|
|
91
101
|
<h2 id="label-Status">Status</h2>
|
92
102
|
|
93
103
|
<p>supports the following API Calls:</p>
|
94
104
|
<ul><li>
|
95
|
-
<p><a href="doc/
|
105
|
+
<p><a href="doc/users.md">Users</a></p>
|
96
106
|
<ul><li>
|
97
|
-
<p>
|
107
|
+
<p><a href="doc/users.md#add-user">add user</a></p>
|
98
108
|
</li><li>
|
99
|
-
<p>
|
109
|
+
<p><a href="doc/users.md#delete-dser">delete user</a></p>
|
100
110
|
</li><li>
|
101
|
-
<p>
|
111
|
+
<p><a href="doc/users.md#list-users">list users</a></p>
|
102
112
|
</li><li>
|
103
|
-
<p>
|
113
|
+
<p><a href="doc/users.md#user-exists">check if user exists</a></p>
|
104
114
|
</li><li>
|
105
|
-
<p>
|
115
|
+
<p><a href="doc/users.md#add-user">add user</a></p>
|
106
116
|
</li><li>
|
107
|
-
<p>
|
108
|
-
</li></ul>
|
117
|
+
<p><a href="doc/users.md#delete-dser">delete user</a></p>
|
109
118
|
</li><li>
|
110
|
-
<p><a href="doc/users.md">
|
111
|
-
<ul><li>
|
112
|
-
<p>add_user( params = {} )</p>
|
119
|
+
<p><a href="doc/users.md#list-users">list users</a></p>
|
113
120
|
</li><li>
|
114
|
-
<p>
|
115
|
-
</li><li>
|
116
|
-
<p>users( params = {} )</p>
|
117
|
-
</li><li>
|
118
|
-
<p>exists_user?( name )</p>
|
121
|
+
<p><a href="doc/users.md#user-exists">check if user exists</a></p>
|
119
122
|
</li></ul>
|
120
123
|
</li><li>
|
121
124
|
<p><a href="doc/usergroups.md">Usergroups</a></p>
|
122
125
|
<ul><li>
|
123
|
-
<p
|
126
|
+
<p><a href="doc/usergroups.md#add-usergroup">add usergroup</a></p>
|
124
127
|
</li><li>
|
125
|
-
<p
|
128
|
+
<p><a href="doc/usergroups.md#delete-usergroup">delete usergroup</a></p>
|
126
129
|
</li><li>
|
127
|
-
<p
|
130
|
+
<p><a href="doc/usergroups.md#list-usergroups">list usergroups</a></p>
|
128
131
|
</li><li>
|
129
|
-
<p>
|
132
|
+
<p><a href="doc/usergroups.md#usergroup-exists">check if usergroup exists</a></p>
|
130
133
|
</li></ul>
|
131
134
|
</li><li>
|
132
135
|
<p><a href="doc/hosts.md">Hosts</a></p>
|
133
136
|
<ul><li>
|
134
|
-
<p
|
137
|
+
<p><a href="doc/hosts.md#add-host">add host</a></p>
|
138
|
+
</li><li>
|
139
|
+
<p><a href="doc/hosts.md#delete-host">delete host</a></p>
|
135
140
|
</li><li>
|
136
|
-
<p
|
141
|
+
<p><a href="doc/hosts.md#list-hosts">list hosts</a></p>
|
137
142
|
</li><li>
|
138
|
-
<p>
|
143
|
+
<p><a href="doc/hosts.md#host-exists">check if host exists</a></p>
|
139
144
|
</li><li>
|
140
|
-
<p>
|
145
|
+
<p><a href="doc/hosts.md#list-host-objects">list host objects</a></p>
|
141
146
|
</li><li>
|
142
|
-
<p
|
147
|
+
<p><a href="doc/hosts.md#hosts-adjusted">adjusted hosts state</a></p>
|
143
148
|
</li><li>
|
144
|
-
<p>
|
149
|
+
<p><a href="doc/hosts.md#count-hosts-with-problems">count of hosts with
|
150
|
+
problems</a></p>
|
145
151
|
</li><li>
|
146
|
-
<p>
|
152
|
+
<p><a href="doc/hosts.md#list-hosts-with-problems">list of hosts with
|
153
|
+
problems</a></p>
|
147
154
|
</li><li>
|
148
|
-
<p>
|
155
|
+
<p><a href="doc/hosts.md#count-all-hosts">count of all hosts</a></p>
|
156
|
+
</li><li>
|
157
|
+
<p><a href="doc/hosts.md#count-host-problems">count hosts with problems</a></p>
|
158
|
+
</li><li>
|
159
|
+
<p>calculate host severity (protected)</p>
|
149
160
|
</li></ul>
|
150
161
|
</li><li>
|
151
162
|
<p><a href="doc/hostgroups.md">Hostgroups</a></p>
|
152
163
|
<ul><li>
|
153
|
-
<p
|
164
|
+
<p><a href="doc/hostgroups.md#add-usergroup">add hostgroup</a></p>
|
154
165
|
</li><li>
|
155
|
-
<p
|
166
|
+
<p><a href="doc/hostgroups.md#delete-usergroup">delete hostgroup</a></p>
|
156
167
|
</li><li>
|
157
|
-
<p
|
168
|
+
<p><a href="doc/hostgroups.md#list-usergroups">list hostgroups</a></p>
|
158
169
|
</li><li>
|
159
|
-
<p>
|
170
|
+
<p><a href="doc/hostgroups.md#usergroup-exists">check if hostgroup exists</a></p>
|
160
171
|
</li></ul>
|
161
172
|
</li><li>
|
162
173
|
<p><a href="doc/services.md">Services</a></p>
|
163
174
|
<ul><li>
|
164
|
-
<p
|
175
|
+
<p><a href="doc/services.md#add-service">add service</a> (<strong>this
|
176
|
+
function is not operable yet!</strong>)</p>
|
177
|
+
</li><li>
|
178
|
+
<p><a href="doc/services.md#delete-service">delete service</a> (<strong>not
|
179
|
+
yet implemented</strong>)</p>
|
180
|
+
</li><li>
|
181
|
+
<p><a href="doc/services.md#add-service">add service</a> (<strong>this
|
182
|
+
function is not operable yet!</strong>)</p>
|
183
|
+
</li><li>
|
184
|
+
<p><a href="doc/services.md#unhandled-services">list unhandled services</a>
|
185
|
+
(<strong>not yet implemented</strong>)</p>
|
186
|
+
</li><li>
|
187
|
+
<p><a href="doc/services.md#list-services">list services</a></p>
|
188
|
+
</li><li>
|
189
|
+
<p><a href="doc/services.md#service-exists">check if service exists</a></p>
|
165
190
|
</li><li>
|
166
|
-
<p
|
191
|
+
<p><a href="doc/services.md#list-service-objects">list service objects</a></p>
|
167
192
|
</li><li>
|
168
|
-
<p
|
193
|
+
<p><a href="doc/services.md#services-adjusted">adjusted service state</a></p>
|
169
194
|
</li><li>
|
170
|
-
<p
|
195
|
+
<p><a href="doc/services.md#count-services-with-problems">count services with
|
196
|
+
problems</a></p>
|
171
197
|
</li><li>
|
172
|
-
<p>
|
198
|
+
<p><a href="doc/services.md#list-services-with-problems">list of services with
|
199
|
+
problems</a></p>
|
173
200
|
</li><li>
|
174
|
-
<p>
|
201
|
+
<p><a href="doc/services.md#update-host">update host</a> (<strong>this
|
202
|
+
function is not operable yet!</strong>)</p>
|
175
203
|
</li><li>
|
176
|
-
<p>
|
204
|
+
<p><a href="doc/services.md#count-all-services">count of all services</a></p>
|
177
205
|
</li><li>
|
178
|
-
<p>
|
206
|
+
<p><a href="doc/services.md#count-all-services-handled">count all services
|
207
|
+
with handled problems</a></p>
|
179
208
|
</li><li>
|
180
|
-
<p>
|
209
|
+
<p>calculate service severity (protected)</p>
|
181
210
|
</li></ul>
|
182
211
|
</li><li>
|
183
212
|
<p><a href="doc/servicegroups.md">Servicegroups</a></p>
|
184
213
|
<ul><li>
|
185
|
-
<p
|
214
|
+
<p><a href="doc/servicegroups.md#add-servicegroup">add servicegroup</a></p>
|
186
215
|
</li><li>
|
187
|
-
<p
|
216
|
+
<p><a href="doc/servicegroups.md#delete-servicegroup">delete servicegroup</a></p>
|
188
217
|
</li><li>
|
189
|
-
<p
|
218
|
+
<p><a href="doc/servicegroups.md#list-servicegroup">list servicegroups</a></p>
|
190
219
|
</li><li>
|
191
|
-
<p>
|
220
|
+
<p><a href="doc/servicegroups.md#servicegroup-exists">check if servicegroup
|
221
|
+
exists</a></p>
|
192
222
|
</li></ul>
|
193
223
|
</li><li>
|
194
224
|
<p><a href="doc/downtimes.md">Downtimes</a></p>
|
195
225
|
<ul><li>
|
196
|
-
<p
|
226
|
+
<p><a href="doc/downtimes.md#add-downtime">add downtime</a></p>
|
197
227
|
</li><li>
|
198
|
-
<p
|
228
|
+
<p><a href="doc/downtimes.md#list-downtimes">list downtimes</a></p>
|
199
229
|
</li></ul>
|
200
230
|
</li><li>
|
201
231
|
<p><a href="doc/notifications.md">Notifications</a></p>
|
202
232
|
<ul><li>
|
203
|
-
<p>
|
233
|
+
<p><a href="doc/notifications.md#enable-host-notification">enable host
|
234
|
+
notifications</a></p>
|
204
235
|
</li><li>
|
205
|
-
<p>
|
236
|
+
<p><a href="doc/notifications.md#disable-host-notification">disable host
|
237
|
+
notifications</a></p>
|
206
238
|
</li><li>
|
207
|
-
<p
|
239
|
+
<p><a href="doc/notifications.md#enable-service-notification">enable service
|
240
|
+
notifications</a></p>
|
208
241
|
</li><li>
|
209
|
-
<p>
|
242
|
+
<p><a href="doc/notifications.md#disable-service-notification">disable service
|
243
|
+
notifications</a></p>
|
210
244
|
</li><li>
|
211
|
-
<p
|
245
|
+
<p><a href="doc/notifications.md#enable-hostgroup-notification">enable
|
246
|
+
hostgroup notifications</a></p>
|
212
247
|
</li><li>
|
213
|
-
<p
|
248
|
+
<p><a href="doc/notifications.md#disable-hostgroup-notification">disable
|
249
|
+
hostgroup notifications</a></p>
|
250
|
+
</li><li>
|
251
|
+
<p><a href="doc/notifications.md#list-notifications">list all
|
252
|
+
notifications</a></p>
|
253
|
+
</li><li>
|
254
|
+
<p>host notification (protected)</p>
|
255
|
+
</li><li>
|
256
|
+
<p>hostgroup notification (protected)</p>
|
257
|
+
</li><li>
|
258
|
+
<p>service notification (protected)</p>
|
259
|
+
</li></ul>
|
260
|
+
</li><li>
|
261
|
+
<p><a href="doc/statistics.md">Statistics</a></p>
|
262
|
+
<ul><li>
|
263
|
+
<p><a href="doc/statistics.md#stats-avg">statistic data for latence and
|
264
|
+
execution time</a></p>
|
214
265
|
</li><li>
|
215
|
-
<p>
|
266
|
+
<p><a href="doc/statistics.md#stats-interval">statistic data for interval
|
267
|
+
data</a></p>
|
216
268
|
</li><li>
|
217
|
-
<p>
|
269
|
+
<p><a href="doc/statistics.md#stats-services">statistic data for services</a></p>
|
218
270
|
</li><li>
|
219
|
-
<p>
|
271
|
+
<p><a href="doc/statistics.md#stats-hosts">statistic data for hosts</a></p>
|
220
272
|
</li><li>
|
221
|
-
<p>
|
273
|
+
<p><a href="doc/statistics.md#stats-work-queue">queue statistics from the
|
274
|
+
api</a></p>
|
222
275
|
</li></ul>
|
223
276
|
</li></ul>
|
224
277
|
|
@@ -238,8 +291,7 @@ Successfully installed icinga2-0.6.0
|
|
238
291
|
|
239
292
|
<h2 id="label-test+via+CLI">test via CLI</h2>
|
240
293
|
|
241
|
-
<pre class="code ruby"><code class="ruby">#$
|
242
|
-
#$ irb
|
294
|
+
<pre class="code ruby"><code class="ruby">#$ irb
|
243
295
|
2.3.0 :001 > require 'icinga2'
|
244
296
|
=> true
|
245
297
|
2.3.0 :002 > config = { :icinga => { :host => 'localhost', :api => { :user => 'root', :pass => 'icinga' } } }
|
@@ -268,7 +320,7 @@ feature'</code>)</p>
|
|
268
320
|
</div></div>
|
269
321
|
|
270
322
|
<div id="footer">
|
271
|
-
Generated on
|
323
|
+
Generated on Tue Aug 22 11:29:51 2017 by
|
272
324
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
273
325
|
0.9.9 (ruby-2.3.4).
|
274
326
|
</div>
|