diff options
Diffstat (limited to 'munin/munin-cpufreq')
-rwxr-xr-x | munin/munin-cpufreq | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/munin/munin-cpufreq b/munin/munin-cpufreq index dd40663..3a43fa9 100755 --- a/munin/munin-cpufreq +++ b/munin/munin-cpufreq @@ -29,6 +29,7 @@ def findmasters h['cpunum'] = affected[0] h['fieldname'] = "cpu#{affected[0]}" h['label'] = affected.map{|c| "cpu#{c}"}.join(", ") + h['max'] = IO.read("/sys/devices/system/cpu/cpu#{cpunum}/cpufreq/cpuinfo_max_freq").to_i masters.push(h) affected.each{ |a| cpus.delete(a) } end @@ -36,13 +37,15 @@ def findmasters end def config + m = findmasters + max = m.map{ |i| i['max'] }.max puts 'graph_title CPU frequency' - puts 'graph_args -l 0 --base 1000' + puts "graph_args -l 0 -l #{max} --base 1000" puts 'graph_vlabel Hz' puts 'graph_category system' puts 'graph_period second' puts 'graph_info Shows the CPU frequency of all installed CPUs' - findmasters.each do |m| + m.each do |m| puts "#{m['fieldname']}.label #{m['label']}" puts "#{m['fieldname']}.cdef #{m['fieldname']},1000,*" puts "#{m['fieldname']}.info Hz" |