When an external script is run from Zabbix it will send 1 parameter extra.
This is fine if you know this.
I want to use such a script also from the console and want it to act the same.
I'm now using this code to identify zabbix:
I did some tests to see which 'env' or 'set' variable I could use and I was surprised to see that these scripts are run as root and not as 'zabbix'.
At least the variable 'USER' was set to 'root'.
Can't Zabbix add an extra environment variable which I can use to make such a test more reliable?
This is fine if you know this.
I want to use such a script also from the console and want it to act the same.
I'm now using this code to identify zabbix:
Code:
echo "${BASH_SOURCE}" | grep -q "zabbix" && shift 1
At least the variable 'USER' was set to 'root'.
Can't Zabbix add an extra environment variable which I can use to make such a test more reliable?

Comment