Ad Widget

Collapse

Getting values through telnet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OriginNG
    Junior Member
    • Dec 2014
    • 15

    #1

    Getting values through telnet

    I have a template for a fritzbox and that uses telnet to get values from it. I have found that showdsldstat -v will get me stats on the vpn tunnels that I run and wanted to graph the uptime.
    I came up with the following for a Item (type Telnet agent):
    Code:
    uptime=$(expr $(date +%s) - $(date -d "`showdsldstat | grep -i 'tunnelname' |tr -s ' '|cut -d ' ' -f7,8`" +%s)) && echo $uptime
    On the commandline of the fritzbox this gives me the number of secs the tunnel is up but zabbix isn't graphing it.
    I turned on debug=4 for the pollers and see the commands above being sent to the router and the output being send back to zabbix but then it seems to disappear.
    Whats wrong with the above?

    Putting that line in a shell script on the router (not really an option since a reboot will clear the script) and calling the script from zabbix will correctly graph the uptime.

    Joop
Working...