Forum: CFEngine Help Subject: $sys.host and $sys.fqhost returning same FQ value. Author: davinken Link to topic: https://cfengine.com/forum/read.php?3,25899,25899#msg-25899
Yet another newbie question (CentOS 5.7/Fedora 16 environment, CFE 3.3.1) I'm just testing some very simple policies, and arrived to an inconsistent behavior of the value thrown back by intrinsic system variables $(sys.host) and $(sys.fqhost). In my CentOS prototype, both report the same long (FQ) domain (this is causing problem in the e-mail reporting). In Fedora 16 it works fine. Each host has its own IP/hostname declared in /etc/hosts such as: IP myhost.mydomain.com myhost and in /etc/sysconfog/network as hostname=myhost # CF3 learning example. #2 # Exploring use of variables. bundle agent stringexample2 { vars: "thehostname" string => $(sys.host); "thefqhostname" string => $(sys.fqhost); reports: cfengine:: "The hostname (short) is: $(thehostname)"; "The hostname (FQ) is: $(thefqhostname)"; } The results being: May 11 15:46:35 scorpia cf3[9228]: R: The hostname (short) is: myhost.mydomain.com May 11 15:46:35 scorpia cf3[9228]: R: The hostname (FQ) is: myhost.mydomain.com (of course I'm obscuring the actual names) Some idea how to correct this ? _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine