Ad Widget

Collapse

Problem passing parameter to a script.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stefanw
    Junior Member
    • Aug 2007
    • 7

    #1

    Problem passing parameter to a script.

    Hi, Im trying to do a script that checks the route to a destination host using a UserParameter in the zabbix_agentd.conf file.

    It looks like this:

    UserParameter=routecheck[*],/usr/local/zabbix/routecheck.sh

    I also have an Item with a key like this:

    routecheck[router.test.com]

    But when I activate the check I get this in the agent log:

    28467:20071221:092823 Run remote command [/usr/local/zabbix/routecheck.sh] Result [57] [Usage: /usr/local/za]...
    28467:20071221:092823 Sending back [Usage: /usr/local/zabbix/routecheck.sh <destination host>]

    The script needs exactly one parameter to work, if it dosnt get exakly one parameter it will printe the Usage message I see in the log.

    Is there some more trick I need to do to get the zabbix_agentd to pass the parameter to the script?

    Zabbix 1.4.2
    Suse Linux Enterprise Server 10 SP1
  • max2xam
    Junior Member
    • Mar 2008
    • 2

    #2
    u miss $1 on the end
    UserParameter=routecheck[*],/usr/local/zabbix/routecheck.sh $1

    Comment

    Working...