From 8d5e31063d1912e148d8c0326e7f112d941057b2 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 22 Jul 2006 11:17:48 +0000 Subject: Have a -l for the max git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@162 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- munin/munin-cpufreq | 7 +++++-- 1 file 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" -- cgit v1.2.3