Ad Widget

Collapse

Problem with script and userparameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • d.messina
    Junior Member
    • Nov 2016
    • 1

    #1

    Problem with script and userparameter

    Hi I have a problem with script and userparameter.

    I have this configuration:

    Code:
    In zabbix-agent.conf
    UserParameter=checkuserinit,/opt/scripts/initquery.sh
    
    In initquery.sh
    #!/bin/sh
    echo `mysql -e 'select count(*) from registration_request where status = "init"' test` | awk '{print $2}'
    With this configuration zabbix receive [] but script work.

    If I change this configuration in this way;
    Code:
    In zabbix-agent.conf
    UserParameter=checkuserinit,/opt/scripts/initquery.sh
    
    In initquery.sh
    #!/bin/sh
    echo "test"
    Zabbix receive test text.

    Where is the problem in my begin script???

    Can anyone help me??

    Thanks in advance
    Dario
  • nobodysu
    Member
    • Sep 2016
    • 84

    #2
    Provide a PATH in your script, like:
    Code:
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    Run 'echo $PATH' to see your actual PATH.

    Comment

    Working...