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

Reply via email to