smoke 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +10 -0
- data/Manifest.txt +4 -6
- data/bin/smoke +1 -3
- data/bin/smoked +1 -2
- data/{etc/smoke.d → contrib}/processors/smoke/remote_port_status_check_processor.rb +2 -0
- data/{etc/smoke.d → contrib}/processors/smoke/system_load_processor.rb +11 -0
- data/{etc/smoke.d → contrib}/signals/smoke/remote_port_status_check.rb +9 -4
- data/contrib/signals/smoke/system_load.rb +23 -0
- data/lib/smoke/version.rb +1 -1
- data/website/index.html +8 -15
- data/website/index.txt +6 -16
- data/website/template.rhtml +0 -1
- metadata +6 -8
- data/etc/smoke.d/signals/smoke/random_status_demo.rb +0 -7
- data/etc/smoke.d/signals/smoke/system_load.rb +0 -14
- data/load_average.png +0 -0
data/History.txt
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
== 0.0.3 2008-04-01
|
2
|
+
|
3
|
+
* Updated History.txt - d'oh!
|
4
|
+
|
5
|
+
== 0.0.2 2008-04-01
|
6
|
+
|
7
|
+
* The scripts in bin/ now actually run which is nice.
|
8
|
+
* Example of using smoke-0.0.2 is available at
|
9
|
+
http://barkingiguana.com/2008/04/01/port-monitoring-with-smoke
|
10
|
+
|
1
11
|
== 0.0.1 2008-03-29
|
2
12
|
|
3
13
|
* Initial release
|
data/Manifest.txt
CHANGED
@@ -7,11 +7,10 @@ bin/smoke
|
|
7
7
|
bin/smoked
|
8
8
|
config/hoe.rb
|
9
9
|
config/requirements.rb
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
etc/smoke.d/signals/smoke/system_load.rb
|
10
|
+
contrib/processors/smoke/remote_port_status_check_processor.rb
|
11
|
+
contrib/processors/smoke/system_load_processor.rb
|
12
|
+
contrib/signals/smoke/remote_port_status_check.rb
|
13
|
+
contrib/signals/smoke/system_load.rb
|
15
14
|
lib/smoke.rb
|
16
15
|
lib/smoke/client.rb
|
17
16
|
lib/smoke/client/connection.rb
|
@@ -24,7 +23,6 @@ lib/smoke/server/version.rb
|
|
24
23
|
lib/smoke/signal.rb
|
25
24
|
lib/smoke/signal_processor.rb
|
26
25
|
lib/smoke/version.rb
|
27
|
-
load_average.png
|
28
26
|
log/debug.log
|
29
27
|
log/development.log
|
30
28
|
log/production.log
|
data/bin/smoke
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
SIGNAL_DIRECTORIES = [ "#{GEM_ROOT}/etc/smoke.d/signals", "/etc/smoke.d/signals" ]
|
3
|
+
SIGNAL_DIRECTORIES = [ "/etc/smoke.d/signals" ]
|
5
4
|
|
6
|
-
$: << File.join(GEM_ROOT, 'lib')
|
7
5
|
SIGNAL_DIRECTORIES.each_with_index do |directory, index|
|
8
6
|
if directory =~ /[^\/]$/
|
9
7
|
directory += '/'
|
data/bin/smoked
CHANGED
@@ -4,10 +4,9 @@
|
|
4
4
|
# Copyright (c) 2008 Craig R Webster <craig@barkingiguana.com>
|
5
5
|
#
|
6
6
|
|
7
|
-
$: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
8
7
|
require 'rubygems'
|
9
8
|
require 'mongrel'
|
10
|
-
require '
|
9
|
+
require 'smoke/server'
|
11
10
|
require 'optparse'
|
12
11
|
|
13
12
|
OPTIONS = {
|
@@ -1,3 +1,14 @@
|
|
1
|
+
# An example SignalProcessor that generates a graph of the last 60 reported
|
2
|
+
# SystemLoad signals.
|
3
|
+
#
|
4
|
+
# It's pretty naff - it doesn't do any sort of time bounding so I can't say
|
5
|
+
# that the graph is of the last 60 minutes or anything, but it's certainly
|
6
|
+
# possible to do so if you fancy recording the timestamp that came in with
|
7
|
+
# the report.
|
8
|
+
#
|
9
|
+
# Remember, if you're doing any heavy lifting such as generating images do
|
10
|
+
# push that work off into another Thread to avoid blocking the current thread.
|
11
|
+
#
|
1
12
|
require 'rubygems'
|
2
13
|
require 'scruffy'
|
3
14
|
|
@@ -1,3 +1,12 @@
|
|
1
|
+
# This is an example of a signal which will interupt the SignalRunner when
|
2
|
+
# something important hapens. As you can see, all you need to do is implement
|
3
|
+
# the #start method. This should launch into a new Thread doing whatever you
|
4
|
+
# need. When something significant happens you should call @client.report and
|
5
|
+
# give it some data to report in the form of a Hash.
|
6
|
+
#
|
7
|
+
# To deal with data on the server side, create a class that extends
|
8
|
+
# Smoke::SignalProcesor.
|
9
|
+
#
|
1
10
|
module Smoke
|
2
11
|
class RemotePortStatusCheck < Smoke::Signal
|
3
12
|
HOSTS_PORTS_AND_STATUSES = [
|
@@ -6,10 +15,6 @@ module Smoke
|
|
6
15
|
[ "localhost", 80, :down ]
|
7
16
|
]
|
8
17
|
|
9
|
-
def initialize(client)
|
10
|
-
@client = client
|
11
|
-
end
|
12
|
-
|
13
18
|
def start
|
14
19
|
HOSTS_PORTS_AND_STATUSES.map do |check|
|
15
20
|
Thread.new(@client, check) do |client, c|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# This is an example of a signal which will be polled for status by the
|
2
|
+
# SignalRunner. As you can see, all you need to do is implement the #run
|
3
|
+
# method. Of course, nothing is stopping you doing anything else: the class
|
4
|
+
# can be as complicated as you want and do anything you want it to, as long as
|
5
|
+
# it returns a Hash of data using #run.
|
6
|
+
#
|
7
|
+
# To deal with data on the server side, create a class that extends
|
8
|
+
# Smoke::SignalProcesor.
|
9
|
+
#
|
10
|
+
module Smoke
|
11
|
+
class SystemLoad < Smoke::Signal
|
12
|
+
def run
|
13
|
+
one_minute, five_minutes, fifteen_minutes = %x[uptime].strip.split(/load averages: /).last.split(/ /)
|
14
|
+
{
|
15
|
+
:report => {
|
16
|
+
:one_minute => one_minute.to_f,
|
17
|
+
:five_minutes => five_minutes.to_f,
|
18
|
+
:fifteen_minutes => fifteen_minutes.to_f
|
19
|
+
}
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/smoke/version.rb
CHANGED
data/website/index.html
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
7
|
<title>
|
8
|
-
|
8
|
+
Smoke
|
9
9
|
</title>
|
10
10
|
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
11
|
<style>
|
@@ -30,12 +30,12 @@
|
|
30
30
|
<body>
|
31
31
|
<div id="main">
|
32
32
|
|
33
|
-
<h1>
|
33
|
+
<h1>Smoke</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/server"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/server" class="numbers">0.0.
|
36
|
+
<a href="http://rubyforge.org/projects/server" class="numbers">0.0.3</a>
|
37
37
|
</div>
|
38
|
-
<h1>→ ‘
|
38
|
+
<h1>→ ‘A distributed reporting framework’</h1>
|
39
39
|
|
40
40
|
|
41
41
|
<h2>What</h2>
|
@@ -44,7 +44,7 @@
|
|
44
44
|
<h2>Installing</h2>
|
45
45
|
|
46
46
|
|
47
|
-
<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">
|
47
|
+
<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">smoke</span></pre></p>
|
48
48
|
|
49
49
|
|
50
50
|
<h2>The basics</h2>
|
@@ -53,13 +53,7 @@
|
|
53
53
|
<h2>Demonstration of usage</h2>
|
54
54
|
|
55
55
|
|
56
|
-
<
|
57
|
-
|
58
|
-
|
59
|
-
<p><a href="http://groups.google.com/group/server">http://groups.google.com/group/server</a></p>
|
60
|
-
|
61
|
-
|
62
|
-
<p><span class="caps">TODO</span> – create Google Group – server</p>
|
56
|
+
<p>Still to be done (sorry!)</p>
|
63
57
|
|
64
58
|
|
65
59
|
<h2>How to submit patches</h2>
|
@@ -68,7 +62,7 @@
|
|
68
62
|
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
69
63
|
|
70
64
|
|
71
|
-
<p>The
|
65
|
+
<p>The origin is <code>git://barkingiguana.com/smoke.git</code>.</p>
|
72
66
|
|
73
67
|
|
74
68
|
<h2>License</h2>
|
@@ -80,9 +74,8 @@
|
|
80
74
|
<h2>Contact</h2>
|
81
75
|
|
82
76
|
|
83
|
-
<p>Comments are welcome. Send an email to <a href="mailto:
|
77
|
+
<p>Comments are welcome. Send an email to <a href="mailto:craig@barkingiguana.com">Craig Webster</a>.</p>
|
84
78
|
<p class="coda">
|
85
|
-
<a href="TODO">TODO</a>, 29th March 2008<br>
|
86
79
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>,
|
87
80
|
by Daniel Cadenas via <a href="http://depgraph.rubyforge.org/">DepGraph</a>
|
88
81
|
</p>
|
data/website/index.txt
CHANGED
@@ -1,33 +1,24 @@
|
|
1
|
-
h1.
|
2
|
-
|
3
|
-
h1. → 'server'
|
1
|
+
h1. Smoke
|
4
2
|
|
3
|
+
h1. → 'A distributed reporting framework'
|
5
4
|
|
6
5
|
h2. What
|
7
6
|
|
8
|
-
|
9
7
|
h2. Installing
|
10
8
|
|
11
|
-
<pre syntax="ruby">sudo gem install
|
9
|
+
<pre syntax="ruby">sudo gem install smoke</pre>
|
12
10
|
|
13
11
|
h2. The basics
|
14
12
|
|
15
|
-
|
16
13
|
h2. Demonstration of usage
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
h2. Forum
|
21
|
-
|
22
|
-
"http://groups.google.com/group/server":http://groups.google.com/group/server
|
23
|
-
|
24
|
-
TODO - create Google Group - server
|
15
|
+
Still to be done (sorry!)
|
25
16
|
|
26
17
|
h2. How to submit patches
|
27
18
|
|
28
19
|
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
|
29
20
|
|
30
|
-
The
|
21
|
+
The origin is <code>git://barkingiguana.com/smoke.git</code>.
|
31
22
|
|
32
23
|
h2. License
|
33
24
|
|
@@ -35,5 +26,4 @@ This code is free to use under the terms of the MIT license.
|
|
35
26
|
|
36
27
|
h2. Contact
|
37
28
|
|
38
|
-
Comments are welcome. Send an email to "
|
39
|
-
|
29
|
+
Comments are welcome. Send an email to "Craig Webster":mailto:craig@barkingiguana.com.
|
data/website/template.rhtml
CHANGED
@@ -37,7 +37,6 @@
|
|
37
37
|
</div>
|
38
38
|
<%= body %>
|
39
39
|
<p class="coda">
|
40
|
-
<a href="TODO">TODO</a>, <%= modified.pretty %><br>
|
41
40
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>,
|
42
41
|
by Daniel Cadenas via <a href="http://depgraph.rubyforge.org/">DepGraph</a>
|
43
42
|
</p>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smoke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig R Webster
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-04-01 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -37,11 +37,10 @@ files:
|
|
37
37
|
- bin/smoked
|
38
38
|
- config/hoe.rb
|
39
39
|
- config/requirements.rb
|
40
|
-
-
|
41
|
-
-
|
42
|
-
-
|
43
|
-
-
|
44
|
-
- etc/smoke.d/signals/smoke/system_load.rb
|
40
|
+
- contrib/processors/smoke/remote_port_status_check_processor.rb
|
41
|
+
- contrib/processors/smoke/system_load_processor.rb
|
42
|
+
- contrib/signals/smoke/remote_port_status_check.rb
|
43
|
+
- contrib/signals/smoke/system_load.rb
|
45
44
|
- lib/smoke.rb
|
46
45
|
- lib/smoke/client.rb
|
47
46
|
- lib/smoke/client/connection.rb
|
@@ -54,7 +53,6 @@ files:
|
|
54
53
|
- lib/smoke/signal.rb
|
55
54
|
- lib/smoke/signal_processor.rb
|
56
55
|
- lib/smoke/version.rb
|
57
|
-
- load_average.png
|
58
56
|
- log/debug.log
|
59
57
|
- log/development.log
|
60
58
|
- log/production.log
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Smoke
|
2
|
-
class SystemLoad < Smoke::Signal
|
3
|
-
def run
|
4
|
-
one_minute, five_minutes, fifteen_minutes = %x[uptime].strip.split(/load averages: /).last.split(/ /)
|
5
|
-
{
|
6
|
-
:report => {
|
7
|
-
:one_minute => one_minute.to_f,
|
8
|
-
:five_minutes => five_minutes.to_f,
|
9
|
-
:fifteen_minutes => fifteen_minutes.to_f
|
10
|
-
}
|
11
|
-
}
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/load_average.png
DELETED
Binary file
|