Version is zabbix 4.4.1 on this single server, with one proxy
I had an auto-regitration action ( Configuration>Actions) with just a condition on proxy name
Operation details :
operation type=remode command
target=Current host
type=Custom script
Execute on=Zabbix server
Commands=/usr/local/zabbix/testUnknownHost/test1.sh
In Reports>Action log I can see (with 2' period) :
Command: Executed (in green)
Zabbix server:/usr/local/zabbix/testUnknownHost/test1.sh
I've set the debug mode in server's log, and yes all is ok :
21080:20200420:102745.031 In zbx_script_prepare()
21080:20200420:102745.031 End of zbx_script_prepare():SUCCEED
21080:20200420:102745.031 In zbx_script_execute()
21080:20200420:102745.031 In zbx_popen() command:'/usr/local/zabbix/testUnknownHost/test1.sh'
21080:20200420:102745.032 End of zbx_popen():7
21748:20200420:102745.032 zbx_popen(): executing script
21080:20200420:102745.037 In zbx_waitpid()
21080:20200420:102745.037 zbx_waitpid() exited, status:0
21080:20200420:102745.037 End of zbx_waitpid():21748
21080:20200420:102745.037 End of zbx_script_execute():SUCCEED
BUT I can't understand something .. the script is :
#!/bin/sh
touch /tmp/abc
echo === $* === > /tmp/abc.log
And even if zabbix uses popen or redirections, /tmp/abc and /tmp/abc.log should be created, but they are not, but why ?
I had an auto-regitration action ( Configuration>Actions) with just a condition on proxy name
Operation details :
operation type=remode command
target=Current host
type=Custom script
Execute on=Zabbix server
Commands=/usr/local/zabbix/testUnknownHost/test1.sh
In Reports>Action log I can see (with 2' period) :
Command: Executed (in green)
Zabbix server:/usr/local/zabbix/testUnknownHost/test1.sh
I've set the debug mode in server's log, and yes all is ok :
21080:20200420:102745.031 In zbx_script_prepare()
21080:20200420:102745.031 End of zbx_script_prepare():SUCCEED
21080:20200420:102745.031 In zbx_script_execute()
21080:20200420:102745.031 In zbx_popen() command:'/usr/local/zabbix/testUnknownHost/test1.sh'
21080:20200420:102745.032 End of zbx_popen():7
21748:20200420:102745.032 zbx_popen(): executing script
21080:20200420:102745.037 In zbx_waitpid()
21080:20200420:102745.037 zbx_waitpid() exited, status:0
21080:20200420:102745.037 End of zbx_waitpid():21748
21080:20200420:102745.037 End of zbx_script_execute():SUCCEED
BUT I can't understand something .. the script is :
#!/bin/sh
touch /tmp/abc
echo === $* === > /tmp/abc.log
And even if zabbix uses popen or redirections, /tmp/abc and /tmp/abc.log should be created, but they are not, but why ?
Comment