Ad Widget

Collapse

Script returned no value problem for external check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dsh
    Junior Member
    • Jan 2012
    • 3

    #1

    Script returned no value problem for external check

    Hy,

    I have a problem regarding external checks.
    I wrote a little shell script the gets the software version number of a device.

    Code:
    #!/bin/sh
    
    #writes the sw version number in the file "sw_version"
    ./get_webio_sw_version.sh
    
    #print the sw version 
    tail sw_version
    
    #delete temp files
    rm -f sw_version
    rm -f httpresponse
    
    #debug
    #echo 2.26
    When I execute the script manually it works fine, also with zabbix user.
    But when I create an item for this, it became not supported because script returned no value.
    If I enable the last line and echo the version number in that way it also works in zabbix.
    I also tried once to read the version number in a variable and echo this variable, but was the same problem. Why does it work when I echo a hardcoded value.
    Hope anybody can help me.

    UPDATE: there must be some problem with reading from files, but no idea why.

    br
    Last edited by dsh; 18-01-2012, 10:03.
  • dsh
    Junior Member
    • Jan 2012
    • 3

    #2
    Mea Culpa

    I just forgot to use absolute path for the other files.
    Such a newbie failure.

    Comment

    Working...