Hey,
I would like to store variable in environment variable and use it in vars.dummy_text in my Service. The problem is, that getenv function don’t work properly in .conf files. It can’t get as simple env var as HOME, USER etc… The only environment variable, that i could get with getenv is PATH.
interesting thing is that going into icinga2 console
its all ok, getenv prints any env variable from linux printenv
command
in .conf files don’t work:
vars.dummy_text = {{ getenv("USER") }}
vars.dummy_text = {{ getenv("HOME") }}
I just get empty string / no output in Web
but
vars.dummy_text = {{ getenv("PATH") }}
works
is there a difference between getenv from icinga2 console and conf files?
is there a way to print all variables that getenv can get?
where icinga looks for env variables in icinga2 console and conf files?
I am using icinga2 (version: r2.13.2-1)