Ad Widget

Collapse

Ping a Router / Switch on Zabbix 2.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeffusher
    Junior Member
    • May 2012
    • 2

    #1

    Ping a Router / Switch on Zabbix 2.0

    Hi guys,

    Previously on Zabbix 1.8 I was able to have an iccmping job set up to just simply ping any switch or router via an IP address.

    Under Zabbiz 2.0 I can't seem to do this simple task as the ping check now has an extra field for "Host Interface" which needs to be assigned to an Agent, an SNMP port etc etc.

    It's a switch or router, it does not have an agent. All I want to do is ping it and get back a response. I am unable to do this as the host interface is a required field and can't be left blank.

    Any ideas on how to just do a simple ping to a device on Zabbix 2 would be most appreciated.

    Regards

    Jeff
  • michelis
    Junior Member
    • Jan 2012
    • 14

    #2
    Hi,

    I'm facing a similar problem. If you find a solution can you post it here?

    Greetz
    Tobias

    Comment

    • frater
      Senior Member
      • Oct 2010
      • 340

      #3
      Linux:
      Code:
      UserParameter=net.ping[*], ping -c1 -W3 $1 2>/dev/null | grep -c '1 received'

      Windows:
      Code:
      UserParameter=net.ping[*], ping -n 1 -w 1 "$1" 2>null | find  /i "TTL=" /c
      Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

      Comment

      • frater
        Senior Member
        • Oct 2010
        • 340

        #4
        The previous answer was for a Windows or Linux agent....
        Of course you can still use it on the zabbix server as it's probably running an agent as well....

        In the past I wrote a more informative external script to test packetloss which I'm using for each host. It takes an IP as parameter

        cat /usr/local/sbin/packetloss
        Code:
        #!/bin/bash
        PACKETLOSS=`ping -q -c5 -i0.3 -w4 ${1} | grep transmitted | grep -Eo '[0-9%]* packet loss' | tr -cd '0-9'`
        [ -z "${PACKETLOSS}" ] && PACKETLOSS=100
        
        echo "${PACKETLOSS}"
        Code:
        cd /etc/zabbix/externalscripts
        ln -s /usr/local/sbin/packetloss
        Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

        Comment

        • michelis
          Junior Member
          • Jan 2012
          • 14

          #5
          When you don't see the value of 'Host interface' try to remove the zabbix.conf.php. After I did that everything works fine for me.

          Greetz
          Tobias

          Comment

          Working...