Ad Widget

Collapse

Asynchronous Item with nohup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Prodos23
    Junior Member
    • Jun 2015
    • 1

    #1

    Asynchronous Item with nohup

    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:
    Code:
    UserParameter=test.testasync,sh /etc/zabbix/test_item_async.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 &
    /etc/zabbix/slow_check.sh :
    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
    Last edited by Prodos23; 03-06-2015, 00:23.
Working...