I'm trying to do an asynchronous item to a long query but I can not make work "nohup" in the scrip when it's run by Zabbix Agent (version 2.2).
I give an example:
zabbix-agent.conf:
/etc/zabbix/test_item_async.sh :
/etc/zabbix/slow_check.sh :
if I manually run "sh /etc/zabbix/test_item_async.sh" it works correctly but when it's run by Zabbix agent not work. It just seems to omit the line nohup. I tried several options but can not get this to work.
Any suggestions?
thanks in advance
I give an example:
zabbix-agent.conf:
Code:
UserParameter=test.testasync,sh /etc/zabbix/test_item_async.sh
Code:
if [ -f "/etc/zabbix/test_item_async.res" ]
then
cat /etc/zabbix/test_item_async.res
fi
nohup sh /etc/zabbix/slow_check.sh > /dev/null 2>&1 &
Code:
echo "OK" > /etc/zabbix/test_item_async.res
if I manually run "sh /etc/zabbix/test_item_async.sh" it works correctly but when it's run by Zabbix agent not work. It just seems to omit the line nohup. I tried several options but can not get this to work.
Any suggestions?
thanks in advance