summaryrefslogtreecommitdiff
path: root/munin/munin-cpufreq
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-07-22 11:17:48 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-07-22 11:17:48 +0000
commit8d5e31063d1912e148d8c0326e7f112d941057b2 (patch)
treeb6a89285120ad4ffa2f94fe2871cc73b9144e8e8 /munin/munin-cpufreq
parentad20ab91c4a9f4c82ff7eb0daa6423bd0f8d2385 (diff)
Have a -l for the max
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@162 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'munin/munin-cpufreq')
-rwxr-xr-xmunin/munin-cpufreq7
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"