Ad Widget

Collapse

Have agent ping some things and return pass fail to Zabbix server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maxburn
    Member
    • Sep 2019
    • 48

    #1

    Have agent ping some things and return pass fail to Zabbix server?

    Situation is I have some servers connected to networks that Zabbix server itself will not be able to reach, but I've got a Zabbix agent on that server that should be able to reach those resources. I would like the agent to ping a list of IP addresses and return a pass/fail to Zabbix server, and then of course kick off an action on that.

    The things I'm pinging are BMS controllers and the only resource they have enabled is BACnet/IP UDP 47808, but they will respond to ICMP ping fine.

    Is this possible? Can anyone point me in the right direction?
  • Maxburn
    Member
    • Sep 2019
    • 48

    #2
    Can we get this added to the Zabbix Agent?? https://support.zabbix.com/browse/ZBXNEXT-739

    I was able to cobble together something that works based on comments there and elsewhere; https://blog.jalbert.me/zabbix-monit...-client-pings/

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      Originally posted by Maxburn
      Can we get this added to the Zabbix Agent?? https://support.zabbix.com/browse/ZBXNEXT-739
      I think you would be better off logging in to the support site and voting on the ticket and maybe commenting than posting about it here.

      Comment

      • Maxburn
        Member
        • Sep 2019
        • 48

        #4
        I thought I had this working but appears not.

        It works when connected but when timeout occurs item goes to "Not Supported" with info "Timeout while executing shell script". Agent log contains below, and of course the trigger won't work.

        7760:20211207:070606.891 Failed to execute command "ping 10.10.0.11 -n 1 |find "TTL=">NUL && echo 1 || echo 0": Timeout while executing a shell script.
        4116:20211207:070608.024 Failed to execute command "ping 10.10.0.12 -n 1 |find "TTL=">NUL && echo 1 || echo 0": Timeout while executing a shell script.
        Line in config is this;

        Code:
        UserParameter=ping.host[*],ping $1 -n 1 |find "TTL=">NUL && echo 1 || echo 0
        I don't understand why that is because it works fine at the DOS prompt on that same machine the zabbix agent is on.

        Microsoft Windows [Version 10.0.17763.2300]
        (c) 2018 Microsoft Corporation. All rights reserved.

        C:\Users\user.server>ping 10.10.0.11 -n 1 |find "TTL=">NUL && echo 1 || echo 0
        0

        C:\Users\user.server>ping 10.10.0.1 -n 1 |find "TTL=">NUL && echo 1 || echo 0
        1

        C:\Users\user.server>

        Comment

        • Maxburn
          Member
          • Sep 2019
          • 48

          #5
          Default zabbix agent timeout seems to be 3 in the config file, this script to fail needs about four maybe five seconds. I changed that timeout to 20 seconds and restarted the agent. This fixed ONE of my ping items and the trigger on that one does actually fire a fail alert now, nice.

          BUT the other item is still reporting timeout in zabbix front end. The agent log does not contain any more errors like above, no errors at all sense it's restart. I also tried disabling the item and reenabling it, same problem. Restarted the zabbix VM, still won't work.

          OK, it works after I told it to "execute now" WHY it didn't run itself when I have it set to every minute the world will never know. I'm going to need more time with testing this before I have confidence that this works.
          Last edited by Maxburn; 07-12-2021, 15:05.

          Comment

          Working...