zabby 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,6 +66,12 @@
66
66
  <li class="r2"><a href="file.LICENSE.html" title="LICENSE">LICENSE</a></li>
67
67
 
68
68
 
69
+ <li class="r1"><a href="file.TODO.html" title="TODO">TODO</a></li>
70
+
71
+
72
+ <li class="r2"><a href="file.ChangeLog.html" title="ChangeLog">ChangeLog</a></li>
73
+
74
+
69
75
  </ul>
70
76
 
71
77
  <div class="clear"></div>
@@ -149,6 +155,13 @@
149
155
  <li class="letter">Z</li>
150
156
  <ul>
151
157
 
158
+ <li>
159
+ <span class='object_link'><a href="Zabby/ZObject.html" title="Zabby::ZObject (class)">ZObject</a></span>
160
+
161
+ <small>(Zabby)</small>
162
+
163
+ </li>
164
+
152
165
  <li>
153
166
  <span class='object_link'><a href="Zabby.html" title="Zabby (module)">Zabby</a></span>
154
167
 
@@ -166,7 +179,7 @@
166
179
  </div>
167
180
 
168
181
  <div id="footer">
169
- Generated on Mon Dec 19 13:31:45 2011 by
182
+ Generated on Wed Dec 21 12:25:10 2011 by
170
183
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
171
184
  0.7.4 (ruby-1.8.7).
172
185
  </div>
@@ -39,7 +39,7 @@
39
39
 
40
40
  <ul id="full_list" class="class">
41
41
  <li><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li>
42
- <li><a class='toggle'></a> <span class='object_link'><a href="Zabby.html" title="Zabby (module)">Zabby</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Zabby/AuthenticationError.html" title="Zabby::AuthenticationError (class)">AuthenticationError</a></span> &lt; StandardError<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/Config.html" title="Zabby::Config (class)">Config</a></span> &lt; Object<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/ConfigurationError.html" title="Zabby::ConfigurationError (class)">ConfigurationError</a></span> &lt; StandardError<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/Connection.html" title="Zabby::Connection (class)">Connection</a></span> &lt; Object<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/ResponseCodeError.html" title="Zabby::ResponseCodeError (class)">ResponseCodeError</a></span> &lt; StandardError<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/Runner.html" title="Zabby::Runner (class)">Runner</a></span> &lt; Object<small class='search_info'>Zabby</small></li></ul>
42
+ <li><a class='toggle'></a> <span class='object_link'><a href="Zabby.html" title="Zabby (module)">Zabby</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Zabby/AuthenticationError.html" title="Zabby::AuthenticationError (class)">AuthenticationError</a></span> &lt; StandardError<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/Config.html" title="Zabby::Config (class)">Config</a></span> &lt; Object<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/ConfigurationError.html" title="Zabby::ConfigurationError (class)">ConfigurationError</a></span> &lt; StandardError<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/Connection.html" title="Zabby::Connection (class)">Connection</a></span> &lt; Object<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/ResponseCodeError.html" title="Zabby::ResponseCodeError (class)">ResponseCodeError</a></span> &lt; StandardError<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/Runner.html" title="Zabby::Runner (class)">Runner</a></span> &lt; Object<small class='search_info'>Zabby</small></li><li><span class='object_link'><a href="Zabby/ZObject.html" title="Zabby::ZObject (class)">ZObject</a></span> &lt; Object<small class='search_info'>Zabby</small></li></ul>
43
43
 
44
44
  </ul>
45
45
  </div>
@@ -0,0 +1,91 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=fr_fr" />
6
+ <title>
7
+ File: ChangeLog
8
+
9
+ &mdash; Documentation by YARD 0.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="_index.html" title="Index">Index</a> &raquo;
37
+ <span class="title">File: ChangeLog</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a id="class_list_link" href="#">Class List</a>
46
+
47
+ <a id="method_list_link" href="#">Method List</a>
48
+
49
+ <a id="file_list_link" href="#">File List</a>
50
+
51
+ </div>
52
+ <div class="clear"></div>
53
+ </div>
54
+
55
+ <iframe id="search_frame"></iframe>
56
+
57
+ <div id="content"><div id='filecontents'><h1>ChangeLog for Zabby</h1>
58
+ <h2>v0.0.4 (2011/12/21)</h2>
59
+ <ul>
60
+ <li>Same as v0.0.3 that I could not publish on rubygems.org
61
+
62
+ </li>
63
+ </ul>
64
+ <h2>v0.0.3 (2011/12/21)</h2>
65
+ <ul>
66
+ <li>Improve documentation and add all Zabbix API verbs
67
+
68
+ </li>
69
+ </ul>
70
+ <h2>v0.0.2 (2011/12/20)</h2>
71
+ <ul>
72
+ <li>First public release.
73
+
74
+ </li>
75
+ </ul>
76
+ <h2>v0.0.1 (2011/12/18)</h2>
77
+ <ul>
78
+ <li>Unpublished.
79
+
80
+ </li>
81
+ </ul>
82
+ </div></div>
83
+
84
+ <div id="footer">
85
+ Generated on Wed Dec 21 12:25:11 2011 by
86
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
87
+ 0.7.4 (ruby-1.8.7).
88
+ </div>
89
+
90
+ </body>
91
+ </html>
@@ -123,7 +123,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
123
123
  </div></div>
124
124
 
125
125
  <div id="footer">
126
- Generated on Mon Dec 19 13:31:45 2011 by
126
+ Generated on Wed Dec 21 12:25:11 2011 by
127
127
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
128
  0.7.4 (ruby-1.8.7).
129
129
  </div>
@@ -83,6 +83,23 @@ specific configuration language.
83
83
  <li>Simple design: avoids spaghetti code, WTF and facepalm, unlike some other
84
84
  Ruby Zabbix libraries.
85
85
 
86
+ </li>
87
+ </ul>
88
+ <h2>Features</h2>
89
+ <ul>
90
+ <li>Low level Ruby API that maps every Zabbix API (JSON RPC) to Ruby hashes.
91
+
92
+ </li>
93
+ <li>Higher level Ruby DSL, both available in pure Ruby and for writing
94
+ configuration files.
95
+
96
+ </li>
97
+ <li>Supports SSL and authenticated HTTP proxies.
98
+
99
+ </li>
100
+ <li>Full featured IRB like shell included with Readline support. You can mix
101
+ Zabbix instructions with Ruby calls transparently.
102
+
86
103
  </li>
87
104
  </ul>
88
105
  <h2>Examples</h2>
@@ -96,7 +113,7 @@ The barebone API can be used in Ruby like this:
96
113
  <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;pp&quot;</span>
97
114
 
98
115
  <span class='rubyid_z identifier id'>z</span> <span class='assign token'>=</span> <span class='rubyid_Zabby constant id'>Zabby</span><span class='dot token'>.</span><span class='rubyid_init identifier id'>init</span> <span class='rubyid_do do kw'>do</span>
99
- <span class='rubyid_host identifier id'>host</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
116
+ <span class='rubyid_server identifier id'>server</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
100
117
  <span class='rubyid_user identifier id'>user</span> <span class='string val'>&quot;api_user&quot;</span>
101
118
  <span class='rubyid_password identifier id'>password</span> <span class='string val'>&quot;s3cr3t&quot;</span>
102
119
  <span class='rubyid_proxy_host identifier id'>proxy_host</span> <span class='string val'>&quot;http://10.10.10.10&quot;</span>
@@ -109,7 +126,7 @@ The barebone API can be used in Ruby like this:
109
126
  <span class='rubyid_pp identifier id'>pp</span> <span class='rubyid_z identifier id'>z</span><span class='dot token'>.</span><span class='rubyid_connection identifier id'>connection</span><span class='dot token'>.</span><span class='rubyid_perform_request identifier id'>perform_request</span><span class='lparen token'>(</span><span class='string val'>&quot;item&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;get&quot;</span><span class='comma token'>,</span> <span class='lbrace token'>{</span> <span class='string val'>&quot;host&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;master.example.com&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;output&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;shorten&quot;</span> <span class='rbrace token'>}</span><span class='rparen token'>)</span>
110
127
  </pre>
111
128
  <ul>
112
- <li>The <em>host</em>, <em>user</em> and <em>passord</em> are necessary.
129
+ <li>The <em>server</em>, <em>user</em> and <em>passord</em> are necessary.
113
130
 
114
131
  </li>
115
132
  <li>If you don&#8217;t provide the path to the JSON-RPC script
@@ -120,27 +137,38 @@ The barebone API can be used in Ruby like this:
120
137
 
121
138
  </li>
122
139
  </ul>
123
- <h3>Shell (experimental)</h3>
140
+ <h3>Shell</h3>
124
141
  <p>
125
- <b>zabbysh</b> is an experimental Zabbix Shell. It runs either
126
- interactively or can be used to execute a command file with the &quot;-f
127
- CMD_FILE&quot; option.
142
+ <b>zabbysh</b> is an simple Zabbix Shell. It runs either interactively or
143
+ can be used to execute a command file with the &quot;-f CMD_FILE&quot;
144
+ option.
128
145
  </p>
129
146
  <p>
130
147
  If the command file does not end with &quot;exit&quot; then the program
131
148
  drops into the shell after executing the file.
132
149
  </p>
150
+ <p>
151
+ <b>zabbysh</b> provides Readline support but does no support advanced IRB
152
+ features likes multi-lines instructions.
153
+ </p>
154
+ <p>
155
+ <b>zabbyrb</b> is another Zabbix Shell based on <b>IRB</b>. It provides the
156
+ whole power of IRB but may be less stable than zabbysh because the IRB API
157
+ is poorly documented and hard to use.
158
+ </p>
133
159
  <h4>Interactive shell</h4>
134
160
  <pre class="code">
135
161
  <span class='comment val'># zabbysh</span>
136
- <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_host identifier id'>host</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
162
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_server identifier id'>server</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
137
163
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_user identifier id'>user</span> <span class='string val'>&quot;api_user&quot;</span>
138
164
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_password identifier id'>password</span> <span class='string val'>&quot;s3cr3t&quot;</span>
139
165
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_host identifier id'>proxy_host</span> <span class='string val'>&quot;http://10.10.10.10&quot;</span>
140
166
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_user identifier id'>proxy_user</span> <span class='string val'>&quot;john&quot;</span>
141
- <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_password identifier id'>proxy_password</span> <span class='string val'>&quot;prD0e&quot;</span>
167
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_password identifier id'>proxy_password</span> <span class='string val'>&quot;D0e&quot;</span>
142
168
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_login identifier id'>login</span>
143
- <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_logged_in? fid id'>logged_in?</span>
169
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_puts identifier id'>puts</span> <span class='rubyid_logged_in? fid id'>logged_in?</span>
170
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_host identifier id'>host</span><span class='dot token'>.</span><span class='rubyid_get identifier id'>get</span> <span class='string val'>&quot;filter&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrace token'>{</span> <span class='string val'>&quot;host&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;monitor.example.com&quot;</span> <span class='rbrace token'>}</span><span class='comma token'>,</span> <span class='string val'>&quot;output&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;extend&quot;</span>
171
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_item identifier id'>item</span><span class='dot token'>.</span><span class='rubyid_get identifier id'>get</span> <span class='string val'>&quot;host&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;monitor.example.com&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;output&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;refer&quot;</span>
144
172
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='dot3 op'>...</span><span class='rbrack token'>]</span>
145
173
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_logout identifier id'>logout</span>
146
174
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_exit identifier id'>exit</span>
@@ -155,10 +183,10 @@ Create a file and put the same instructions as above in it, then execute
155
183
  </pre>
156
184
  <h2>Requirements</h2>
157
185
  <ul>
158
- <li>Ruby 1.8.7. May run on Ruby 1.8.5
186
+ <li>Ruby 1.8.5. IT BASICALLY RUNS ANYWHERE!
159
187
 
160
188
  </li>
161
- <li>JSON library: json_pure
189
+ <li>JSON library: &#8216;json&#8217; or &#8216;json_pure&#8217;
162
190
 
163
191
  </li>
164
192
  <li>OptionParser
@@ -175,15 +203,24 @@ Create a file and put the same instructions as above in it, then execute
175
203
  </li>
176
204
  <li>GitHub projet: https://github.com/Pragmatic-Source/zabby
177
205
 
206
+ </li>
207
+ <li>RubyGems.org homepage: https://rubygems.org/gems/zabby
208
+
209
+ </li>
210
+ <li>Author&#8217;s company: http://www.pragmatic-source.com
211
+
178
212
  </li>
179
213
  </ul>
180
- <h2>Author</h2>
214
+ <h2>Contributing</h2>
181
215
  <p>
182
- Farzad FARID mailto:ffarid@pragmatic-source.com
216
+ All contributions are welcome. You can either open a ticket on Github, send
217
+ a pull request with a patch or send an email to the author.
183
218
  </p>
219
+ <h2>Author</h2>
184
220
  <p>
185
- Thanks to:
221
+ Farzad FARID mailto:ffarid@pragmatic-source.com
186
222
  </p>
223
+ <h3>Thanks to</h3>
187
224
  <ul>
188
225
  <li>Jean-Hadrien Chabran (jhchabran): Advices on code design.
189
226
 
@@ -225,7 +262,7 @@ LICENSE file.
225
262
  </div></div>
226
263
 
227
264
  <div id="footer">
228
- Generated on Mon Dec 19 13:31:45 2011 by
265
+ Generated on Wed Dec 21 12:25:11 2011 by
229
266
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
230
267
  0.7.4 (ruby-1.8.7).
231
268
  </div>
@@ -0,0 +1,99 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=fr_fr" />
6
+ <title>
7
+ File: TODO
8
+
9
+ &mdash; Documentation by YARD 0.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="_index.html" title="Index">Index</a> &raquo;
37
+ <span class="title">File: TODO</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a id="class_list_link" href="#">Class List</a>
46
+
47
+ <a id="method_list_link" href="#">Method List</a>
48
+
49
+ <a id="file_list_link" href="#">File List</a>
50
+
51
+ </div>
52
+ <div class="clear"></div>
53
+ </div>
54
+
55
+ <iframe id="search_frame"></iframe>
56
+
57
+ <div id="content"><div id='filecontents'><h1>TODO list for Zabby</h1>
58
+ <p>
59
+ Zabby is still a young projet! There are many features missing and possible
60
+ improvements:
61
+ </p>
62
+ <ul>
63
+ <li>Document the code with <b>Yard</b>
64
+
65
+ </li>
66
+ <li>Write tests:
67
+
68
+ <ul>
69
+ <li>Use RSpec
70
+
71
+ </li>
72
+ <li>Use a <em>webmock</em> to simulate a Zabix Server, maybe <b>VCR</b>
73
+
74
+ </li>
75
+ </ul>
76
+ </li>
77
+ <li>Validate API verbs
78
+
79
+ </li>
80
+ <li>Betting Exceptions and error handling
81
+
82
+ </li>
83
+ <li>Add online help to the shell
84
+
85
+ </li>
86
+ <li>Improve or merge <tt>zabbysh</tt> and <tt>zabbyrb</tt>
87
+
88
+ </li>
89
+ </ul>
90
+ </div></div>
91
+
92
+ <div id="footer">
93
+ Generated on Wed Dec 21 12:25:11 2011 by
94
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
95
+ 0.7.4 (ruby-1.8.7).
96
+ </div>
97
+
98
+ </body>
99
+ </html>
@@ -46,6 +46,12 @@
46
46
  <li class="r2"><a href="file.LICENSE.html" title="LICENSE">LICENSE</a></li>
47
47
 
48
48
 
49
+ <li class="r1"><a href="file.TODO.html" title="TODO">TODO</a></li>
50
+
51
+
52
+ <li class="r2"><a href="file.ChangeLog.html" title="ChangeLog">ChangeLog</a></li>
53
+
54
+
49
55
  </ul>
50
56
  </div>
51
57
  </body>
@@ -83,6 +83,23 @@ specific configuration language.
83
83
  <li>Simple design: avoids spaghetti code, WTF and facepalm, unlike some other
84
84
  Ruby Zabbix libraries.
85
85
 
86
+ </li>
87
+ </ul>
88
+ <h2>Features</h2>
89
+ <ul>
90
+ <li>Low level Ruby API that maps every Zabbix API (JSON RPC) to Ruby hashes.
91
+
92
+ </li>
93
+ <li>Higher level Ruby DSL, both available in pure Ruby and for writing
94
+ configuration files.
95
+
96
+ </li>
97
+ <li>Supports SSL and authenticated HTTP proxies.
98
+
99
+ </li>
100
+ <li>Full featured IRB like shell included with Readline support. You can mix
101
+ Zabbix instructions with Ruby calls transparently.
102
+
86
103
  </li>
87
104
  </ul>
88
105
  <h2>Examples</h2>
@@ -96,7 +113,7 @@ The barebone API can be used in Ruby like this:
96
113
  <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;pp&quot;</span>
97
114
 
98
115
  <span class='rubyid_z identifier id'>z</span> <span class='assign token'>=</span> <span class='rubyid_Zabby constant id'>Zabby</span><span class='dot token'>.</span><span class='rubyid_init identifier id'>init</span> <span class='rubyid_do do kw'>do</span>
99
- <span class='rubyid_host identifier id'>host</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
116
+ <span class='rubyid_server identifier id'>server</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
100
117
  <span class='rubyid_user identifier id'>user</span> <span class='string val'>&quot;api_user&quot;</span>
101
118
  <span class='rubyid_password identifier id'>password</span> <span class='string val'>&quot;s3cr3t&quot;</span>
102
119
  <span class='rubyid_proxy_host identifier id'>proxy_host</span> <span class='string val'>&quot;http://10.10.10.10&quot;</span>
@@ -109,7 +126,7 @@ The barebone API can be used in Ruby like this:
109
126
  <span class='rubyid_pp identifier id'>pp</span> <span class='rubyid_z identifier id'>z</span><span class='dot token'>.</span><span class='rubyid_connection identifier id'>connection</span><span class='dot token'>.</span><span class='rubyid_perform_request identifier id'>perform_request</span><span class='lparen token'>(</span><span class='string val'>&quot;item&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;get&quot;</span><span class='comma token'>,</span> <span class='lbrace token'>{</span> <span class='string val'>&quot;host&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;master.example.com&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;output&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;shorten&quot;</span> <span class='rbrace token'>}</span><span class='rparen token'>)</span>
110
127
  </pre>
111
128
  <ul>
112
- <li>The <em>host</em>, <em>user</em> and <em>passord</em> are necessary.
129
+ <li>The <em>server</em>, <em>user</em> and <em>passord</em> are necessary.
113
130
 
114
131
  </li>
115
132
  <li>If you don&#8217;t provide the path to the JSON-RPC script
@@ -120,27 +137,38 @@ The barebone API can be used in Ruby like this:
120
137
 
121
138
  </li>
122
139
  </ul>
123
- <h3>Shell (experimental)</h3>
140
+ <h3>Shell</h3>
124
141
  <p>
125
- <b>zabbysh</b> is an experimental Zabbix Shell. It runs either
126
- interactively or can be used to execute a command file with the &quot;-f
127
- CMD_FILE&quot; option.
142
+ <b>zabbysh</b> is an simple Zabbix Shell. It runs either interactively or
143
+ can be used to execute a command file with the &quot;-f CMD_FILE&quot;
144
+ option.
128
145
  </p>
129
146
  <p>
130
147
  If the command file does not end with &quot;exit&quot; then the program
131
148
  drops into the shell after executing the file.
132
149
  </p>
150
+ <p>
151
+ <b>zabbysh</b> provides Readline support but does no support advanced IRB
152
+ features likes multi-lines instructions.
153
+ </p>
154
+ <p>
155
+ <b>zabbyrb</b> is another Zabbix Shell based on <b>IRB</b>. It provides the
156
+ whole power of IRB but may be less stable than zabbysh because the IRB API
157
+ is poorly documented and hard to use.
158
+ </p>
133
159
  <h4>Interactive shell</h4>
134
160
  <pre class="code">
135
161
  <span class='comment val'># zabbysh</span>
136
- <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_host identifier id'>host</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
162
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_server identifier id'>server</span> <span class='string val'>&quot;https://monitoring.example.com&quot;</span>
137
163
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_user identifier id'>user</span> <span class='string val'>&quot;api_user&quot;</span>
138
164
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_password identifier id'>password</span> <span class='string val'>&quot;s3cr3t&quot;</span>
139
165
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_host identifier id'>proxy_host</span> <span class='string val'>&quot;http://10.10.10.10&quot;</span>
140
166
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_user identifier id'>proxy_user</span> <span class='string val'>&quot;john&quot;</span>
141
- <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_password identifier id'>proxy_password</span> <span class='string val'>&quot;prD0e&quot;</span>
167
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_set identifier id'>set</span> <span class='rubyid_proxy_password identifier id'>proxy_password</span> <span class='string val'>&quot;D0e&quot;</span>
142
168
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_login identifier id'>login</span>
143
- <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_logged_in? fid id'>logged_in?</span>
169
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_puts identifier id'>puts</span> <span class='rubyid_logged_in? fid id'>logged_in?</span>
170
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_host identifier id'>host</span><span class='dot token'>.</span><span class='rubyid_get identifier id'>get</span> <span class='string val'>&quot;filter&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrace token'>{</span> <span class='string val'>&quot;host&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;monitor.example.com&quot;</span> <span class='rbrace token'>}</span><span class='comma token'>,</span> <span class='string val'>&quot;output&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;extend&quot;</span>
171
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_item identifier id'>item</span><span class='dot token'>.</span><span class='rubyid_get identifier id'>get</span> <span class='string val'>&quot;host&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;monitor.example.com&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;output&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;refer&quot;</span>
144
172
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='dot3 op'>...</span><span class='rbrack token'>]</span>
145
173
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_logout identifier id'>logout</span>
146
174
  <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_exit identifier id'>exit</span>
@@ -155,10 +183,10 @@ Create a file and put the same instructions as above in it, then execute
155
183
  </pre>
156
184
  <h2>Requirements</h2>
157
185
  <ul>
158
- <li>Ruby 1.8.7. May run on Ruby 1.8.5
186
+ <li>Ruby 1.8.5. IT BASICALLY RUNS ANYWHERE!
159
187
 
160
188
  </li>
161
- <li>JSON library: json_pure
189
+ <li>JSON library: &#8216;json&#8217; or &#8216;json_pure&#8217;
162
190
 
163
191
  </li>
164
192
  <li>OptionParser
@@ -175,15 +203,24 @@ Create a file and put the same instructions as above in it, then execute
175
203
  </li>
176
204
  <li>GitHub projet: https://github.com/Pragmatic-Source/zabby
177
205
 
206
+ </li>
207
+ <li>RubyGems.org homepage: https://rubygems.org/gems/zabby
208
+
209
+ </li>
210
+ <li>Author&#8217;s company: http://www.pragmatic-source.com
211
+
178
212
  </li>
179
213
  </ul>
180
- <h2>Author</h2>
214
+ <h2>Contributing</h2>
181
215
  <p>
182
- Farzad FARID mailto:ffarid@pragmatic-source.com
216
+ All contributions are welcome. You can either open a ticket on Github, send
217
+ a pull request with a patch or send an email to the author.
183
218
  </p>
219
+ <h2>Author</h2>
184
220
  <p>
185
- Thanks to:
221
+ Farzad FARID mailto:ffarid@pragmatic-source.com
186
222
  </p>
223
+ <h3>Thanks to</h3>
187
224
  <ul>
188
225
  <li>Jean-Hadrien Chabran (jhchabran): Advices on code design.
189
226
 
@@ -225,7 +262,7 @@ LICENSE file.
225
262
  </div></div>
226
263
 
227
264
  <div id="footer">
228
- Generated on Mon Dec 19 13:31:45 2011 by
265
+ Generated on Wed Dec 21 12:25:11 2011 by
229
266
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
230
267
  0.7.4 (ruby-1.8.7).
231
268
  </div>