Hi Nicolas, Yeah, I looked under /sys but I don't seem to have any files that provide the cpu frequency, at least that are available on all systems (I didn't check all of ours):
/sys/devices/system/cpu/cpu0# find . | sort . ./cache ./cache/index0 ./cache/index0/coherency_line_size ./cache/index0/level ./cache/index0/number_of_sets ./cache/index0/physical_line_partition ./cache/index0/shared_cpu_map ./cache/index0/size ./cache/index0/type ./cache/index0/ways_of_associativity [...same files for index1...index3] ./crash_notes ./topology ./topology/core_id ./topology/core_siblings ./topology/physical_package_id ./topology/thread_siblings # I think at this point we may just not bother storing CPU speed. It doesn't seem that valuable compared to at least knowing the number and type of the CPUs. Thank you everyone for the suggestions! At least I learned a few things out of it. :) Justin -----Original Message----- From: help-cfengine-boun...@cfengine.org [mailto:help-cfengine-boun...@cfengine.org] On Behalf Of Nicolas Charles Sent: Thursday, September 02, 2010 2:05 AM To: help-cfengine@cfengine.org Subject: Re: Linux CPU speed Hi, What we use for the cpu frequency is /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq It appears to be reliable, even on our vmware systems Note that if you have more than one cpu, you'll want to check the cpu1, cpu2, etc... Regards, Nicolas On 02/09/2010 00:08, Justin Lloyd wrote: > Yep, found out earlier that our VMs do that. :) > > Upon further reflection, I wouldn't mind storing that 30k value. However, the > other snag is that the command in the measurements promise cannot have any > shell metacharacters (I believe it is fork/exec'ed directly rather than being > passed to a subshell), so I can't use a pipe. Some systems have a new enough > dmidecode that has a -s flag, but not all of them have processor-frequency: > > # dmidecode -s processor-frequency > 2600 MHz > 2600 MHz > Unknown > Unknown > Unknown > Unknown > Unknown > Unknown > # > > I'm considering defining classes based on availability of the proper > dmidecode command and then using the class to select the proper measurements > promise, but for /proc/cpuinfo I don't think I can determine from within > Cfengine if any particular system will throttle the CPU so I may stop using > that. > > However, to use /proc/cpuinfo, I could possibly change how I compare the > current CPU speed with the one in the database for a given system, doing an > ordering comparison rather than a naïve strcmp(), thus converging on storing > only the maximum value seen. :) > > Justin > > > -----Original Message----- > From: Tim Cutts [mailto:t...@sanger.ac.uk] > Sent: Wednesday, September 01, 2010 3:55 PM > To: Justin Lloyd > Cc: Help-cfengine@cfengine.org > Subject: Re: Linux CPU speed > > > On 1 Sep 2010, at 20:07, Justin Lloyd wrote: > > >> Hi Tim, >> >> >> >> Someone else mentioned that dmidecode has the output, but a quick test >> seems to have found it unreliable since many of my systems were >> reporting 30000 MHz. I wish! J >> > Let me guess - those CPUs are VMware virtual machines. I'd noticed that > figure for the virtualised CPUs on our vSphere machines. My bet is it > reports that if you specify the CPU speed limit in the VM's resources as > "unlimited". If you actually set the maximum CPU speed to some real number > in vmware, is that then reflected in the dmidecode output? Just wondering... > > Presumably asset numbers in your cfengine setup are somewhat irrelevant if > the machine you're configuring is virtual... > > Tim > > -- Nicolas CHARLES Normation SAS - http://www.normation.com 44 rue Cauchy - 94110 ARCUEIL +33 (0)1 83 62 26 96 - +33 (0)6 14 63 25 18 _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine This electronic communication and any attachments may contain confidential and proprietary information of DigitalGlobe, Inc. If you are not the intended recipient, or an agent or employee responsible for delivering this communication to the intended recipient, or if you have received this communication in error, please do not print, copy, retransmit, disseminate or otherwise use the information. Please indicate to the sender that you have received this communication in error, and delete the copy you received. DigitalGlobe reserves the right to monitor any electronic communication sent or received by its employees, agents or representatives. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine