Ad Widget

Collapse

Scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CeeEss
    Senior Member
    Zabbix Certified Specialist
    • Nov 2007
    • 103

    #1

    Scripts

    Is anyone successfully using scripts accessed from a right-click of the host column in the Top 20? Even the most rudimentary script fails:

    Ping /bin/ping -t {HOST.CONN}

    JAVA-ssh is completely out of the question. I also cannot figure out what vars or macros Zabbix is returning here. I can get $0, the script name (whoo-hoo), but $1, $2, {HOST.CONN}, {HOST.DNS}, {IPADDRESS} all return nada from this test script:

    #!/bin/sh
    echo meh
    echo "0. "$0
    echo "1. "$1
    echo "2. "$2
    echo {HOST.CONN}
    echo {HOST.DNS}
    /bin/ping -c3 {IPADDRESS}
    exit 0

    Results:

    meh
    0. /opt/zabbix/bin/sshtest
    1.
    2.
    {HOST.CONN}
    {HOST.DNS}

    Some insight into this would be greatly appreciated!
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    how exactly does ping fail ?
    maybe there's some error, like dns lookup problem - add stderr redirection for the ping script :

    Code:
    /bin/ping -t {HOST.CONN} 2>&1
    as for your testcase, you didn't show what the script is configured in zabbix.
    Zabbix 3.0 Network Monitoring book

    Comment

    • CeeEss
      Senior Member
      Zabbix Certified Specialist
      • Nov 2007
      • 103

      #3
      Aha - redirection makes i work. Now i need to get a good ssh webclient working. Thanks, Rich.

      Comment

      Working...