collectd-interface 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/README.md +134 -0
  2. data/bin/collectd-interface-daemon +401 -0
  3. data/bin/collectd-interface-plugins +95 -0
  4. data/graphs/cpus.erb +76 -0
  5. data/graphs/disk-traffic-root.erb +30 -0
  6. data/graphs/disk-traffic-srv.erb.disabled +30 -0
  7. data/graphs/disk-traffic-tmp.erb.disabled +30 -0
  8. data/graphs/disk-traffic-var.erb.disabled +30 -0
  9. data/graphs/gridengine-jobs.erb.disabled +32 -0
  10. data/graphs/load.erb +36 -0
  11. data/graphs/memory.erb +47 -0
  12. data/graphs/network-eth0.erb +26 -0
  13. data/graphs/network-lo.erb +26 -0
  14. data/graphs/processes.erb +66 -0
  15. data/public/images/cpus.png +0 -0
  16. data/public/images/cpus.svg +946 -0
  17. data/public/images/disk-traffic-root.png +0 -0
  18. data/public/images/disk-traffic-srv.png +0 -0
  19. data/public/images/disk-traffic-var.png +0 -0
  20. data/public/images/load.png +0 -0
  21. data/public/images/load.svg +638 -0
  22. data/public/images/memory.png +0 -0
  23. data/public/images/memory.svg +741 -0
  24. data/public/images/network-eth0.png +0 -0
  25. data/public/images/network-eth0.svg +609 -0
  26. data/public/images/network-lo.png +0 -0
  27. data/public/images/network-lo.svg +644 -0
  28. data/public/images/processes.png +0 -0
  29. data/public/images/processes.svg +832 -0
  30. data/public/readme/user-interface.png +0 -0
  31. data/public/script/toggle.js +9 -0
  32. data/public/style/default.css +275 -0
  33. data/public/style/nav.css +265 -0
  34. data/views/README.md +134 -0
  35. data/views/data.erb +3 -0
  36. data/views/graph.erb +19 -0
  37. data/views/readme.erb +3 -0
  38. data/views/report.erb +17 -0
  39. data/views/reports/disk-free.erb +20 -0
  40. data/views/reports/list-open-files-lustre.erb.disabled +44 -0
  41. data/views/reports/list-open-files-tmp.erb +44 -0
  42. data/views/reports/processes-cpu-usage.erb +39 -0
  43. data/views/reports/system-sockets.erb +32 -0
  44. data/views/show_values.erb +11 -0
  45. data/views/template/default.erb +21 -0
  46. data/views/template/header.erb +3 -0
  47. data/views/template/navigation.erb +9 -0
  48. data/views/template/options/data.erb +31 -0
  49. data/views/template/options/graph.erb +23 -0
  50. data/views/template/options/readme.erb +0 -0
  51. data/views/template/options/report.erb +11 -0
  52. metadata +128 -0
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ application_root = File.expand_path(File.join(File.dirname(File.expand_path(__FILE__)),'..'))
7
+
8
+ name = File.basename(__FILE__)
9
+
10
+ graphs = "#{application_root}/graphs"
11
+ reports = "#{application_root}/views/reports"
12
+
13
+ def list(path)
14
+ Dir["#{path}/*"].sort.each do |file|
15
+ name = File.basename(file)
16
+ if /.*.erb.disabled$/ =~ file
17
+ puts File.basename(name,'.erb.disabled') << ' (disabled)'
18
+ elsif /.*.erb$/ =~ file
19
+ puts File.basename(name,'.erb')
20
+ end
21
+ end
22
+ end
23
+
24
+ def enable(component,name)
25
+ path = File.join(component,name)
26
+ if File.exists? "#{path}.erb.disabled"
27
+ mv "#{path}.erb.disabled", "#{path}.erb"
28
+ exit 0
29
+ elsif File.exists? "#{path}.erb"
30
+ puts "Error: '#{name}' already enabled."
31
+ exit 1
32
+ else
33
+ puts "Error '#{name}' not existing."
34
+ exit 1
35
+ end
36
+ end
37
+
38
+ def disable(component,name)
39
+ path = File.join(component,name)
40
+ if File.exists? "#{path}.erb"
41
+ mv "#{path}.erb", "#{path}.erb.disabled"
42
+ exit 0
43
+ elsif File.exists? "#{path}.erb.disabled"
44
+ puts "Error: '#{name}' already disabled."
45
+ exit 1
46
+ else
47
+ puts "Error: '#{name}' not existing."
48
+ exit 1
49
+ end
50
+ end
51
+
52
+ case ARGV[0]
53
+ when 'graph'
54
+ case ARGV[1]
55
+ when 'list'
56
+ list(graphs)
57
+ when 'enable'
58
+ if ARGV[2].nil?
59
+ puts "#{name} graph enable [name]"
60
+ else
61
+ enable(graphs,ARGV[2])
62
+ end
63
+ when 'disable'
64
+ if ARGV[2].nil?
65
+ puts "#{name} graph disable [name]"
66
+ else
67
+ disable(graphs,ARGV[2])
68
+ end
69
+ else
70
+ puts "#{name} graph list|enable|disable"
71
+ end
72
+ when 'report'
73
+ case ARGV[1]
74
+ when 'list'
75
+ list(reports)
76
+ when 'enable'
77
+ if ARGV[2].nil?
78
+ puts "#{name} report enable [name]"
79
+ else
80
+ enable(reports,ARGV[2])
81
+ end
82
+ when 'disable'
83
+ if ARGV[2].nil?
84
+ puts "#{name} report disable [name]"
85
+ else
86
+ disable(reports,ARGV[2])
87
+ end
88
+ else
89
+ puts "#{name} report list|enable|disable"
90
+ end
91
+ else
92
+ puts "#{name} graph|report"
93
+ end
94
+
95
+
data/graphs/cpus.erb ADDED
@@ -0,0 +1,76 @@
1
+ <%
2
+
3
+ lines = String.new
4
+ areas = String.new
5
+ cores = `grep -c processor /proc/cpuinfo`.to_i
6
+ limit = cores*100
7
+
8
+ if cores > 1
9
+ cores = "#{cores} cores"
10
+ else
11
+ cores = "#{cores} core"
12
+ end
13
+
14
+ def define(name,files,function = "AVERAGE")
15
+ defs = String.new
16
+ cdef = "CDEF:#{name}="
17
+ tail = String.new
18
+ cpu = 1
19
+ files.each do |f|
20
+ n = "#{name}_#{cpu}"
21
+ defs << %Q[DEF:#{n}=#{f}:value:#{function} ]
22
+ cdef << "#{n},"
23
+ tail << "+,"
24
+ cpu += 1
25
+ end
26
+ return defs << cdef << tail.chop.chop.chop << ' '
27
+ end
28
+
29
+ definitions = define('sys_av',Dir["#{rrd_path}cpu*/cpu-system.rrd"] )
30
+ definitions << define('sys_min',Dir["#{rrd_path}cpu*/cpu-system.rrd"],'MIN' )
31
+ definitions << define('sys_max',Dir["#{rrd_path}cpu*/cpu-system.rrd"],'MAX' )
32
+ lines << %Q[LINE1:sys_av#{color[:green_dark]}:'System\t\t\t\t\t' GPRINT:sys_min:MIN:"Min. %4.0lf" GPRINT:sys_av:AVERAGE:"Avg. %4.0lf" GPRINT:sys_max:MAX:"Max. %4.0lf" GPRINT:sys_av:LAST:'Last %4.0lf' ]
33
+
34
+
35
+ definitions << define('user_av',Dir["#{rrd_path}cpu*/cpu-user.rrd"] )
36
+ definitions << define('user_min',Dir["#{rrd_path}cpu*/cpu-user.rrd"],'MIN' )
37
+ definitions << define('user_max',Dir["#{rrd_path}cpu*/cpu-user.rrd"],'MAX' )
38
+ lines << %Q[LINE1:user_av#{color[:blue_dark]}:'User\t\t\t\t\t\t\t' GPRINT:user_min:MIN:"Min. %4.0lf" GPRINT:user_av:AVERAGE:"Avg. %4.0lf" GPRINT:user_max:MAX:'Max. %4.0lf' GPRINT:user_av:LAST:'Last %4.0lf' ]
39
+
40
+ definitions << define('idle_av',Dir["#{rrd_path}cpu*/cpu-idle.rrd"] )
41
+ definitions << define('idle_min',Dir["#{rrd_path}cpu*/cpu-idle.rrd"],'MIN' )
42
+ definitions << define('idle_max',Dir["#{rrd_path}cpu*/cpu-idle.rrd"],'MAX' )
43
+ areas << %Q[AREA:idle_av#F5F5F588 ]
44
+ lines << %Q[LINE1:idle_av#CCCCCCAA:'Idle\t\t\t\t\t\t\t' GPRINT:idle_min:MIN:"Min. %4.0lf" GPRINT:idle_av:AVERAGE:"Avg. %4.0lf" GPRINT:idle_max:MAX:"Max. %4.0lf" GPRINT:idle_av:LAST:'Last %4.0lf' ]
45
+
46
+ definitions << define('nice_av',Dir["#{rrd_path}cpu*/cpu-nice.rrd"] )
47
+ definitions << define('nice_min',Dir["#{rrd_path}cpu*/cpu-nice.rrd"],'MIN' )
48
+ definitions << define('nice_max',Dir["#{rrd_path}cpu*/cpu-nice.rrd"],'MAX' )
49
+ lines << %Q[LINE1:nice_av#{color[:yellow_dark]}:'Nice\t\t\t\t\t\t\t' GPRINT:nice_min:MIN:"Min. %4.0lf" GPRINT:nice_av:AVERAGE:"Avg. %4.0lf" GPRINT:nice_max:MAX:"Max. %4.0lf" GPRINT:nice_av:LAST:'Last %4.0lf' ]
50
+
51
+ definitions << define('wait_av',Dir["#{rrd_path}cpu*/cpu-wait.rrd"] )
52
+ definitions << define('wait_min',Dir["#{rrd_path}cpu*/cpu-wait.rrd"],'MIN' )
53
+ definitions << define('wait_max',Dir["#{rrd_path}cpu*/cpu-wait.rrd"],'MAX' )
54
+ lines << %Q[LINE1:wait_av#{color[:orange_dark]}:'Wait (IO)\t\t\t' GPRINT:wait_min:MIN:"Min. %4.0lf" GPRINT:wait_av:AVERAGE:"Avg. %4.0lf" GPRINT:wait_max:MAX:"Max. %4.0lf" GPRINT:wait_av:LAST:"Last %4.0lf" ]
55
+
56
+ definitions << define('steal_av',Dir["#{rrd_path}cpu*/cpu-steal.rrd"] )
57
+ definitions << define('steal_min',Dir["#{rrd_path}cpu*/cpu-steal.rrd"],'MIN' )
58
+ definitions << define('steal_max',Dir["#{rrd_path}cpu*/cpu-steal.rrd"],'MAX' )
59
+ lines << %Q[LINE1:steal_av#{color[:red_dark]}:'Steal\t\t\t\t\t\t' GPRINT:steal_min:MIN:"Min. %4.0lf" GPRINT:steal_av:AVERAGE:"Avg. %4.0lf" GPRINT:steal_max:MAX:"Max. %4.0lf" GPRINT:steal_av:LAST:"Last %4.0lf" ]
60
+
61
+
62
+ definitions << define('int_av',Dir["#{rrd_path}cpu*/cpu-interrupt.rrd"] )
63
+ definitions << define('int_min',Dir["#{rrd_path}cpu*/cpu-interrupt.rrd"],'MIN' )
64
+ definitions << define('int_max',Dir["#{rrd_path}cpu*/cpu-interrupt.rrd"],'MAX' )
65
+ lines << %Q[LINE1:int_av#{color[:cyan_dark]}:'IRQ\t\t\t\t\t\t\t\t' GPRINT:int_min:MIN:"Min. %4.0lf" GPRINT:int_av:AVERAGE:"Avg. %4.0lf" GPRINT:int_max:MAX:"Max. %4.0lf" GPRINT:int_av:LAST:"Last %4.0lf" ]
66
+
67
+ definitions << define('sint_av',Dir["#{rrd_path}cpu*/cpu-softirq.rrd"] )
68
+ definitions << define('sint_min',Dir["#{rrd_path}cpu*/cpu-softirq.rrd"],'MIN' )
69
+ definitions << define('sint_max',Dir["#{rrd_path}cpu*/cpu-softirq.rrd"],'MAX' )
70
+ lines << %Q[LINE1:sint_av#{color[:purple_dark]}:'IRQ (soft)\t\t\t' GPRINT:sint_min:MIN:"Min. %4.0lf" GPRINT:sint_av:AVERAGE:"Avg. %4.0lf" GPRINT:sint_max:MAX:"Max. %4.0lf" GPRINT:sint_av:LAST:"Last %4.0lf" ]
71
+
72
+
73
+ %>
74
+
75
+
76
+ rrdtool graph <%= target %> -a <%= type.upcase %> --end now --start=end-<%= last %> --title="CPU Usage (<%= cores %>)" --vertical-label="Jiffies" --grid-dash 1:1 --width=400 --height=100 --border=0 --color=BACK#FFFFFF --tabwidth=10 --units-exponent=k --lower-limit=0 --legend-position=south --force-rules-legend --slope-mode --upper-limit <%= limit %> <%= definitions %> <%= areas %> <%= lines %>
@@ -0,0 +1,30 @@
1
+ <%
2
+ name = '/'
3
+ device = `df -l #{name} | grep '/dev/'`.split[0].split('/')[-1]
4
+ %>
5
+ rrdtool graph <%= target %> -a <%= type.upcase %> \
6
+ --end now --start=end-<%= last %> \
7
+ --title='Disk Traffic "<%= name %>"' --vertical-label="Bytes" \
8
+ --grid-dash 1:1 --width=400 --height=100 \
9
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
10
+ --tabwidth=10 --base 1024 \
11
+ DEF:read_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:AVERAGE \
12
+ DEF:read_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MIN \
13
+ DEF:read_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MAX \
14
+ DEF:write_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:AVERAGE \
15
+ DEF:write_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MIN \
16
+ DEF:write_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MAX \
17
+ AREA:read_max<%= color[:green_light] %> \
18
+ AREA:read_min#ffffff \
19
+ AREA:write_max<%= color[:blue_light] %> \
20
+ AREA:write_min#ffffff \
21
+ LINE1:read_av<%= color[:green_dark] %>:"Read\t\t\t" \
22
+ GPRINT:read_min:MIN:"Min. %3.0lf%sB" \
23
+ GPRINT:read_av:AVERAGE:"Avg. %3.0lf%sB" \
24
+ GPRINT:read_max:MAX:"Max. %3.0lf%sB" \
25
+ GPRINT:read_av:LAST:"Last %3.0lf%sB" \
26
+ LINE1:write_av<%= color[:blue_dark] %>:"Write\t\t" \
27
+ GPRINT:write_min:MIN:"Min. %3.0lf%sB" \
28
+ GPRINT:write_av:AVERAGE:"Avg. %3.0lf%sB" \
29
+ GPRINT:write_max:MAX:"Max. %3.0lf%sB" \
30
+ GPRINT:write_av:LAST:"Last %3.0lf%sB" \
@@ -0,0 +1,30 @@
1
+ <%
2
+ name = '/srv'
3
+ device = `df -l #{name} | grep '/dev/'`.split[0].split('/')[-1]
4
+ %>
5
+ rrdtool graph <%= target %> -a <%= type.upcase %> \
6
+ --end now --start=end-<%= last %> \
7
+ --title='Disk Traffic "<%= name %>"' --vertical-label="Bytes" \
8
+ --grid-dash 1:1 --width=400 --height=100 \
9
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
10
+ --tabwidth=10 --base 1024 \
11
+ DEF:read_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:AVERAGE \
12
+ DEF:read_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MIN \
13
+ DEF:read_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MAX \
14
+ DEF:write_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:AVERAGE \
15
+ DEF:write_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MIN \
16
+ DEF:write_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MAX \
17
+ AREA:read_max<%= color[:green_light] %> \
18
+ AREA:read_min#ffffff \
19
+ AREA:write_max<%= color[:blue_light] %> \
20
+ AREA:write_min#ffffff \
21
+ LINE1:read_av<%= color[:green_dark] %>:"Read\t\t\t" \
22
+ GPRINT:read_min:MIN:"Min. %3.0lf%sB" \
23
+ GPRINT:read_av:AVERAGE:"Avg. %3.0lf%sB" \
24
+ GPRINT:read_max:MAX:"Max. %3.0lf%sB" \
25
+ GPRINT:read_av:LAST:"Last %3.0lf%sB" \
26
+ LINE1:write_av<%= color[:blue_dark] %>:"Write\t\t" \
27
+ GPRINT:write_min:MIN:"Min. %3.0lf%sB" \
28
+ GPRINT:write_av:AVERAGE:"Avg. %3.0lf%sB" \
29
+ GPRINT:write_max:MAX:"Max. %3.0lf%sB" \
30
+ GPRINT:write_av:LAST:"Last %3.0lf%sB" \
@@ -0,0 +1,30 @@
1
+ <%
2
+ name = '/tmp'
3
+ device = `df -l #{name} | grep '/dev/'`.split[0].split('/')[-1]
4
+ %>
5
+ rrdtool graph <%= target %> -a <%= type.upcase %> \
6
+ --end now --start=end-<%= last %> \
7
+ --title='Disk Traffic "<%= name %>"' --vertical-label="Bytes" \
8
+ --grid-dash 1:1 --width=400 --height=100 \
9
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
10
+ --tabwidth=10 --base 1024 \
11
+ DEF:read_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:AVERAGE \
12
+ DEF:read_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MIN \
13
+ DEF:read_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MAX \
14
+ DEF:write_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:AVERAGE \
15
+ DEF:write_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MIN \
16
+ DEF:write_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MAX \
17
+ AREA:read_max<%= color[:green_light] %> \
18
+ AREA:read_min#ffffff \
19
+ AREA:write_max<%= color[:blue_light] %> \
20
+ AREA:write_min#ffffff \
21
+ LINE1:read_av<%= color[:green_dark] %>:"Read\t\t\t" \
22
+ GPRINT:read_min:MIN:"Min. %3.0lf%sB" \
23
+ GPRINT:read_av:AVERAGE:"Avg. %3.0lf%sB" \
24
+ GPRINT:read_max:MAX:"Max. %3.0lf%sB" \
25
+ GPRINT:read_av:LAST:"Last %3.0lf%sB" \
26
+ LINE1:write_av<%= color[:blue_dark] %>:"Write\t\t" \
27
+ GPRINT:write_min:MIN:"Min. %3.0lf%sB" \
28
+ GPRINT:write_av:AVERAGE:"Avg. %3.0lf%sB" \
29
+ GPRINT:write_max:MAX:"Max. %3.0lf%sB" \
30
+ GPRINT:write_av:LAST:"Last %3.0lf%sB" \
@@ -0,0 +1,30 @@
1
+ <%
2
+ name = '/var'
3
+ device = `df -l #{name} | grep '/dev/'`.split[0].split('/')[-1]
4
+ %>
5
+ rrdtool graph <%= target %> -a <%= type.upcase %> \
6
+ --end now --start=end-<%= last %> \
7
+ --title='Disk Traffic "<%= name %>"' --vertical-label="Bytes" \
8
+ --grid-dash 1:1 --width=400 --height=100 \
9
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
10
+ --tabwidth=10 --base 1024 \
11
+ DEF:read_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:AVERAGE \
12
+ DEF:read_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MIN \
13
+ DEF:read_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:read:MAX \
14
+ DEF:write_av=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:AVERAGE \
15
+ DEF:write_min=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MIN \
16
+ DEF:write_max=<%= rrd_path %>disk-<%= device %>/disk_octets.rrd:write:MAX \
17
+ AREA:read_max<%= color[:green_light] %> \
18
+ AREA:read_min#ffffff \
19
+ AREA:write_max<%= color[:blue_light] %> \
20
+ AREA:write_min#ffffff \
21
+ LINE1:read_av<%= color[:green_dark] %>:"Read\t\t\t" \
22
+ GPRINT:read_min:MIN:"Min. %3.0lf%sB" \
23
+ GPRINT:read_av:AVERAGE:"Avg. %3.0lf%sB" \
24
+ GPRINT:read_max:MAX:"Max. %3.0lf%sB" \
25
+ GPRINT:read_av:LAST:"Last %3.0lf%sB" \
26
+ LINE1:write_av<%= color[:blue_dark] %>:"Write\t\t" \
27
+ GPRINT:write_min:MIN:"Min. %3.0lf%sB" \
28
+ GPRINT:write_av:AVERAGE:"Avg. %3.0lf%sB" \
29
+ GPRINT:write_max:MAX:"Max. %3.0lf%sB" \
30
+ GPRINT:write_av:LAST:"Last %3.0lf%sB" \
@@ -0,0 +1,32 @@
1
+ rrdtool graph <%= target %> -a <%= type.upcase %> \
2
+ --end now --start=end-<%= last %> \
3
+ --title='GridEngine Queue Master' --vertical-label="Jobs" \
4
+ --grid-dash 1:1 --width=400 --height=100 \
5
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
6
+ --tabwidth=10 \
7
+ DEF:run_av=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:running:AVERAGE \
8
+ DEF:run_min=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:running:MIN \
9
+ DEF:run_max=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:running:MAX \
10
+ DEF:qu_av=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:queued:AVERAGE \
11
+ DEF:qu_min=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:queued:MIN \
12
+ DEF:qu_max=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:queued:MAX \
13
+ DEF:su_av=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:suspend:AVERAGE \
14
+ DEF:su_min=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:suspend:MIN \
15
+ DEF:su_max=<%= rrd_path %>/gridengine/gridengine_jobs.rrd:suspend:MAX \
16
+ AREA:su_av<%= color[:red_light] %> \
17
+ AREA:run_av<%= color[:green_light] %> \
18
+ LINE1:qu_av<%= color[:blue_dark] %>:"Queued " \
19
+ GPRINT:qu_min:MIN:"Min. %6.0lf" \
20
+ GPRINT:qu_av:AVERAGE:"Avg. %6.0lf" \
21
+ GPRINT:qu_max:MAX:"Max. %6.0lf" \
22
+ GPRINT:qu_av:LAST:"Last %6.0lf" \
23
+ LINE1:su_av<%= color[:red_dark] %>:"Suspend" \
24
+ GPRINT:su_min:MIN:"Min. %6.0lf" \
25
+ GPRINT:su_av:AVERAGE:"Avg. %6.0lf" \
26
+ GPRINT:su_max:MAX:"Max. %6.0lf" \
27
+ GPRINT:su_av:LAST:"Last %6.0lf" \
28
+ LINE1:run_av<%= color[:green_dark] %>:"Running" \
29
+ GPRINT:run_min:MIN:"Min. %6.0lf" \
30
+ GPRINT:run_av:AVERAGE:"Avg. %6.0lf" \
31
+ GPRINT:run_max:MAX:"Max. %6.0lf" \
32
+ GPRINT:run_av:LAST:"Last %6.0lf" \
data/graphs/load.erb ADDED
@@ -0,0 +1,36 @@
1
+ rrdtool graph <%= target %> -a <%= type.upcase %> \
2
+ --end now --start=end-<%= last %> \
3
+ --title="System Load" --vertical-label="Process Wait" \
4
+ --grid-dash 1:1 --width=400 --height=100 \
5
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
6
+ --tabwidth=10 --units-exponent=k --lower-limit=0 \
7
+ DEF:short_av=<%= rrd_path %>/load/load.rrd:shortterm:AVERAGE \
8
+ DEF:short_max=<%= rrd_path %>/load/load.rrd:shortterm:MAX \
9
+ DEF:short_min=<%= rrd_path %>/load/load.rrd:shortterm:MIN \
10
+ DEF:mid_av=<%= rrd_path %>/load/load.rrd:midterm:AVERAGE \
11
+ DEF:mid_max=<%= rrd_path %>/load/load.rrd:midterm:MAX \
12
+ DEF:mid_min=<%= rrd_path %>/load/load.rrd:midterm:MIN \
13
+ DEF:long_av=<%= rrd_path %>/load/load.rrd:longterm:AVERAGE \
14
+ DEF:long_max=<%= rrd_path %>/load/load.rrd:longterm:MAX \
15
+ DEF:long_min=<%= rrd_path %>/load/load.rrd:longterm:MIN \
16
+ AREA:short_max<%= color[:red_light] %> \
17
+ AREA:short_min#ffffff \
18
+ LINE1:mid_min<%= color[:green_light] %> \
19
+ LINE1:mid_max<%= color[:green_light] %> \
20
+ LINE1:mid_min<%= color[:blue_light] %> \
21
+ LINE1:mid_max<%= color[:blue_light] %> \
22
+ LINE1:short_av<%= color[:red_dark] %>:"1 Minute " \
23
+ GPRINT:short_min:MIN:"Min. %3.2lf" \
24
+ GPRINT:short_av:AVERAGE:"Avg. %3.2lf" \
25
+ GPRINT:short_max:MAX:"Max. %3.2lf" \
26
+ GPRINT:short_av:LAST:"Last %3.2lf" \
27
+ LINE1:mid_av<%= color[:green_dark] %>:"5 Minute " \
28
+ GPRINT:mid_min:MIN:"Min. %3.2lf" \
29
+ GPRINT:mid_av:AVERAGE:"Avg. %3.2lf" \
30
+ GPRINT:mid_max:MAX:"Max. %3.2lf" \
31
+ GPRINT:mid_av:LAST:"Last %3.2lf" \
32
+ LINE1:long_av<%= color[:blue_dark] %>:"15 Minute" \
33
+ GPRINT:long_min:MIN:"Min. %3.2lf" \
34
+ GPRINT:long_av:AVERAGE:"Avg. %3.2lf" \
35
+ GPRINT:long_max:MAX:"Max. %3.2lf" \
36
+ GPRINT:long_av:LAST:"Last %3.2lf" \
data/graphs/memory.erb ADDED
@@ -0,0 +1,47 @@
1
+ rrdtool graph <%= target %> -a <%= type.upcase%> \
2
+ --end now --start=end-<%= last %> \
3
+ --title='Memory Utilization' --vertical-label="Bytes" \
4
+ --grid-dash 1:1 --width=400 --height=100 \
5
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
6
+ --tabwidth=10 --base 1024 --lower-limit=0 \
7
+ DEF:used_av=<%= rrd_path %>/memory/memory-used.rrd:value:AVERAGE \
8
+ DEF:used_max=<%= rrd_path %>/memory/memory-used.rrd:value:MAX \
9
+ DEF:used_min=<%= rrd_path %>/memory/memory-used.rrd:value:MIN \
10
+ DEF:free_av=<%= rrd_path %>/memory/memory-free.rrd:value:AVERAGE \
11
+ DEF:free_max=<%= rrd_path %>/memory/memory-free.rrd:value:MAX \
12
+ DEF:free_min=<%= rrd_path %>/memory/memory-free.rrd:value:MIN \
13
+ DEF:cach_av=<%= rrd_path %>/memory/memory-cached.rrd:value:AVERAGE \
14
+ DEF:cach_max=<%= rrd_path %>/memory/memory-cached.rrd:value:MAX \
15
+ DEF:cach_min=<%= rrd_path %>/memory/memory-cached.rrd:value:MIN \
16
+ DEF:buff_av=<%= rrd_path %>/memory/memory-buffered.rrd:value:AVERAGE \
17
+ DEF:buff_max=<%= rrd_path %>/memory/memory-buffered.rrd:value:MAX \
18
+ DEF:buff_min=<%= rrd_path %>/memory/memory-buffered.rrd:value:MIN \
19
+ CDEF:used=used_av,used_av,UNKN,IF \
20
+ CDEF:free=free_av,used_av,free_av,+,UNKN,IF \
21
+ CDEF:cach=cach_av,used_av,free_av,cach_av,+,+,UNKN,IF \
22
+ CDEF:buff=buff_av,used_av,free_av,cach_av,buff_av,+,+,+,UNKN,IF \
23
+ AREA:used_av<%= color[:red_light] %> \
24
+ AREA:free_av<%= color[:green_light] %>::STACK \
25
+ AREA:cach_av<%= color[:yellow_light] %>::STACK \
26
+ AREA:buff_av<%= color[:blue_light] %>::STACK \
27
+ LINE1:used<%= color[:red_dark] %>:"Used " \
28
+ GPRINT:used_min:MIN:"Min. %3.0lf %sB " \
29
+ GPRINT:used_av:AVERAGE:"Avg. %3.0lf %sB" \
30
+ GPRINT:used_max:MAX:"Max. %3.0lf %sB" \
31
+ GPRINT:used_av:LAST:"Last %3.0lf %sB" \
32
+ LINE1:free<%= color[:green_dark] %>:"Free " \
33
+ GPRINT:free_min:MIN:"Min. %3.0lf %sB " \
34
+ GPRINT:free_av:AVERAGE:"Avg. %3.0lf %sB" \
35
+ GPRINT:free_max:MAX:"Max. %3.0lf %sB" \
36
+ GPRINT:free_av:LAST:"Last %3.0lf %sB" \
37
+ LINE1:cach<%= color[:yellow_dark] %>:"Cache " \
38
+ GPRINT:cach_min:MIN:"Min. %3.0lf %sB " \
39
+ GPRINT:cach_av:AVERAGE:"Avg. %3.0lf %sB" \
40
+ GPRINT:cach_max:MAX:"Max. %3.0lf %sB" \
41
+ GPRINT:cach_av:LAST:"Last %3.0lf %sB" \
42
+ LINE1:buff<%= color[:blue_dark] %>:"Buffer" \
43
+ GPRINT:buff_min:MIN:"Min. %3.0lf %sB " \
44
+ GPRINT:buff_av:AVERAGE:"Avg. %3.0lf %sB" \
45
+ GPRINT:buff_max:MAX:"Max. %3.0lf %sB" \
46
+ GPRINT:buff_av:LAST:"Last %3.0lf %sB"
47
+
@@ -0,0 +1,26 @@
1
+ rrdtool graph <%= target %> -a <%= type.upcase %> \
2
+ --end now --start=end-<%= last %> \
3
+ --title='Network Traffic Interface "eth0"' --vertical-label="Bits" \
4
+ --grid-dash 1:1 --width=400 --height=100 \
5
+ --alt-autoscale-max --border=0 --color=BACK#FFFFFF \
6
+ --tabwidth=10 \
7
+ DEF:rx_av=<%= rrd_path %>/interface/if_octets-eth0.rrd:rx:AVERAGE \
8
+ DEF:rx_min=<%= rrd_path %>/interface/if_octets-eth0.rrd:rx:MIN \
9
+ DEF:rx_max=<%= rrd_path %>/interface/if_octets-eth0.rrd:rx:MAX \
10
+ DEF:tx_av=<%= rrd_path %>/interface/if_octets-eth0.rrd:tx:AVERAGE \
11
+ DEF:tx_min=<%= rrd_path %>/interface/if_octets-eth0.rrd:tx:MIN \
12
+ DEF:tx_max=<%= rrd_path %>/interface/if_octets-eth0.rrd:tx:MAX \
13
+ AREA:rx_max<%= color[:green_light] %> \
14
+ AREA:rx_min#ffffff \
15
+ AREA:tx_max<%= color[:blue_light] %> \
16
+ AREA:tx_min#ffffff \
17
+ LINE1:rx_av<%= color[:green_dark] %>:"Recive " \
18
+ GPRINT:rx_min:MIN:"Min. %3.0lf%sb" \
19
+ GPRINT:rx_av:AVERAGE:"Avg. %3.0lf%sb" \
20
+ GPRINT:rx_max:MAX:"Max. %3.0lf%sb" \
21
+ GPRINT:rx_av:LAST:"Last %3.0lf%sb" \
22
+ LINE1:tx_av<%= color[:blue_dark] %>:"Transmit" \
23
+ GPRINT:tx_min:MIN:"Min. %3.0lf%sb" \
24
+ GPRINT:tx_av:AVERAGE:"Avg. %3.0lf%sb" \
25
+ GPRINT:tx_max:MAX:"Max. %3.0lf%sb" \
26
+ GPRINT:tx_av:LAST:"Last %3.0lf%sb" \