Ad Widget

Collapse

Host side ping

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • coop
    Member
    • Aug 2009
    • 46

    #1

    Host side ping

    I'm working on a new Zabbix implementation (switching over from Nagios) and I've been asked to setup a host side ping on a Windows system. They need a ping type request to originate from the host and report back it's results in something Zabbix can handle.

    Has anyone tinkered with this? I can launch a UserParameter with a ping command and get data back, but shaping that into something Zabbix can show as Ok or Problem is where I'm stuck.... I just get the ping response lines.


    Thanks!
    Last edited by coop; 29-09-2009, 16:03.
  • Calimero
    Senior Member
    • Nov 2006
    • 481

    #2
    You need to create a trigger.

    Config > Triggers. Choose host, click Create Trigger.

    Name: "Ping status"

    Expression: click Insert to open the selection/wizard pop-up.
    Choose your host, choose your 'ping' item. Function: choose 'Last value = N', Set N to 0. Click Insert.

    Expression will look like:
    {your_hostname:your_ping_item.last(0)}=0

    ==> Trigger will be ON (problem) when last value is 0

    Define trigger severity. Click Save.

    Comment

    • coop
      Member
      • Aug 2009
      • 46

      #3
      Thanks for the reply!!

      The trigger setup looks great, but I'm not sure I see how that will force my Ping check to come from the agent system instead of the Zabbix server. I need to see the results of the agent system pinging a device.

      Sorry, I should have worded my question properly.

      Comment

      • coop
        Member
        • Aug 2009
        • 46

        #4
        I think we may have resolved this. This is one method, but if someone else has a better method that would be great.

        (1) Setup a User Parameter in the zabbix_agentd.conf file:
        UserParameter=local.ping[*],C:\temp\localping.bat $1

        (2) Create a file called localping.bat with the following lines:
        @echo off
        PING %1 -n 1 | FIND "TTL=" >NUL
        IF NOT ERRORLEVEL 1 GOTO ONLINE
        IF ERRORLEVEL 1 GOTO OFFLINE
        GOTO END

        :OFFLINE
        ECHO 0
        GOTO END

        :ONLINE
        ECHO 1
        GOTO END

        :END


        (3) Create Item for host with the key local.ping[host-to-ping]
        I also set my Show Value to Service Map.

        Restart the agent and away it goes.

        Comment

        • easy_john
          Junior Member
          • Jan 2008
          • 28

          #5
          Originally posted by coop
          (2) Create a file called localping.bat with the following lines:
          (3) Create Item for host with the key local.ping[host-to-ping]
          One line to zabbix_agentd.conf

          # local.ping
          UserParameter=local.ping[*],ping $1 -n 1 |find "TTL=">NUL && echo 1 || echo 0

          Comment

          Working...