collectd-interface 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -4
- data/bin/collectd-interface-daemon +15 -5
- data/public/images/cpus.png +0 -0
- data/public/images/disk-traffic-root.png +0 -0
- data/public/images/load.png +0 -0
- data/public/images/memory.png +0 -0
- data/public/images/network-eth0.png +0 -0
- data/public/images/network-lo.png +0 -0
- data/public/images/processes.png +0 -0
- data/views/README.md +15 -4
- data/views/graph_header.erb +1 -1
- data/views/graphs/processes.erb +1 -1
- data/views/template/options/graph.erb +5 -3
- metadata +6 -6
data/README.md
CHANGED
@@ -73,13 +73,24 @@ the graph is generated the caller will be redirected to `/image/`.
|
|
73
73
|
**Parameters**
|
74
74
|
|
75
75
|
It is possible to limit the time-frame of the graph using the option
|
76
|
-
|
76
|
+
_start_ and _end_. They are available in the drop-down menu, and can
|
77
|
+
be defined using the input fields or by appending them as URL
|
78
|
+
parameters.
|
77
79
|
|
78
|
-
|
80
|
+
Following URLs demonstrate the selection of a specific graph with
|
81
|
+
parameters to define a time-frame:
|
79
82
|
|
80
|
-
http://.../
|
83
|
+
http://.../load?start=end-1d&end=now-2h
|
84
|
+
http://.../cpus?start=20120217&end=20120220
|
85
|
+
http://.../memory?start=end-48h&end=20120218
|
86
|
+
http://.../network-eth0?start=20120217&end=now&image=svg
|
81
87
|
|
82
|
-
|
88
|
+
**Plugins**
|
89
|
+
|
90
|
+
Each graph is generated from a plugin in `views/graphs/`. This
|
91
|
+
directory is scanned when the Collectd-Interface daemon is started,
|
92
|
+
and each ERB-template (`*.erb`) is registered. Enable/disable
|
93
|
+
certain plugins using the command `collectd-interface-plugins`.
|
83
94
|
|
84
95
|
Data
|
85
96
|
----
|
@@ -271,8 +271,11 @@ class CollectdInterface < Sinatra::Base
|
|
271
271
|
end
|
272
272
|
# By default the web-interface will be displayed
|
273
273
|
else
|
274
|
-
# default
|
275
|
-
params
|
274
|
+
# by default each graph presents the last 12 hours
|
275
|
+
unless params.has_key? 'start' and params.has_key? 'end'
|
276
|
+
params['start'] = 'end-12h'
|
277
|
+
params['end'] = 'now'
|
278
|
+
end
|
276
279
|
params['image'] = 'png' unless params.has_key?('image')
|
277
280
|
# display only a subset of the graphs by default
|
278
281
|
unless params.has_key?('display')
|
@@ -309,12 +312,19 @@ class CollectdInterface < Sinatra::Base
|
|
309
312
|
:purple_light => '#FF00FF22', :purple_dark => '#FF00FFAA'
|
310
313
|
}
|
311
314
|
@type = params.has_key?('image') ? params['image'] : 'png'
|
312
|
-
|
315
|
+
if params.has_key? 'start' and params.has_key? 'end'
|
316
|
+
@start = params['start']
|
317
|
+
@end = params['end']
|
318
|
+
else
|
319
|
+
@start = 'end-24h'
|
320
|
+
@end = 'now'
|
321
|
+
end
|
313
322
|
@target = %Q[#{settings.public_folder}/images/#{path}.#{@type}]
|
314
323
|
@rrd_path = settings.rrd_path
|
315
324
|
command = erb "graphs/#{path}".to_sym, :layout => :graph_header
|
316
|
-
puts command if $DEBUG
|
317
|
-
|
325
|
+
puts command.chomp if $DEBUG
|
326
|
+
output = `#{command} > /dev/null 2>&1`
|
327
|
+
puts output.chomp if $DEBUG and not output.empty?
|
318
328
|
redirect %Q[/images/#{path}.#{@type}]
|
319
329
|
end
|
320
330
|
end
|
data/public/images/cpus.png
CHANGED
Binary file
|
Binary file
|
data/public/images/load.png
CHANGED
Binary file
|
data/public/images/memory.png
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/public/images/processes.png
CHANGED
Binary file
|
data/views/README.md
CHANGED
@@ -73,13 +73,24 @@ the graph is generated the caller will be redirected to `/image/`.
|
|
73
73
|
**Parameters**
|
74
74
|
|
75
75
|
It is possible to limit the time-frame of the graph using the option
|
76
|
-
|
76
|
+
_start_ and _end_. They are available in the drop-down menu, and can
|
77
|
+
be defined using the input fields or by appending them as URL
|
78
|
+
parameters.
|
77
79
|
|
78
|
-
|
80
|
+
Following URLs demonstrate the selection of a specific graph with
|
81
|
+
parameters to define a time-frame:
|
79
82
|
|
80
|
-
http://.../
|
83
|
+
http://.../load?start=end-1d&end=now-2h
|
84
|
+
http://.../cpus?start=20120217&end=20120220
|
85
|
+
http://.../memory?start=end-48h&end=20120218
|
86
|
+
http://.../network-eth0?start=20120217&end=now&image=svg
|
81
87
|
|
82
|
-
|
88
|
+
**Plugins**
|
89
|
+
|
90
|
+
Each graph is generated from a plugin in `views/graphs/`. This
|
91
|
+
directory is scanned when the Collectd-Interface daemon is started,
|
92
|
+
and each ERB-template (`*.erb`) is registered. Enable/disable
|
93
|
+
certain plugins using the command `collectd-interface-plugins`.
|
83
94
|
|
84
95
|
Data
|
85
96
|
----
|
data/views/graph_header.erb
CHANGED
data/views/graphs/processes.erb
CHANGED
@@ -9,9 +9,11 @@
|
|
9
9
|
</select>
|
10
10
|
</li>
|
11
11
|
<li>
|
12
|
-
<div class="label">
|
13
|
-
<input type="text" name="
|
14
|
-
<div class="
|
12
|
+
<div class="label">Start:</div>
|
13
|
+
<input type="text" name="start" value="end-12h"/>
|
14
|
+
<div class="label">End:</div>
|
15
|
+
<input type="text" name="end" value="now"/>
|
16
|
+
<div class="explain">Read Help for more details.</div>
|
15
17
|
</li>
|
16
18
|
<li>
|
17
19
|
<div class="label">Image type for graphs:</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collectd-interface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-22 00:00:00.000000000 +01:00
|
13
13
|
default_executable: collectd-interface-daemon
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sinatra
|
17
|
-
requirement: &
|
17
|
+
requirement: &9266720 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '1.3'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *9266720
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: maruku
|
28
|
-
requirement: &
|
28
|
+
requirement: &9266240 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0.6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *9266240
|
37
37
|
description: ''
|
38
38
|
email: vic.penso@gmail.com
|
39
39
|
executables:
|