passing environment variable to cfengine daemons

Xander Cage <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
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.
i already exported this variable in the cfengine startup scripts, but this 
only worked one single time, all subsequent agent runs do not consider this 
setting and have messed up timestamps.
setting this systemwide is not possible.

desired format:

2022-02-14T14:58:11+0100 ;; syslog_low ;; empty ;; empty ;; empty ;; empty
2022-02-14T14:58:11+0100 ;; Lcycle_0 ;; empty ;; empty ;; empty ;; empty
2022-02-14T14:58:11+0100 ;; have_fs__IBM_PROLOG_BEGIN_TAG ;; empty ;; empty 
;; empty ;; empty
2022-02-14T14:58:11+0100 ;; GMT_Day14 ;; empty ;; empty ;; empty ;; empty
2022-02-14T14:58:11+0100 ;; GMT_Hr13 ;; empty ;; empty ;; empty ;; empty
2022-02-14T14:58:11+0100 ;; ipv4_172_17_9_179 ;; empty ;; empty ;; empty ;; 
empty

bad format:

2022-02-14T15:01:15CET ;; syslog_low ;; empty ;; empty ;; empty ;; empty
2022-02-14T15:01:15CET ;; Lcycle_0 ;; empty ;; empty ;; empty ;; empty
2022-02-14T15:01:15CET ;; have_fs__IBM_PROLOG_BEGIN_TAG ;; empty ;; empty 
;; empty ;; empty
2022-02-14T15:01:15CET ;; Q1 ;; empty ;; empty ;; empty ;; empty
2022-02-14T15:01:15CET ;; GMT_Day14 ;; empty ;; empty ;; empty ;; empty
2022-02-14T15:01:15CET ;; ipv4_172_17_9_179 ;; empty ;; empty ;; empty ;; 
empty

illustration in python:

root@nimvie: /root # set | grep XPG
XPG_SUS_ENV=ON
root@nimvie: /root # python
Python 2.7.18 (default, May 31 2021, 11:28:01)
[GCC 8.3.0] on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.strftime("%Y-%m-%dT%H:%M:%S%z")
'2022-02-14T15:33:09+0100'
>>> time.strftime("%Y-%m-%dT%H:%M:%S%Z")
'2022-02-14T15:33:14CET'

root@nimvie: /root # unset XPG_SUS_ENV
root@nimvie: /root # python
Python 2.7.18 (default, May 31 2021, 11:28:01)
[GCC 8.3.0] on aix6
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.strftime("%Y-%m-%dT%H:%M:%S%z")
'2022-02-14T15:33:54CET'
>>> time.strftime("%Y-%m-%dT%H:%M:%S%Z")
'2022-02-14T15:33:58CET'


wbr

chris

-- 
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/c2b1d71c-46f5-4c2f-8537-84c886559eccn%40googlegroups.com.
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.