icinga2 0.8.1.2 → 0.9.0.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/README.md +16 -7
- data/doc/Array.html +202 -0
- data/doc/Boolean.html +124 -0
- data/doc/FalseClass.html +134 -0
- data/doc/Hash.html +214 -0
- data/doc/Icinga2.html +10 -8
- data/doc/Logging.html +10 -8
- data/doc/Object.html +288 -0
- data/doc/Time.html +202 -0
- data/doc/TrueClass.html +134 -0
- data/doc/_index.html +77 -23
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +75 -58
- data/doc/frames.html +1 -1
- data/doc/index.html +75 -58
- data/doc/method_list.html +126 -54
- data/doc/services.md +34 -16
- data/doc/top-level-namespace.html +9 -5
- data/examples/test.rb +75 -14
- data/lib/icinga2.rb +16 -1
- data/lib/icinga2/network.rb +8 -6
- data/lib/icinga2/services.rb +243 -65
- data/lib/icinga2/version.rb +3 -3
- metadata +10 -3
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::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='
|
46
|
+
<li id='object_Array' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li><li id='object_Boolean' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Boolean.html" title="Boolean (module)">Boolean</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_FalseClass' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="FalseClass.html" title="FalseClass (class)">FalseClass</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li><li id='object_Hash' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Hash.html" title="Hash (class)">Hash</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li><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></ul></li><li id='object_Logging' class='even'><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><li id='object_Object' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span> < BasicObject<small class='search_info'>Top Level Namespace</small></div></li><li id='object_Time' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Time.html" title="Time (class)">Time</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li><li id='object_TrueClass' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="TrueClass.html" title="TrueClass (class)">TrueClass</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li>
|
47
47
|
|
48
48
|
</ul>
|
49
49
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</head>
|
29
29
|
<body>
|
30
30
|
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="file_list.html
|
31
|
+
<iframe id="nav" src="file_list.html"></iframe>
|
32
32
|
<div id="resizer"></div>
|
33
33
|
</div>
|
34
34
|
|
@@ -57,28 +57,44 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
+
<iframe id="search_frame" src="file_list.html"></iframe>
|
61
|
+
|
60
62
|
<div id="content"><div id='filecontents'>
|
61
63
|
<h1 id="label-ruby-icinga2">ruby-icinga2</h1>
|
62
64
|
|
63
|
-
<p>
|
65
|
+
<p>An enhanced ruby gem to communicate with Icinga2 API</p>
|
66
|
+
|
67
|
+
<p><a href="https://badge.fury.io/rb/icinga2"><img
|
68
|
+
src="https://badge.fury.io/rb/icinga2.svg"></a></p>
|
69
|
+
|
70
|
+
<p><a href="https://travis-ci.org/bodsch/ruby-icinga2"><img
|
71
|
+
src="https://travis-ci.org/bodsch/ruby-icinga2.svg"></a> <a
|
72
|
+
href="http://ruby-gem-downloads-badge.herokuapp.com/icinga2"><img
|
73
|
+
src="http://ruby-gem-downloads-badge.herokuapp.com/icinga2"></a> <a
|
74
|
+
href="http://ruby-gem-downloads-badge.herokuapp.com/icinga2"><img
|
75
|
+
src="http://ruby-gem-downloads-badge.herokuapp.com/icinga2?type=total&metric=true&label=downloads-total"></a>
|
76
|
+
<a href="https://gemnasium.com/github.com/bodsch/ruby-icinga2"><img
|
77
|
+
src="https://gemnasium.com/badges/github.com/bodsch/ruby-icinga2.svg"></a></p>
|
64
78
|
|
65
79
|
<h2 id="label-Requirements">Requirements</h2>
|
66
80
|
<ul><li>
|
67
|
-
<p>ruby version
|
81
|
+
<p>ruby version => 2.0</p>
|
68
82
|
</li><li>
|
69
83
|
<p>rest-client ~> 2.0</p>
|
70
84
|
</li><li>
|
71
|
-
<p>openssl ~> 2.0</p>
|
72
|
-
</li><li>
|
73
85
|
<p>json ~> 2.1</p>
|
86
|
+
</li><li>
|
87
|
+
<p>openssl ~> 2.0 (only with ruby >= 2.3)</p>
|
88
|
+
</li><li>
|
89
|
+
<p>ruby_dig (only with ruby < 2.3)</p>
|
74
90
|
</li></ul>
|
75
91
|
|
76
|
-
<h2 id="label-
|
92
|
+
<h2 id="label-Install">Install</h2>
|
77
93
|
|
78
94
|
<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
95
|
</code></pre>
|
80
96
|
|
81
|
-
<h2 id="label-
|
97
|
+
<h2 id="label-Usage">Usage</h2>
|
82
98
|
|
83
99
|
<p>create an instance</p>
|
84
100
|
|
@@ -89,15 +105,56 @@
|
|
89
105
|
<span class='symbol'>:port</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaApiPort'>icingaApiPort</span><span class='comma'>,</span>
|
90
106
|
<span class='symbol'>:user</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaApiUser'>icingaApiUser</span><span class='comma'>,</span>
|
91
107
|
<span class='symbol'>:pass</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaApiPass'>icingaApiPass</span>
|
92
|
-
<span class='rbrace'>}</span
|
93
|
-
<span class='symbol'>:cluster</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaCluster'>icingaCluster</span><span class='comma'>,</span>
|
94
|
-
<span class='symbol'>:satellite</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaSatellite'>icingaSatellite</span><span class='comma'>,</span>
|
108
|
+
<span class='rbrace'>}</span>
|
95
109
|
<span class='rbrace'>}</span>
|
96
110
|
<span class='rbrace'>}</span>
|
97
111
|
|
98
112
|
<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>
|
99
113
|
</code></pre>
|
100
114
|
|
115
|
+
<h3 id="label-Use+the+examples">Use the examples</h3>
|
116
|
+
|
117
|
+
<p>You can use the <a href="https://github.com/Icinga/icinga-vagrant">Icinga
|
118
|
+
Vagrant-Box</a> from the Icinga Team or my own <a
|
119
|
+
href="https://hub.docker.com/r/bodsch/docker-icinga2/">Docker Container</a>
|
120
|
+
as Datasource.</p>
|
121
|
+
|
122
|
+
<p><strong>Remember</strong> Change the exported Environment Variables to your
|
123
|
+
choosed Datasource!</p>
|
124
|
+
|
125
|
+
<p>you can find many examples under the directory <code>examples</code>:</p>
|
126
|
+
|
127
|
+
<pre class="code ruby"><code class="ruby"><span class='comment'>#$ export ICINGA_HOST=localhost ; export ICINGA_API_USER=root ; export ICINGA_API_PASSWORD=icinga
|
128
|
+
</span><span class='comment'>#$ ruby examples/informations.rb
|
129
|
+
</span><span class='comment'>#$ ruby examples/statistics.rb
|
130
|
+
</span><span class='comment'>#$ ruby examples/users.rb
|
131
|
+
</span></code></pre>
|
132
|
+
|
133
|
+
<p>and so on.</p>
|
134
|
+
|
135
|
+
<h3 id="label-Test+via+CLI">Test via CLI</h3>
|
136
|
+
|
137
|
+
<pre class="code ruby"><code class="ruby">#$ irb
|
138
|
+
2.3.0 :001 > require 'icinga2'
|
139
|
+
=> true
|
140
|
+
2.3.0 :002 > config = { :icinga => { :host => 'localhost', :api => { :user => 'root', :pass => 'icinga' } } }
|
141
|
+
=> {:icinga=>{:host=>"localhost", :api=>{:user=>"root", :pass=>"icinga"}}}
|
142
|
+
2.3.0 :003 > i = Icinga2::Client.new( config )</code></pre>
|
143
|
+
|
144
|
+
<h2 id="label-Create+a+own+gem+file">Create a own gem file</h2>
|
145
|
+
|
146
|
+
<pre class="code ruby"><code class="ruby">#$ gem build icinga2.gemspec
|
147
|
+
Successfully built RubyGem
|
148
|
+
Name: icinga2
|
149
|
+
Version: 0.9.0
|
150
|
+
File: icinga2-0.9.0.gem</code></pre>
|
151
|
+
|
152
|
+
<h2 id="label-Install+local+gem">Install local gem</h2>
|
153
|
+
|
154
|
+
<pre class="code ruby"><code class="ruby">#$ gem install icinga2
|
155
|
+
Successfully installed icinga2-0.9.0
|
156
|
+
1 gem installed</code></pre>
|
157
|
+
|
101
158
|
<h2 id="label-Status">Status</h2>
|
102
159
|
|
103
160
|
<p>supports the following API Calls:</p>
|
@@ -144,8 +201,6 @@
|
|
144
201
|
</li><li>
|
145
202
|
<p><a href="doc/hosts.md#list-host-objects">list host objects</a></p>
|
146
203
|
</li><li>
|
147
|
-
<p><a href="doc/hosts.md#hosts-adjusted">adjusted hosts state</a></p>
|
148
|
-
</li><li>
|
149
204
|
<p><a href="doc/hosts.md#count-hosts-with-problems">count of hosts with
|
150
205
|
problems</a></p>
|
151
206
|
</li><li>
|
@@ -172,17 +227,11 @@ problems</a></p>
|
|
172
227
|
</li><li>
|
173
228
|
<p><a href="doc/services.md">Services</a></p>
|
174
229
|
<ul><li>
|
175
|
-
<p><a href="doc/services.md#add-service">add service</a>
|
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>
|
230
|
+
<p><a href="doc/services.md#add-service">add service</a></p>
|
180
231
|
</li><li>
|
181
|
-
<p><a href="doc/services.md#
|
182
|
-
function is not operable yet!</strong>)</p>
|
232
|
+
<p><a href="doc/services.md#delete-service">delete service</a></p>
|
183
233
|
</li><li>
|
184
|
-
<p><a href="doc/services.md#unhandled-services">list unhandled services</a>
|
185
|
-
(<strong>not yet implemented</strong>)</p>
|
234
|
+
<p><a href="doc/services.md#unhandled-services">list unhandled services</a></p>
|
186
235
|
</li><li>
|
187
236
|
<p><a href="doc/services.md#list-services">list services</a></p>
|
188
237
|
</li><li>
|
@@ -190,23 +239,20 @@ function is not operable yet!</strong>)</p>
|
|
190
239
|
</li><li>
|
191
240
|
<p><a href="doc/services.md#list-service-objects">list service objects</a></p>
|
192
241
|
</li><li>
|
193
|
-
<p><a href="doc/services.md#services-adjusted">adjusted service state</a></p>
|
194
|
-
</li><li>
|
195
242
|
<p><a href="doc/services.md#count-services-with-problems">count services with
|
196
243
|
problems</a></p>
|
197
244
|
</li><li>
|
198
245
|
<p><a href="doc/services.md#list-services-with-problems">list of services with
|
199
246
|
problems</a></p>
|
200
247
|
</li><li>
|
201
|
-
<p><a href="doc/services.md#update-host">update host</a> (<strong>this
|
202
|
-
function is not operable yet!</strong>)</p>
|
203
|
-
</li><li>
|
204
248
|
<p><a href="doc/services.md#count-all-services">count of all services</a></p>
|
205
249
|
</li><li>
|
206
250
|
<p><a href="doc/services.md#count-all-services-handled">count all services
|
207
251
|
with handled problems</a></p>
|
208
252
|
</li><li>
|
209
253
|
<p>calculate service severity (protected)</p>
|
254
|
+
</li><li>
|
255
|
+
<p>update host (private)</p>
|
210
256
|
</li></ul>
|
211
257
|
</li><li>
|
212
258
|
<p><a href="doc/servicegroups.md">Servicegroups</a></p>
|
@@ -275,35 +321,6 @@ api</a></p>
|
|
275
321
|
</li></ul>
|
276
322
|
</li></ul>
|
277
323
|
|
278
|
-
<h2 id="label-create+a+own+gem+File">create a own gem File</h2>
|
279
|
-
|
280
|
-
<pre class="code ruby"><code class="ruby">#$ gem build icinga2.gemspec
|
281
|
-
Successfully built RubyGem
|
282
|
-
Name: icinga2
|
283
|
-
Version: 0.6.0
|
284
|
-
File: icinga2-0.6.0.gem</code></pre>
|
285
|
-
|
286
|
-
<h2 id="label-install+gem">install gem</h2>
|
287
|
-
|
288
|
-
<pre class="code ruby"><code class="ruby">#$ gem install icinga2
|
289
|
-
Successfully installed icinga2-0.6.0
|
290
|
-
1 gem installed</code></pre>
|
291
|
-
|
292
|
-
<h2 id="label-test+via+CLI">test via CLI</h2>
|
293
|
-
|
294
|
-
<pre class="code ruby"><code class="ruby">#$ irb
|
295
|
-
2.3.0 :001 > require 'icinga2'
|
296
|
-
=> true
|
297
|
-
2.3.0 :002 > config = { :icinga => { :host => 'localhost', :api => { :user => 'root', :pass => 'icinga' } } }
|
298
|
-
=> {:icinga=>{:host=>"localhost", :api=>{:user=>"root", :pass=>"icinga"}}}
|
299
|
-
2.3.0 :003 > i = Icinga2::Client.new( config )</code></pre>
|
300
|
-
|
301
|
-
<h2 id="label-test+via+example">test via example</h2>
|
302
|
-
|
303
|
-
<pre class="code ruby"><code class="ruby"><span class='comment'>#$ export ICINGA_HOST=localhost ; export ICINGA_API_USER=root ; export ICINGA_API_PASSWORD=icinga
|
304
|
-
</span><span class='comment'>#$ ruby examples/test.rb
|
305
|
-
</span></code></pre>
|
306
|
-
|
307
324
|
<h2 id="label-Contributing">Contributing</h2>
|
308
325
|
<ol><li>
|
309
326
|
<p>Fork it</p>
|
@@ -320,9 +337,9 @@ feature'</code>)</p>
|
|
320
337
|
</div></div>
|
321
338
|
|
322
339
|
<div id="footer">
|
323
|
-
Generated on
|
340
|
+
Generated on Sun Nov 12 15:48:13 2017 by
|
324
341
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
325
|
-
0.9.
|
342
|
+
0.9.4 (ruby-2.2.8).
|
326
343
|
</div>
|
327
344
|
|
328
345
|
</div>
|
data/doc/frames.html
CHANGED
data/doc/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</head>
|
29
29
|
<body>
|
30
30
|
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="class_list.html
|
31
|
+
<iframe id="nav" src="class_list.html"></iframe>
|
32
32
|
<div id="resizer"></div>
|
33
33
|
</div>
|
34
34
|
|
@@ -57,28 +57,44 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
61
|
+
|
60
62
|
<div id="content"><div id='filecontents'>
|
61
63
|
<h1 id="label-ruby-icinga2">ruby-icinga2</h1>
|
62
64
|
|
63
|
-
<p>
|
65
|
+
<p>An enhanced ruby gem to communicate with Icinga2 API</p>
|
66
|
+
|
67
|
+
<p><a href="https://badge.fury.io/rb/icinga2"><img
|
68
|
+
src="https://badge.fury.io/rb/icinga2.svg"></a></p>
|
69
|
+
|
70
|
+
<p><a href="https://travis-ci.org/bodsch/ruby-icinga2"><img
|
71
|
+
src="https://travis-ci.org/bodsch/ruby-icinga2.svg"></a> <a
|
72
|
+
href="http://ruby-gem-downloads-badge.herokuapp.com/icinga2"><img
|
73
|
+
src="http://ruby-gem-downloads-badge.herokuapp.com/icinga2"></a> <a
|
74
|
+
href="http://ruby-gem-downloads-badge.herokuapp.com/icinga2"><img
|
75
|
+
src="http://ruby-gem-downloads-badge.herokuapp.com/icinga2?type=total&metric=true&label=downloads-total"></a>
|
76
|
+
<a href="https://gemnasium.com/github.com/bodsch/ruby-icinga2"><img
|
77
|
+
src="https://gemnasium.com/badges/github.com/bodsch/ruby-icinga2.svg"></a></p>
|
64
78
|
|
65
79
|
<h2 id="label-Requirements">Requirements</h2>
|
66
80
|
<ul><li>
|
67
|
-
<p>ruby version
|
81
|
+
<p>ruby version => 2.0</p>
|
68
82
|
</li><li>
|
69
83
|
<p>rest-client ~> 2.0</p>
|
70
84
|
</li><li>
|
71
|
-
<p>openssl ~> 2.0</p>
|
72
|
-
</li><li>
|
73
85
|
<p>json ~> 2.1</p>
|
86
|
+
</li><li>
|
87
|
+
<p>openssl ~> 2.0 (only with ruby >= 2.3)</p>
|
88
|
+
</li><li>
|
89
|
+
<p>ruby_dig (only with ruby < 2.3)</p>
|
74
90
|
</li></ul>
|
75
91
|
|
76
|
-
<h2 id="label-
|
92
|
+
<h2 id="label-Install">Install</h2>
|
77
93
|
|
78
94
|
<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
95
|
</code></pre>
|
80
96
|
|
81
|
-
<h2 id="label-
|
97
|
+
<h2 id="label-Usage">Usage</h2>
|
82
98
|
|
83
99
|
<p>create an instance</p>
|
84
100
|
|
@@ -89,15 +105,56 @@
|
|
89
105
|
<span class='symbol'>:port</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaApiPort'>icingaApiPort</span><span class='comma'>,</span>
|
90
106
|
<span class='symbol'>:user</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaApiUser'>icingaApiUser</span><span class='comma'>,</span>
|
91
107
|
<span class='symbol'>:pass</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaApiPass'>icingaApiPass</span>
|
92
|
-
<span class='rbrace'>}</span
|
93
|
-
<span class='symbol'>:cluster</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaCluster'>icingaCluster</span><span class='comma'>,</span>
|
94
|
-
<span class='symbol'>:satellite</span> <span class='op'>=></span> <span class='id identifier rubyid_icingaSatellite'>icingaSatellite</span><span class='comma'>,</span>
|
108
|
+
<span class='rbrace'>}</span>
|
95
109
|
<span class='rbrace'>}</span>
|
96
110
|
<span class='rbrace'>}</span>
|
97
111
|
|
98
112
|
<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>
|
99
113
|
</code></pre>
|
100
114
|
|
115
|
+
<h3 id="label-Use+the+examples">Use the examples</h3>
|
116
|
+
|
117
|
+
<p>You can use the <a href="https://github.com/Icinga/icinga-vagrant">Icinga
|
118
|
+
Vagrant-Box</a> from the Icinga Team or my own <a
|
119
|
+
href="https://hub.docker.com/r/bodsch/docker-icinga2/">Docker Container</a>
|
120
|
+
as Datasource.</p>
|
121
|
+
|
122
|
+
<p><strong>Remember</strong> Change the exported Environment Variables to your
|
123
|
+
choosed Datasource!</p>
|
124
|
+
|
125
|
+
<p>you can find many examples under the directory <code>examples</code>:</p>
|
126
|
+
|
127
|
+
<pre class="code ruby"><code class="ruby"><span class='comment'>#$ export ICINGA_HOST=localhost ; export ICINGA_API_USER=root ; export ICINGA_API_PASSWORD=icinga
|
128
|
+
</span><span class='comment'>#$ ruby examples/informations.rb
|
129
|
+
</span><span class='comment'>#$ ruby examples/statistics.rb
|
130
|
+
</span><span class='comment'>#$ ruby examples/users.rb
|
131
|
+
</span></code></pre>
|
132
|
+
|
133
|
+
<p>and so on.</p>
|
134
|
+
|
135
|
+
<h3 id="label-Test+via+CLI">Test via CLI</h3>
|
136
|
+
|
137
|
+
<pre class="code ruby"><code class="ruby">#$ irb
|
138
|
+
2.3.0 :001 > require 'icinga2'
|
139
|
+
=> true
|
140
|
+
2.3.0 :002 > config = { :icinga => { :host => 'localhost', :api => { :user => 'root', :pass => 'icinga' } } }
|
141
|
+
=> {:icinga=>{:host=>"localhost", :api=>{:user=>"root", :pass=>"icinga"}}}
|
142
|
+
2.3.0 :003 > i = Icinga2::Client.new( config )</code></pre>
|
143
|
+
|
144
|
+
<h2 id="label-Create+a+own+gem+file">Create a own gem file</h2>
|
145
|
+
|
146
|
+
<pre class="code ruby"><code class="ruby">#$ gem build icinga2.gemspec
|
147
|
+
Successfully built RubyGem
|
148
|
+
Name: icinga2
|
149
|
+
Version: 0.9.0
|
150
|
+
File: icinga2-0.9.0.gem</code></pre>
|
151
|
+
|
152
|
+
<h2 id="label-Install+local+gem">Install local gem</h2>
|
153
|
+
|
154
|
+
<pre class="code ruby"><code class="ruby">#$ gem install icinga2
|
155
|
+
Successfully installed icinga2-0.9.0
|
156
|
+
1 gem installed</code></pre>
|
157
|
+
|
101
158
|
<h2 id="label-Status">Status</h2>
|
102
159
|
|
103
160
|
<p>supports the following API Calls:</p>
|
@@ -144,8 +201,6 @@
|
|
144
201
|
</li><li>
|
145
202
|
<p><a href="doc/hosts.md#list-host-objects">list host objects</a></p>
|
146
203
|
</li><li>
|
147
|
-
<p><a href="doc/hosts.md#hosts-adjusted">adjusted hosts state</a></p>
|
148
|
-
</li><li>
|
149
204
|
<p><a href="doc/hosts.md#count-hosts-with-problems">count of hosts with
|
150
205
|
problems</a></p>
|
151
206
|
</li><li>
|
@@ -172,17 +227,11 @@ problems</a></p>
|
|
172
227
|
</li><li>
|
173
228
|
<p><a href="doc/services.md">Services</a></p>
|
174
229
|
<ul><li>
|
175
|
-
<p><a href="doc/services.md#add-service">add service</a>
|
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>
|
230
|
+
<p><a href="doc/services.md#add-service">add service</a></p>
|
180
231
|
</li><li>
|
181
|
-
<p><a href="doc/services.md#
|
182
|
-
function is not operable yet!</strong>)</p>
|
232
|
+
<p><a href="doc/services.md#delete-service">delete service</a></p>
|
183
233
|
</li><li>
|
184
|
-
<p><a href="doc/services.md#unhandled-services">list unhandled services</a>
|
185
|
-
(<strong>not yet implemented</strong>)</p>
|
234
|
+
<p><a href="doc/services.md#unhandled-services">list unhandled services</a></p>
|
186
235
|
</li><li>
|
187
236
|
<p><a href="doc/services.md#list-services">list services</a></p>
|
188
237
|
</li><li>
|
@@ -190,23 +239,20 @@ function is not operable yet!</strong>)</p>
|
|
190
239
|
</li><li>
|
191
240
|
<p><a href="doc/services.md#list-service-objects">list service objects</a></p>
|
192
241
|
</li><li>
|
193
|
-
<p><a href="doc/services.md#services-adjusted">adjusted service state</a></p>
|
194
|
-
</li><li>
|
195
242
|
<p><a href="doc/services.md#count-services-with-problems">count services with
|
196
243
|
problems</a></p>
|
197
244
|
</li><li>
|
198
245
|
<p><a href="doc/services.md#list-services-with-problems">list of services with
|
199
246
|
problems</a></p>
|
200
247
|
</li><li>
|
201
|
-
<p><a href="doc/services.md#update-host">update host</a> (<strong>this
|
202
|
-
function is not operable yet!</strong>)</p>
|
203
|
-
</li><li>
|
204
248
|
<p><a href="doc/services.md#count-all-services">count of all services</a></p>
|
205
249
|
</li><li>
|
206
250
|
<p><a href="doc/services.md#count-all-services-handled">count all services
|
207
251
|
with handled problems</a></p>
|
208
252
|
</li><li>
|
209
253
|
<p>calculate service severity (protected)</p>
|
254
|
+
</li><li>
|
255
|
+
<p>update host (private)</p>
|
210
256
|
</li></ul>
|
211
257
|
</li><li>
|
212
258
|
<p><a href="doc/servicegroups.md">Servicegroups</a></p>
|
@@ -275,35 +321,6 @@ api</a></p>
|
|
275
321
|
</li></ul>
|
276
322
|
</li></ul>
|
277
323
|
|
278
|
-
<h2 id="label-create+a+own+gem+File">create a own gem File</h2>
|
279
|
-
|
280
|
-
<pre class="code ruby"><code class="ruby">#$ gem build icinga2.gemspec
|
281
|
-
Successfully built RubyGem
|
282
|
-
Name: icinga2
|
283
|
-
Version: 0.6.0
|
284
|
-
File: icinga2-0.6.0.gem</code></pre>
|
285
|
-
|
286
|
-
<h2 id="label-install+gem">install gem</h2>
|
287
|
-
|
288
|
-
<pre class="code ruby"><code class="ruby">#$ gem install icinga2
|
289
|
-
Successfully installed icinga2-0.6.0
|
290
|
-
1 gem installed</code></pre>
|
291
|
-
|
292
|
-
<h2 id="label-test+via+CLI">test via CLI</h2>
|
293
|
-
|
294
|
-
<pre class="code ruby"><code class="ruby">#$ irb
|
295
|
-
2.3.0 :001 > require 'icinga2'
|
296
|
-
=> true
|
297
|
-
2.3.0 :002 > config = { :icinga => { :host => 'localhost', :api => { :user => 'root', :pass => 'icinga' } } }
|
298
|
-
=> {:icinga=>{:host=>"localhost", :api=>{:user=>"root", :pass=>"icinga"}}}
|
299
|
-
2.3.0 :003 > i = Icinga2::Client.new( config )</code></pre>
|
300
|
-
|
301
|
-
<h2 id="label-test+via+example">test via example</h2>
|
302
|
-
|
303
|
-
<pre class="code ruby"><code class="ruby"><span class='comment'>#$ export ICINGA_HOST=localhost ; export ICINGA_API_USER=root ; export ICINGA_API_PASSWORD=icinga
|
304
|
-
</span><span class='comment'>#$ ruby examples/test.rb
|
305
|
-
</span></code></pre>
|
306
|
-
|
307
324
|
<h2 id="label-Contributing">Contributing</h2>
|
308
325
|
<ol><li>
|
309
326
|
<p>Fork it</p>
|
@@ -320,9 +337,9 @@ feature'</code>)</p>
|
|
320
337
|
</div></div>
|
321
338
|
|
322
339
|
<div id="footer">
|
323
|
-
Generated on
|
340
|
+
Generated on Sun Nov 12 15:48:13 2017 by
|
324
341
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
325
|
-
0.9.
|
342
|
+
0.9.4 (ruby-2.2.8).
|
326
343
|
</div>
|
327
344
|
|
328
345
|
</div>
|