Skip to content

skreuzer/cpuid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpuid

CFEngine module for calling CPUID

Installation

Linux (Ubuntu/Debian)

Ensure you have build-essential installed:

sudo apt-get install build-essential
sudo make install

FreeBSD

Install GNU make and build:

sudo pkg install gmake
gmake
sudo gmake install

NetBSD

Install GNU make and build:

sudo pkgin install gmake
gmake
sudo gmake install

OpenBSD

Install GNU make and build:

sudo pkg_add gmake
gmake
sudo gmake install

Example Usage

body common control
{
    bundlesequence => { "identify_cpu" };
}

bundle agent identify_cpu
{
    classes:

        "has_avx_support" expression => strcmp("avx", "$(cpuid.features)");

    commands:

        any::

            "/var/cfengine/modules/cpuid"
                comment => "Retrieve CPU vendor and processor features",
                module => "true";

    reports:

        any::

            "$(cpuid.features)";

        intel::

            "this host has an $(cpuid.vendor) processor";

        has_avx_support::

            "this host supports the avx instruction set";
}

sudo /var/cfengine/bin/cf-agent -K -f ./cpuid_example.cf
R: this host has an intel processor
R: EAX=1 Features:
R:      fpu
R:      vme
R:      de
R:      pse
R:      tsc
R:      msr
R:      pae
R:      mce
R:      cx8
... snip ...
R: this host supports the avx instruction set

CI

About

CFEngine module for calling CPUID

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published