-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·241 lines (180 loc) · 7.57 KB
/
Copy pathindex.html
File metadata and controls
executable file
·241 lines (180 loc) · 7.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Healthety</title>
<meta name="description" content="Healthety is a realtime and easy to setup monitoring framework built on Node.JS" />
<meta name="author" content="Healthety Team" />
<meta name="keywords" content="healthety, realtime, monitoring, node, open source" />
<meta name="google-site-verification" content="ojcVKXcli6RL9Nc8dbqBtg7GtKBNX2me5vntIKTFME0" />
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- CSS : Fonts -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lobster" />
<!-- CSS : Change this if you want a different colour scheme -->
<link rel="stylesheet" href="css/default.css?v=1" />
<!-- Include *at least* the core style and default theme -->
<link type="text/css" rel="Stylesheet" href="css/shThemeRDark.css"/>
<!-- CSS : Fancybox -->
<link rel="stylesheet" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
<script src="js/libs/modernizr.min.js"></script>
</head>
<body>
<div class="wrap">
<div id="container">
<section class="intro">
<h2 class="fn">Healthety</h2>
<p class="role"><strong>Healthety is a realtime and easy to setup monitoring framework built on Node.JS</strong></p>
</section>
<section class="content">
<ul class="tabs">
<li><a href="#tab1">Server</a></li>
<li><a href="#tab2">Reporters</a></li>
<li><a href="#tab3">Screenshots / Demo</a></li>
<li><a href="#tab4">Wiki / Issues</a></li>
<li><a href="#tab5">Social</a></li>
</ul>
<div class="tab_container">
<div id="tab1" class="tab_content server">
<h3>Installation</h3>
<p>First of all you need to install <mark><a href="#">Node</a></mark> and the packet manager <mark><a href="#">npm</a></mark>.</p>
<p>Then install Healthety by running:</p>
<pre class="brush: bash;gutter: false;">$ npm install healthety</pre>
<hr />
<h3>Usage</h3>
<pre class="brush: js">
var server = require('healthety');
server.run(
8124, // http server port
41234 // UDP server port
);
</pre>
<p>Open http://localhost:8124 in your browser.</p>
<p>To report data you can use our worker. Currently there is a <strong><a href="#">Ruby</a></strong> and <strong><a href="#">PHP</a></strong> worker.
We'll publish very soon a JavaScript worker library.</p>
<hr />
<h3>Basic Auth</h3>
<p>Optional you can use basic auth to protect your reports.</p>
<pre class="brush: js">
var server = require('healthety');
server.run(
8124, // http server port
41234, // UDP server port,
basicAuth: {user: 'admin', pass: 'secret'}}
);
</pre>
</div><!--/tab1-->
<div id="tab2" class="tab_content reporters">
<h3>Ruby Worker</h3>
<p>The Ruby Worker sends JSON wrapped data via UDP packets to a given host at a defined interval.</p>
<hr />
<h3>Installation</h3>
<pre class="brush: bash">$ gem install healthety</pre>
<hr />
<h3>Usage</h3>
<pre class="brush: ruby">
require "healthety"
Healthety.workers do
host "localhost"
port 41234
worker :load_average do
interval 0.5
# Gets load average with a system call (Mac OS X)
value `w | head -n1 | cut -f4 -d":" | cut -f2 -d" "`.to_f
end
worker :random do
interval 2
value rand(10)
end
end
</pre>
<p>That's all you need to do to define two different workers.</p>
<h3>Defining helpers</h3>
<p>If you want to define some helper methods create a new module first. Note the helpers method at the end to include your module into the workers. In this case a new file called connection_helper.rb contains the MySQL connection handling.</p>
<pre class="brush: ruby">
require "mysql2"
module Healthety
module ConnectionHelper
def mysql
@client ||= Mysql2::Client.new(:host => "localhost",
:username => "root")
end
end
helpers ConnectionHelper
end
</pre>
<p>In your workers you can now use the helper method. Since the MySQL connection gets saved into a class instance variable the connection gets established only once.</p>
<pre class="brush: ruby">
$:.unshift File.dirname(__FILE__)
require "healthety"
require "connection_helper"
Healthety.workers do
host "localhost"
port 41234
worker :user_count do
interval 5
value mysql.query("SELECT COUNT(*) AS count FROM users").first["count"]
end
end
</pre>
</div><!--/tab2-->
<div id="tab3" class="tab_content demo">
<h3>Healthety in Action</h3>
<p>Comming soon!</p>
</div><!--/tab2-->
<div id="tab4" class="tab_content wiki">
<h3>Github Wiki</h3>
<p><a href="https://github.com/healthety/healthety/issues" target="_blank">LINK</a></p>
<h3>Github Issues</h3>
<p><a href="https://github.com/healthety/healthety/wiki" target="_blank">LINK</a></p>
</div><!--/tab2-->
<div id="tab5" class="tab_content social">
<ul>
<li class="odd">
<a href="https://github.com/healthety" class="tooltip" title="View us on Github"><img src="images/icons/github.png" alt="Github" /> Github</a>
</li>
<li class="even">
<a href="http://twitter.com/healthety" class="tooltip" title="Follow us on Twitter"><img src="images/icons/twitter.png" alt="Twitter" /> Twitter</a>
</li>
<li class="odd">
<a href="#" class="tooltip" title="View us on Flickr"><img src="images/icons/flickr.png" alt="Flickr" /> Flickr</a>
</li>
<li class="even">
<a href="#" class="tooltip" title="Watch us at Vimeo"><img src="images/icons/vimeo.png" alt="Vimeo" /> Vimeo</a>
</li>
</ul>
</div><!--/tab3-->
</div><!--/tab_container-->
</section>
</div> <!--! end of #container -->
<footer id="footer">
</footer>
</div><!--/wrap-->
<!-- Javascript at the bottom for fast page loading -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script src="js/libs/shCore.js" type="text/javascript"></script>
<script src="js/libs/shBrushJScript.js"></script>
<script src="js/libs/shBrushRuby.js"></script>
<script src="js/libs/shBrushPHP.js"></script>
<script src="js/libs/shBrushBash.js"></script>
<script src="js/plugins.js"></script>
<script src="js/script.js"></script>
<!--[if lte IE 7 ]>
<script src="js/libs/dd_belatedpng.js"></script>
<script src="js/libs/dd_roundies.js"></script>
<script>
DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images
DD_roundies.addRule('#container', '5px');
</script>
<![endif]-->
</body>
</html>