Ad Widget

Collapse

Zabbix 4.4 simple checks just don't work at all

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MoT
    Junior Member
    • Feb 2020
    • 8

    #1

    Zabbix 4.4 simple checks just don't work at all

    Hello,


    I have a Zabbix Server + Agent + Frontend on one server. Did everything by the book. Actually I returned to Zabbix after 4 years and it simply does not work. I created some hosts but simplechecks (ping / TCP) seem not to work - they report success even though they should not, and error when TCP connect should work. Especially the ping of a host on the same network as the Zabbix Server is really annoying.

    THE PING IS NOT BEING ACTUALLY MADE - I checked with tcpdump. I also made a wrapper script for fping, that logs the parameters that Zabbix passed to fping (and made Zabbix to call my script instead of fping). This is shocking but all the time I get an fping call without a target address - all I get called are some silly arguments: "-C3 -i0" so this is without any target address to ping! And the item status is all the time up! This is pure nonesense! What is going on?

    I even threw away builtin templates, and manually added a simplecheck, but it still does not work. Even when I specified in the item key the IP address explicitly "icmpping[w.x.y.z]" it doesn't help at all. No ping is being made to w.x.y.z host. I specify in the host config hostname a correct IP (w.x.y.123) and a wrong IP ending (.100) and it doesn't change anything. Only when I specifi agent interface as a wrong one (some random IP) only then Zabbix sees a problem. But when I put 127.0.0.1 in the Agent interface, Zabbix is happy that the ping item is up, although nothin pings! And yes, I have a correctly setup agent on the same host as zabbix server, and anyway I don't get a ZBX green icon because I use a simple check from server.

    Please help because this is some mess.

    And here is my setup: I did a fresh installation of Zabbix 4.4 on Ubuntu 18.04 with Apache2 and PostgreSQL - this was installed from packages according to the official Zabbix steps. Hmm well I did it right after installing OMD from packages ( https://labs.consol.de/omd/ ) but this OMD should not cause these problems.
  • MoT
    Junior Member
    • Feb 2020
    • 8

    #2
    Update: ok, now I see that fping is reading target address from a file - I see what it is pinging through this very-fast-updating loop: while true; do cat /tmp/zabb*pinger; done

    And after I reverted fping and restarted the zabbix server, if I specify "icmpping[w.x.y.z]" then pings to w.x.y.z work. But when I use only "icmpping" (without specifying the target), then the ping is not being made - the icmpping does not use host's hostname! I don't understand this. How to make simplecheck use the hostname of the host? Because the agent connection needs to be 127.0.0.1

    Comment

    • MoT
      Junior Member
      • Feb 2020
      • 8

      #3
      Hmm... let me rephrase my call for help:

      I need to use simple checks (ping, TCP, http) on many hosts from the zabbix server itself (without installing an agent on these monitored hosts), and zabbix server machine also runs a zabbix agent. And also I need to use some remote agent and/or proxy to run these simple checks on other host reachable by that agent/proxy.

      How do i do that? Is it enough to put an IP addres to the "host name" field in the host and use an item with a simplecheck (directly or through a template)? Because I do it and it doesn't work (like I wrote in previous posts)! On the other hand SNMP works nice, and the SNMP templates with discovery are just great, but SNMP is something different.

      I have read that ping simplecheck is done by Zabbix Server, but the item requires me to enter at least one connection so I enter the zabbix agent 127.0.0.1 - but if enter the agent, then will icmpping be run by the zabbix agent or the zabbix server?

      I ask these basic questions here because I really read all the docs and the docs really do not answer these very basic questions, but all docs have just ambiguous terms - assuming you understand "what is what" and the relations between terms. And the "Terms" page is not clear enough in that regard either. So even when you look at all the docs pages then what you finally get is actually coming down to something like "hostname field - you put the name of the host" - but one still doesn't know for sure:
      • does really the hostname field exactly mean and address (IP or name address) of the monitored host, or if not then where I put the address?
      • will this hostname be used by the item, and if yes then under which conditions (when yes, when no)?
      • is the {HOST.NAME) macro referring to that monitored hostname or is it the name/address of the monitored server - this was not clear enough on the docs page with the list of macros.
      • and all the other questions I asked above, and other stuff like that
      So any help much appreciated, than you!

      Comment

      • MoT
        Junior Member
        • Feb 2020
        • 8

        #4
        Originally posted by splitek
        I hope it will help to clear some of your considerations.
        Thank you!

        Originally posted by splitek
        As in: https://www.zabbix.com/documentation.../simple_checks
        "Note that Zabbix agent is not needed for simple checks. Zabbix server/proxy is responsible for the processing of simple checks (making external connections, etc)."

        Next in a table:
        Code:
        icmpping[<target>,<packets>,<interval>,<size>,<timeout>]
        [B]target[/B] - host IP or DNS name
        ​​​​​​Under any host you can add simple check and it should work. But work from Zabbix server or Zabbix proxy (if host have defined proxy) not from agent (even if host have defined agent).
        That's what I read, so the question is what is the point in putting agent connection in the host definition, if I only use simple checks in the host's items? Zabbix will not allow me not to provide an agent connection, even if I don't want to use any!

        So that's why I asked to be sure if I understand corrrectly that: putting the agent is useless, but reuiqred formally, and for 100% the server itself will be the one to make the simple check.

        Originally posted by splitek
        If you use macros then macros {HOST.HOST} resolve to provided host name.

        {HOST.NAME) resolve to "Visible host name"
        https://www.zabbix.com/documentation...ed_by_location
        Oh, I missed that, will try it thanks.

        Originally posted by splitek
        When you define host you can provide any hostname.
        Simple checks items look for "target" or "ip" in definition (they don't use hostname).
        I do not understand what you wrote. I know that using only "icmpping" ( without the bracket [specification] ) will assume some target from somewhere - I guess the host definition. Especially so that one template would work for all different hosts. And the bultin Zabbix template "Template Module ICMP Ping" actually does exactly that - i.e. it provides only "icmpping" (without specification) in the "ICMP ping" item.

        So it does not use "impping[{HOST.HOST}]" or anything like that.

        So my question is: where in the host definition do I define something that the "icmpping" will take as the default target?
        Last edited by MoT; 11-02-2020, 17:05.

        Comment


        • gert.derouck
          gert.derouck commented
          Editing a comment
          You just need to add an agent interface in your host definition. The ping item will use the IP/DNS you added.
          It doesn't matter if you wont use any agent items.
      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #5
        In zabbix there is a host and it's just a name. A name which refers to the monitored target. So, if you use an agent the name would be generally called the hostname where agent is running.

        Then, the host has interfaces (Agent interfaces in host configuration form) and that's a combination of an IP (or DNS name) and a port. Interfaces kind of describe the agent to talk to to get monitoring data from the host. Every item is attached to an interface (Host interface in item configuration form). And you are right, in simple checks interfaces seam meaningless, because there is no agent of any kind. But! As splitek noted, some item keys have defaults for the IP, port etc. E. g.

        Code:
        icmpping[]
        is valid item key, but what will it ping? By default it will use the target (either IP or DNS name) specified in the interface that is attached to this item.

        Another reason to always have interface attached to an item is Macros. Macros like {HOST.IP}, {HOST.PORT}, that are allowed in different places where we need more information about the received monitoring data. These also are resolved using interface.

        So yeah, it sounds weird but people are used to the fact that even if you only have simple checks on a host you define an IP in "Zabbix agent" interface for simple checks, despite that that interface will never be used to talk to Zabbix agent. :-)
        Last edited by dimir; 11-02-2020, 18:09.

        Comment

        • MoT
          Junior Member
          • Feb 2020
          • 8

          #6
          Oh... now I see. I suspected this but would not go into it because it seems so improper. First of all, won't there be a Zabbix Agent connection error on the host status? Because there is no agent there, but I put the IP/DNS address in the connection interface of the host.

          So perhaps it would actually be more proper to use the "host name" field and refer to {HOST.HOST} macro in the simple check (also in a template)? I mean like this:

          Code:
          [FONT=arial]icmpping[{HOST.HOST}][/FONT]
          What do you think?

          Comment

          • dimir
            Zabbix developer
            • Apr 2011
            • 1080

            #7
            So perhaps it would actually be more proper to use the "host name" field and refer to {HOST.HOST} macro in the simple check (also in a template)? I mean like this:

            Code:
            icmpping[{HOST.HOST}]
            This seems wrong because you would have to name your host an IP or DNS name that actually works.

            And no, the agent interface icon will not become red, since this icon is only affected when you have at least one item configured on a host of type "Zabbix agent" (passive). And since your items are of type simple check the icon will stay gray, the "agent" won't be attempted to contact.

            I suggest keeping your configuration as it is now and use defaults from the interface. As I said, as it seems weird, it's part of the design and older users are aware of this "feature".
            Last edited by dimir; 11-02-2020, 18:48.

            Comment

            • MoT
              Junior Member
              • Feb 2020
              • 8

              #8
              Thank you, it works like you wrote, now everything is clear to me.

              I believe these couple of sentences clearing out REALLY SHOULD be included in the docs, instead of assuming that someone should now it or somehow find it out finally! Come on!

              Comment


              • Hamardaban
                Hamardaban commented
                Editing a comment
                Everything written earlier, all tips and clarifications, is in the documentation. Careful reading greatly reduces the time to find solutions to problems. :-)
            Working...