zabby 0.0.2

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.
@@ -0,0 +1,132 @@
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: LICENSE
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: LICENSE</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'><p>
58
+ Copyright 2011 Farzad FARID / Pragmatic Source. All rights reserved.
59
+ </p>
60
+ <p>
61
+ Redistribution and use in source and binary forms, with or without
62
+ modification, are permitted provided that the following conditions are met:
63
+ </p>
64
+ <pre class="code">
65
+ <span class='float val'>1</span><span class='dot token'>.</span> <span class='rubyid_Redistributions constant id'>Redistributions</span> <span class='rubyid_of identifier id'>of</span> <span class='rubyid_source identifier id'>source</span> <span class='rubyid_code identifier id'>code</span> <span class='rubyid_must identifier id'>must</span> <span class='rubyid_retain identifier id'>retain</span> <span class='rubyid_the identifier id'>the</span> <span class='rubyid_above identifier id'>above</span> <span class='rubyid_copyright identifier id'>copyright</span> <span class='rubyid_notice identifier id'>notice</span><span class='comma token'>,</span> <span class='rubyid_this identifier id'>this</span> <span class='rubyid_list identifier id'>list</span> <span class='rubyid_of identifier id'>of</span>
66
+ <span class='rubyid_conditions identifier id'>conditions</span> <span class='rubyid_and and kw'>and</span> <span class='rubyid_the identifier id'>the</span> <span class='rubyid_following identifier id'>following</span> <span class='rubyid_disclaimer identifier id'>disclaimer</span><span class='dot token'>.</span>
67
+
68
+ <span class='float val'>2</span><span class='dot token'>.</span> <span class='rubyid_Redistributions constant id'>Redistributions</span> <span class='rubyid_in in kw'>in</span> <span class='rubyid_binary identifier id'>binary</span> <span class='rubyid_form identifier id'>form</span> <span class='rubyid_must identifier id'>must</span> <span class='rubyid_reproduce identifier id'>reproduce</span> <span class='rubyid_the identifier id'>the</span> <span class='rubyid_above identifier id'>above</span> <span class='rubyid_copyright identifier id'>copyright</span> <span class='rubyid_notice identifier id'>notice</span><span class='comma token'>,</span> <span class='rubyid_this identifier id'>this</span> <span class='rubyid_list identifier id'>list</span>
69
+ <span class='rubyid_of identifier id'>of</span> <span class='rubyid_conditions identifier id'>conditions</span> <span class='rubyid_and and kw'>and</span> <span class='rubyid_the identifier id'>the</span> <span class='rubyid_following identifier id'>following</span> <span class='rubyid_disclaimer identifier id'>disclaimer</span> <span class='rubyid_in in kw'>in</span> <span class='rubyid_the identifier id'>the</span> <span class='rubyid_documentation identifier id'>documentation</span> <span class='rubyid_and and kw'>and</span><span class='regexp val'>/or other materials
70
+ provided with the distribution.
71
+ </span></pre>
72
+ <p>
73
+ THIS SOFTWARE IS PROVIDED BY PRAGMATIC SOURCE &#8217;&#8217;AS
74
+ IS&#8217;&#8217; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
75
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
76
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PRAGMATIC SOURCE OR
77
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
78
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
79
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
80
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
81
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
82
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
83
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
84
+ </p>
85
+ <p>
86
+ The views and conclusions contained in the software and documentation are
87
+ those of the authors and should not be interpreted as representing official
88
+ policies, either expressed or implied, of Pragmatic Source.
89
+ </p>
90
+ <p>
91
+ OTHER LICENSES COVERING PORTIONS OF CODE
92
+ </p>
93
+ <h6>==================================</h6>
94
+ <p>
95
+ Portions of code in &quot;Zabbix::Running&quot; were inspired by Rush
96
+ (https://github.com/adamwiggins/rush):
97
+ </p>
98
+ <p>
99
+ Copyright &#169; 2010 Adam Wiggins
100
+ </p>
101
+ <p>
102
+ Permission is hereby granted, free of charge, to any person obtaining a
103
+ copy of this software and associated documentation files (the
104
+ &quot;Software&quot;), to deal in the Software without restriction,
105
+ including without limitation the rights to use, copy, modify, merge,
106
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
107
+ permit persons to whom the Software is furnished to do so, subject to the
108
+ following conditions:
109
+ </p>
110
+ <p>
111
+ The above copyright notice and this permission notice shall be included in
112
+ all copies or substantial portions of the Software.
113
+ </p>
114
+ <p>
115
+ THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
116
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
117
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
118
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
119
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
120
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
121
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
122
+ </p>
123
+ </div></div>
124
+
125
+ <div id="footer">
126
+ Generated on Mon Dec 19 13:31:45 2011 by
127
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
+ 0.7.4 (ruby-1.8.7).
129
+ </div>
130
+
131
+ </body>
132
+ </html>
@@ -0,0 +1,234 @@
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: README
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: README</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>Zabby</h1>
58
+ <p>
59
+ Zabby[http://zabby.org] is a Ruby library and client for
60
+ Zabbix[http://www.zabbix.com/]. It provides a simple and clean interface to
61
+ the Web Services[http://www.zabbix.com/documentation/1.8/api].
62
+ </p>
63
+ <h2>Goals</h2>
64
+ <p>
65
+ There already are Ruby Zabbix libraries but some of them are unfinished
66
+ (and apparently abandonned) and some other&#8217;s code is too complicated
67
+ or poorly designed. This is why I decided to write another tool for which
68
+ my primary goal is to keep the code design, the user interaction and
69
+ application interface clean and simple.
70
+ </p>
71
+ <p>
72
+ Zabby has the following caracteristics:
73
+ </p>
74
+ <ul>
75
+ <li>Works both as a Ruby API and a command line tool.
76
+
77
+ </li>
78
+ <li>Uses an internal Ruby DSL (Domain Specific Langage) that give access to the
79
+ full power of Ruby scripting in your configurarion files. No need for a
80
+ specific configuration language.
81
+
82
+ </li>
83
+ <li>Simple design: avoids spaghetti code, WTF and facepalm, unlike some other
84
+ Ruby Zabbix libraries.
85
+
86
+ </li>
87
+ </ul>
88
+ <h2>Examples</h2>
89
+ <h3>API use</h3>
90
+ <p>
91
+ The barebone API can be used in Ruby like this:
92
+ </p>
93
+ <pre class="code">
94
+ <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;rubygems&quot;</span>
95
+ <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;zabby&quot;</span>
96
+ <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;pp&quot;</span>
97
+
98
+ <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>
100
+ <span class='rubyid_user identifier id'>user</span> <span class='string val'>&quot;api_user&quot;</span>
101
+ <span class='rubyid_password identifier id'>password</span> <span class='string val'>&quot;s3cr3t&quot;</span>
102
+ <span class='rubyid_proxy_host identifier id'>proxy_host</span> <span class='string val'>&quot;http://10.10.10.10&quot;</span>
103
+ <span class='rubyid_proxy_user identifier id'>proxy_user</span> <span class='string val'>&quot;john&quot;</span>
104
+ <span class='rubyid_proxy_password identifier id'>proxy_password</span> <span class='string val'>&quot;D0e&quot;</span>
105
+ <span class='rubyid_end end kw'>end</span>
106
+ <span class='rubyid_z identifier id'>z</span><span class='dot token'>.</span><span class='rubyid_login identifier id'>login</span>
107
+
108
+ <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;host&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;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;master.example.com&quot;</span> <span class='rbrace token'>}</span> <span class='rbrace token'>}</span><span class='rparen token'>)</span>
109
+ <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
+ </pre>
111
+ <ul>
112
+ <li>The <em>host</em>, <em>user</em> and <em>passord</em> are necessary.
113
+
114
+ </li>
115
+ <li>If you don&#8217;t provide the path to the JSON-RPC script
116
+ &quot;/api_jsonrpc.php&quot; is appended to the URI automatically.
117
+
118
+ </li>
119
+ <li>The <em>proxy_*</em> settings are optionnal.
120
+
121
+ </li>
122
+ </ul>
123
+ <h3>Shell (experimental)</h3>
124
+ <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.
128
+ </p>
129
+ <p>
130
+ If the command file does not end with &quot;exit&quot; then the program
131
+ drops into the shell after executing the file.
132
+ </p>
133
+ <h4>Interactive shell</h4>
134
+ <pre class="code">
135
+ <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>
137
+ <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
+ <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
+ <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
+ <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>
142
+ <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>
144
+ <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
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_logout identifier id'>logout</span>
146
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_exit identifier id'>exit</span>
147
+ </pre>
148
+ <h4>Execute a command script</h4>
149
+ <p>
150
+ Create a file and put the same instructions as above in it, then execute
151
+ <b>zabbysh</b>:
152
+ </p>
153
+ <pre class="code">
154
+ <span class='comment val'># zabbysh --file my_zabbix_commands.txt</span>
155
+ </pre>
156
+ <h2>Requirements</h2>
157
+ <ul>
158
+ <li>Ruby 1.8.7. May run on Ruby 1.8.5
159
+
160
+ </li>
161
+ <li>JSON library: json_pure
162
+
163
+ </li>
164
+ <li>OptionParser
165
+
166
+ </li>
167
+ <li>Readline (optionnal, used by the interactive shell)
168
+
169
+ </li>
170
+ </ul>
171
+ <h2>References</h2>
172
+ <ul>
173
+ <li>Main web site: http://zabby.org
174
+
175
+ </li>
176
+ <li>GitHub projet: https://github.com/Pragmatic-Source/zabby
177
+
178
+ </li>
179
+ </ul>
180
+ <h2>Author</h2>
181
+ <p>
182
+ Farzad FARID mailto:ffarid@pragmatic-source.com
183
+ </p>
184
+ <p>
185
+ Thanks to:
186
+ </p>
187
+ <ul>
188
+ <li>Jean-Hadrien Chabran (jhchabran): Advices on code design.
189
+
190
+ </li>
191
+ <li>Nicolas Blanco (slainer68): Advices on code design and Triple Facepalming
192
+ after reading other Ruby/Zabbix code.
193
+
194
+ </li>
195
+ <li>Renaud Chaput (renchap): For suggesting the &quot;zabby&quot; name.
196
+
197
+ </li>
198
+ </ul>
199
+ <h3>Sources of inspiration</h3>
200
+ <ul>
201
+ <li>Adam Wiggins&#8217;s Rush[https://github.com/adamwiggins/rush] for the
202
+ interactive shell.
203
+
204
+ </li>
205
+ <li>Other Zabbix Ruby libraries (only the good parts ;) ):
206
+
207
+ </li>
208
+ </ul>
209
+ <table>
210
+ <tr><td valign="top">zabcon[http://trac.red-tux.net/]:</td><td>Zabcon is a command line interface for Zabbix written in Ruby
211
+
212
+ </td></tr>
213
+ <tr><td valign="top">rzabbix[http://github.com/neerfri/rzabbix]:</td><td>Zabbix API client for Ruby
214
+
215
+ </td></tr>
216
+ <tr><td valign="top">rubix[https://github.com/dhruvbansal/rubix]:</td><td>Rubix is a Ruby client for Zabbix
217
+
218
+ </td></tr>
219
+ </table>
220
+ <h2>License</h2>
221
+ <p>
222
+ This software is release under the <b>Simplified BSD license</b>. See the
223
+ LICENSE file.
224
+ </p>
225
+ </div></div>
226
+
227
+ <div id="footer">
228
+ Generated on Mon Dec 19 13:31:45 2011 by
229
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
230
+ 0.7.4 (ruby-1.8.7).
231
+ </div>
232
+
233
+ </body>
234
+ </html>
@@ -0,0 +1,52 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=fr_fr" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
18
+ <base id="base_target" target="_parent" />
19
+ </head>
20
+ <body>
21
+ <script type="text/javascript" charset="utf-8">
22
+ if (window.top.frames.main) {
23
+ document.getElementById('base_target').target = 'main';
24
+ document.body.className = 'frames';
25
+ }
26
+ </script>
27
+ <div id="content">
28
+ <h1 id="full_list_header">File List</h1>
29
+ <div id="nav">
30
+
31
+ <a target="_self" href="class_list.html">Classes</a>
32
+
33
+ <a target="_self" href="method_list.html">Methods</a>
34
+
35
+ <a target="_self" href="file_list.html">Files</a>
36
+
37
+ </div>
38
+ <div id="search">Search: <input type="text" /></div>
39
+
40
+ <ul id="full_list" class="files">
41
+
42
+
43
+ <li class="r1"><a href="index.html" title="README">README</a></li>
44
+
45
+
46
+ <li class="r2"><a href="file.LICENSE.html" title="LICENSE">LICENSE</a></li>
47
+
48
+
49
+ </ul>
50
+ </div>
51
+ </body>
52
+ </html>
data/doc/frames.html ADDED
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=fr_fr"/>
7
+ <title>Documentation by YARD 0.7.4</title>
8
+ </head>
9
+ <frameset cols="20%,*">
10
+ <frame name="list" src="class_list.html" />
11
+ <frame name="main" src="index.html" />
12
+ </frameset>
13
+ </html>
data/doc/index.html ADDED
@@ -0,0 +1,234 @@
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: README
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: README</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>Zabby</h1>
58
+ <p>
59
+ Zabby[http://zabby.org] is a Ruby library and client for
60
+ Zabbix[http://www.zabbix.com/]. It provides a simple and clean interface to
61
+ the Web Services[http://www.zabbix.com/documentation/1.8/api].
62
+ </p>
63
+ <h2>Goals</h2>
64
+ <p>
65
+ There already are Ruby Zabbix libraries but some of them are unfinished
66
+ (and apparently abandonned) and some other&#8217;s code is too complicated
67
+ or poorly designed. This is why I decided to write another tool for which
68
+ my primary goal is to keep the code design, the user interaction and
69
+ application interface clean and simple.
70
+ </p>
71
+ <p>
72
+ Zabby has the following caracteristics:
73
+ </p>
74
+ <ul>
75
+ <li>Works both as a Ruby API and a command line tool.
76
+
77
+ </li>
78
+ <li>Uses an internal Ruby DSL (Domain Specific Langage) that give access to the
79
+ full power of Ruby scripting in your configurarion files. No need for a
80
+ specific configuration language.
81
+
82
+ </li>
83
+ <li>Simple design: avoids spaghetti code, WTF and facepalm, unlike some other
84
+ Ruby Zabbix libraries.
85
+
86
+ </li>
87
+ </ul>
88
+ <h2>Examples</h2>
89
+ <h3>API use</h3>
90
+ <p>
91
+ The barebone API can be used in Ruby like this:
92
+ </p>
93
+ <pre class="code">
94
+ <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;rubygems&quot;</span>
95
+ <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;zabby&quot;</span>
96
+ <span class='rubyid_require identifier id'>require</span> <span class='string val'>&quot;pp&quot;</span>
97
+
98
+ <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>
100
+ <span class='rubyid_user identifier id'>user</span> <span class='string val'>&quot;api_user&quot;</span>
101
+ <span class='rubyid_password identifier id'>password</span> <span class='string val'>&quot;s3cr3t&quot;</span>
102
+ <span class='rubyid_proxy_host identifier id'>proxy_host</span> <span class='string val'>&quot;http://10.10.10.10&quot;</span>
103
+ <span class='rubyid_proxy_user identifier id'>proxy_user</span> <span class='string val'>&quot;john&quot;</span>
104
+ <span class='rubyid_proxy_password identifier id'>proxy_password</span> <span class='string val'>&quot;D0e&quot;</span>
105
+ <span class='rubyid_end end kw'>end</span>
106
+ <span class='rubyid_z identifier id'>z</span><span class='dot token'>.</span><span class='rubyid_login identifier id'>login</span>
107
+
108
+ <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;host&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;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;master.example.com&quot;</span> <span class='rbrace token'>}</span> <span class='rbrace token'>}</span><span class='rparen token'>)</span>
109
+ <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
+ </pre>
111
+ <ul>
112
+ <li>The <em>host</em>, <em>user</em> and <em>passord</em> are necessary.
113
+
114
+ </li>
115
+ <li>If you don&#8217;t provide the path to the JSON-RPC script
116
+ &quot;/api_jsonrpc.php&quot; is appended to the URI automatically.
117
+
118
+ </li>
119
+ <li>The <em>proxy_*</em> settings are optionnal.
120
+
121
+ </li>
122
+ </ul>
123
+ <h3>Shell (experimental)</h3>
124
+ <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.
128
+ </p>
129
+ <p>
130
+ If the command file does not end with &quot;exit&quot; then the program
131
+ drops into the shell after executing the file.
132
+ </p>
133
+ <h4>Interactive shell</h4>
134
+ <pre class="code">
135
+ <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>
137
+ <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
+ <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
+ <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
+ <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>
142
+ <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>
144
+ <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
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_logout identifier id'>logout</span>
146
+ <span class='rubyid_zabby identifier id'>zabby</span><span class='gt op'>&gt;</span> <span class='rubyid_exit identifier id'>exit</span>
147
+ </pre>
148
+ <h4>Execute a command script</h4>
149
+ <p>
150
+ Create a file and put the same instructions as above in it, then execute
151
+ <b>zabbysh</b>:
152
+ </p>
153
+ <pre class="code">
154
+ <span class='comment val'># zabbysh --file my_zabbix_commands.txt</span>
155
+ </pre>
156
+ <h2>Requirements</h2>
157
+ <ul>
158
+ <li>Ruby 1.8.7. May run on Ruby 1.8.5
159
+
160
+ </li>
161
+ <li>JSON library: json_pure
162
+
163
+ </li>
164
+ <li>OptionParser
165
+
166
+ </li>
167
+ <li>Readline (optionnal, used by the interactive shell)
168
+
169
+ </li>
170
+ </ul>
171
+ <h2>References</h2>
172
+ <ul>
173
+ <li>Main web site: http://zabby.org
174
+
175
+ </li>
176
+ <li>GitHub projet: https://github.com/Pragmatic-Source/zabby
177
+
178
+ </li>
179
+ </ul>
180
+ <h2>Author</h2>
181
+ <p>
182
+ Farzad FARID mailto:ffarid@pragmatic-source.com
183
+ </p>
184
+ <p>
185
+ Thanks to:
186
+ </p>
187
+ <ul>
188
+ <li>Jean-Hadrien Chabran (jhchabran): Advices on code design.
189
+
190
+ </li>
191
+ <li>Nicolas Blanco (slainer68): Advices on code design and Triple Facepalming
192
+ after reading other Ruby/Zabbix code.
193
+
194
+ </li>
195
+ <li>Renaud Chaput (renchap): For suggesting the &quot;zabby&quot; name.
196
+
197
+ </li>
198
+ </ul>
199
+ <h3>Sources of inspiration</h3>
200
+ <ul>
201
+ <li>Adam Wiggins&#8217;s Rush[https://github.com/adamwiggins/rush] for the
202
+ interactive shell.
203
+
204
+ </li>
205
+ <li>Other Zabbix Ruby libraries (only the good parts ;) ):
206
+
207
+ </li>
208
+ </ul>
209
+ <table>
210
+ <tr><td valign="top">zabcon[http://trac.red-tux.net/]:</td><td>Zabcon is a command line interface for Zabbix written in Ruby
211
+
212
+ </td></tr>
213
+ <tr><td valign="top">rzabbix[http://github.com/neerfri/rzabbix]:</td><td>Zabbix API client for Ruby
214
+
215
+ </td></tr>
216
+ <tr><td valign="top">rubix[https://github.com/dhruvbansal/rubix]:</td><td>Rubix is a Ruby client for Zabbix
217
+
218
+ </td></tr>
219
+ </table>
220
+ <h2>License</h2>
221
+ <p>
222
+ This software is release under the <b>Simplified BSD license</b>. See the
223
+ LICENSE file.
224
+ </p>
225
+ </div></div>
226
+
227
+ <div id="footer">
228
+ Generated on Mon Dec 19 13:31:45 2011 by
229
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
230
+ 0.7.4 (ruby-1.8.7).
231
+ </div>
232
+
233
+ </body>
234
+ </html>