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

-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

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

Reply via email to