Re: passing environment variable to cfengine daemons

"'Nick Anderson' via help-cfengine" <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
Xander Cage <[email protected]> writes:

> hi, because of this
><https://sites.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/aixbman/baseadmn/unix95.htm>,
>i need to pass an environment variable to cf-agent (maybe all the other
>daemons) to force aix to spit out iso formattet timestamps in my custom
>reporting promises.

Hi Chris,

Did you set `environment' in `body agent control'
(`controls/cf_agent.cf')?


,----
| body agent control
| {
|   with_env::
|     environment => { "XPG_SUS_ENV=ON" };
| }      
| bundle agent __main__
| {
|   reports:
|       "ENV XPG_SUS_ENV='$(with)'" with => getenv( "XPG_SUS_ENV", inf );
| }
`----
Listing 1: Example Policy

,----
| # cf-agent --no-lock --log-level info --file /tmp/cf-agent-environment-vars.cf
| R: ENV XPG_SUS_ENV=''
`----


,----
| # cf-agent --define with_env --no-lock --log-level info --file /tmp/cf-agent-environment-vars.cf
| R: ENV XPG_SUS_ENV='ON'
`----

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/87leydwg11.fsf%40northern.tech.

-- 
Nick Anderson | Doer of Things | (+1) 785-550-1767 | https://northern.tech

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/87leydwg11.fsf%40northern.tech.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.