Forum: Cfengine Help
Subject: Re: sys.ncpu or something?
Author: Seva Gluschenko
Link to topic: https://cfengine.com/forum/read.php?3,17088,17090#msg-17090

Nakarin,

Of course, I can make it even shorter and safer:

 
vars:
   linux::
       "ncpu"          string  => execresult("/bin/grep -c ^processor
/proc/cpuinfo", "noshell");

   freebsd::
       "ncpu"          string  => execresult("/sbin/sysctl -n
hw.ncpu", "noshell");



It just seems to be a good coin to have right inside in the Cfengine
and omit external commands.

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to