Ad Widget

Collapse

Problems with active mode

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • z0nk
    Member
    • Oct 2024
    • 45

    #1

    Problems with active mode

    I am a new user. I am looking for monitoring for several dozen clients and decided to test Zabbix. Unfortunately, I have a lot of problems with such a basic issue as active monitoring. I cannot use passive monitoring due to the dispersion of clients - each station must be monitored individually by sending information to the central server (without proxy server because are even separated in clients infrastructure - VLANs).

    I installed agent2 and the Template called "Linux by Zabbix agent active" works (strangely enough, because there is no version 2 here), but I am unable to start "Systemd by Zabbix agent 2" and "Website certificate by Zabbix agent 2" - they simply do not collect any information. While I may have misunderstood/configured certificate monitoring, systemd monitoring should simply work on its own.
    I have read that this is not only my problem https://www.zabbix.com/forum/zabbix-...367#post491367

    Zabbix seems to have big problems with active mode. I don't want to use passive mode at all.There is no (easy) way to disable this option, nor any clear information on this matter. Is there a list of modules that will work? Everything is unclear, including the agent and agent2 issue - where it is not clear what exactly is going on, some modules work, some not. I have agent2, but the agent(1) module works ("Linux by Zabbix agent active")? But modules designed for agent 2 don't work :-). Strange things​...

    Maybe Zabbix is just not for me in this situation where I need do active monitoring?
  • Answer selected by z0nk at 31-10-2024, 12:27.
    ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    I have problems when for example this linux agent active template works and other - systemd, doesnt work
    Because "linux agent active" uses Agent active mode, while "Systemd by Zabbix agent 2" uses agent in passive mode
    It will never gonna work with passive option, as I have many diffrent networks (LANs)
    Has nothing to do with high number of LANs. It only defines direction of session establishment in ZBX Server <-> ZBX agent communication. But if you don't want to use passive mode - totally your right. You do you.
    Why systemd template not working active?
    Why there is no template for active, only for passive?
    Because whoever created the template created it in passive mode and decided active mode is not needed. That is the whole reason, nothing else
    There is no switch/option to change it.
    There is. Go to Configuration - Templates - find template "Systemd by Zabbix agent 2​" - click it - click clone at the bottom - Change name to "Systemd by Zabbix agent 2​ active" - Save it - (all further change do on new template to preserve original in case of mistakes) - Click on Discovery - Click on "Socket units discovery" - Change type from "Zabbix agent" to "Zabbix agent active" - Click update - Click on item prototypes under said discovery - Click on "{#UNIT.NAME}: Get unit info" item prototype - Change type to "Zabbix agent active" - Click update - Assign new template to host and test
    (mind you the above was written form head without testing in actual Zabbix, so general flow should be like written, but minor mistakes are possible).

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #2
      Passive vs active. It is just a matter, is server/proxy asking from agent (passive) or agent collecting data locally and sending it away to server/proxy (active). Thats all...
      There are some few items that work only as active items (log related). But for majority of items, it does not matter is it configured as passive or active, results are same. With passive items all workload is on server/proxy, with active items, on host locally. In general active is better as it does not require so much resources from server/proxy just for polling things...
      There are some items, which work only with agent2 (that systemd stuff included, https://www.zabbix.com/documentation.../zabbix_agent2 ). But all things for classic agent will work with agent2 also (thats why your "linux by zabbix agent" works with agent2).

      Comment

      • z0nk
        Member
        • Oct 2024
        • 45

        #3
        And this is why I don't know, why it doesn't work as should... not only for me https://www.zabbix.com/forum/zabbix-...367#post491367 - tutorials/documentation for tests is about zabbix_get, which is passive monitoring (https://www.zabbix.com/forum/zabbix-...559#post493559). Looks like noone care about active monitoring, and this is just additional.

        Same is about certificate monitoring, for selected hosts I would like monitor own (localhost) certificate. I thought maybe I was doing something wrong, but I have the same problem with systemd, which is not configured by default. Looks like Zabbix have some basic problems... with the most general and basic monitoring resources... after enabling "Systemd by Zabbix agent 2" there are not any new "items".

        From what you write, it should work - but it doesn't :-). I have only agent2 from latest 7 LTS on 20.04 Ubuntu. How deal with it? I have fresh install and it just should work, "Linux by Zabbix agent active" works, but other don't. Why? If this "Linux by Zabbix agent active" works fine then there is not issue in connection etc.

        Also I have one host availability on orange because lack of passive monitoring, can I generally disable it as there will not be passive way? I have no idea how clean this 'notification' (this is not alert).
        Last edited by z0nk; 30-10-2024, 15:38.

        Comment

        • troffasky
          Senior Member
          • Jul 2008
          • 567

          #4
          Originally posted by cyber
          But for majority of items, it does not matter is it configured as passive or active, results are same.
          Welllll....in one sense yes, items should return the same data whether they're active or passive. But a misconception a lot of people trip over with active/passive.....you have to specifically configure each item type server-side, which means maintaining two sets of templates for active/passive agents.

          And calling the new agent implementation "agent2" is another source of confusion!

          Comment

          • z0nk
            Member
            • Oct 2024
            • 45

            #5
            Originally posted by troffasky

            you have to specifically configure each item type server-side, which means maintaining two sets of templates for active/passive agents.
            please explain, I need only active agents, how got for example systemd output (which I can see locally on agent2 but it is not pushed to zabbix server)

            Comment

            • ISiroshtan
              Senior Member
              • Nov 2019
              • 324

              #6
              Man, you mixing everything together, even if things have nothing to do with each other. Don't do that.

              Let us start on agent vs agent2. Agent2 is later more advanced version. It can do everything agent1 can do + more. So any template designed for agent1 can be executed by agent2 with no problems. But not the other way around. If template uses some new features of agent2 - it will not be supported by agent1. And that is all you need to know in scope of this thread.
              So if you assign template "... by zabbix agent" and it works on agent 2 - it's absolutely expected and no reason to be confused by it

              Now to active/passive. The only difference between active/passive that can affect if item works or not is a direction of communication initiation, as it can be blocked by firewalls. Your active items work - meaning session establishment from machines to Zabbix server is allowed. But it does not mean that session establishment from Zabbix server to hosts is allowed, so passive items can be non-operational in your setup.
              Now, the template "Systemd by Zabbix agent 2" does not have any indication that it uses Zabbix agent active checks in its name. Checking further here - as far as I can see it indeed uses only passive checks - and that is a likely reason you have problem with it (and not because it's agent2).
              I would advise you to try create a copy of this template and switch all item and discovery of 'Zabbix agent' type to "Zabbix agent active" and check if it will make it work for you

              Comment

              • z0nk
                Member
                • Oct 2024
                • 45

                #7
                ISiroshtan, thanks for explaining.

                I am using only agent2.

                I have problems when for example this linux agent active template works and other - systemd, doesnt work. This is not related to firewall, that just don't work in active way and I don't know how switch it to active . It will never gonna work with passive option, as I have many diffrent networks (LANs). Why systemd template not working active? It could work same way, but it dosent work, and I dont now how use it in active way. There is no switch/option to change it.

                Why there is no template for active, only for passive? I have no idea how fix it, what change. Why there is no switch or second template? For person who knows what to do it is probably 15min, for new people this is not possible to do it in hours. I allready spend 3 days for some basics.

                Comment

                • troffasky
                  Senior Member
                  • Jul 2008
                  • 567

                  #8
                  Originally posted by ISiroshtan
                  Man, you mixing everything together, even if things have nothing to do with each other. Don't do that.
                  Easy to say when you already know the answer. There are 12 factory passive-mode templates for Agent2 items but only one Agent2 template in active-mode, so it's easy to accidentally conclude that Agent2 and active mode are not compatible.
                  Last edited by troffasky; 31-10-2024, 11:56.

                  Comment


                  • ISiroshtan
                    ISiroshtan commented
                    Editing a comment
                    I don't know, maybe it's just me and my perception of how to figure out new systems is wrong, but when I start to work with new product and I struggle - I go and read the documentation to figure out what I'm doing wrong

                    For topic in question, documentation has a dedicated page explaining active and passive check difference. And then there is a page for agent2, and first sentence on it directly says "Zabbix agent 2 supports all item keys supported for Zabbix agent on Unix and Windows.". This one sentence should be enough to understand why template for agent 1 works with agent 2.

                    So it's not "Easy to say when you already know the answer. " it's "Easy to say when you actually do the RTFM".
                    And mind you, I agree that new ppl might need help, that is why forum exists and I'm participating in it form time to time. That is why I did not just said "you are wrong!", I did provide the explanations
                • z0nk
                  Member
                  • Oct 2024
                  • 45

                  #9
                  Where is even possible to edit template code? Do I need do it on backend? Where... I can't find this file(s) on disk with
                  Code:
                  find
                  Last edited by z0nk; 31-10-2024, 12:06.

                  Comment

                  • ISiroshtan
                    Senior Member
                    • Nov 2019
                    • 324

                    #10
                    I have problems when for example this linux agent active template works and other - systemd, doesnt work
                    Because "linux agent active" uses Agent active mode, while "Systemd by Zabbix agent 2" uses agent in passive mode
                    It will never gonna work with passive option, as I have many diffrent networks (LANs)
                    Has nothing to do with high number of LANs. It only defines direction of session establishment in ZBX Server <-> ZBX agent communication. But if you don't want to use passive mode - totally your right. You do you.
                    Why systemd template not working active?
                    Why there is no template for active, only for passive?
                    Because whoever created the template created it in passive mode and decided active mode is not needed. That is the whole reason, nothing else
                    There is no switch/option to change it.
                    There is. Go to Configuration - Templates - find template "Systemd by Zabbix agent 2​" - click it - click clone at the bottom - Change name to "Systemd by Zabbix agent 2​ active" - Save it - (all further change do on new template to preserve original in case of mistakes) - Click on Discovery - Click on "Socket units discovery" - Change type from "Zabbix agent" to "Zabbix agent active" - Click update - Click on item prototypes under said discovery - Click on "{#UNIT.NAME}: Get unit info" item prototype - Change type to "Zabbix agent active" - Click update - Assign new template to host and test
                    (mind you the above was written form head without testing in actual Zabbix, so general flow should be like written, but minor mistakes are possible).

                    Comment

                    • ISiroshtan
                      Senior Member
                      • Nov 2019
                      • 324

                      #11
                      Ah, there is also "Service units discovery" in there, do the same as you did with "Socket units discovery". Item prototype you need to update is "{#UNIT.NAME}: Get unit info"

                      If you struggle - add screenshots of your progress and we should be able to guide you or see possible mistakes

                      Comment

                      • z0nk
                        Member
                        • Oct 2024
                        • 45

                        #12
                        And where can I find older version? I have 7.0 and there is
                        Code:
                        Zabbix version: 7.2 and higher.

                        Comment


                        • ISiroshtan
                          ISiroshtan commented
                          Editing a comment
                          Start with doing changes that I described above, that generally should be enough to make it work in your setup
                      • z0nk
                        Member
                        • Oct 2024
                        • 45

                        #13
                        Originally posted by ISiroshtan
                        There is. Go to Configuration - Templates - find template "Systemd by Zabbix agent 2" - click it - click clone at the bottom - Change name to "Systemd by Zabbix agent 2​ active" - Save it - (all further change do on new template to preserve original in case of mistakes) - Click on Discovery - Click on "Socket units discovery" - Change type from "Zabbix agent" to "Zabbix agent active" - Click update - Click on item prototypes under said discovery - Click on "{#UNIT.NAME}: Get unit info" item prototype - Change type to "Zabbix agent active" - Click update - Assign new template to host and test
                        (mind you the above was written form head without testing in actual Zabbix, so general flow should be like written, but minor mistakes are possible).
                        Thanks,
                        Click on item prototypes under said discovery
                        You mean Service units discovery or Socket units discovery in this step?

                        Comment


                        • ISiroshtan
                          ISiroshtan commented
                          Editing a comment
                          You will need to update both. Both discoveries and item prototypes under both discoveries. Did not notice there is 2 different discoveries initially, sorry bout that.
                      • z0nk
                        Member
                        • Oct 2024
                        • 45

                        #14
                        Thanks ISiroshtan, it probably works, I got some informations about services .

                        However this is so hard for new users to handle it without such tips...

                        Imo there should be general switch between passive / active in such mature softweare like Zabbix...

                        Comment

                        • ISiroshtan
                          Senior Member
                          • Nov 2019
                          • 324

                          #15
                          I would just say that Zabbix, as probably most other open source product, is free in term of money, but instead you pay for it in other way, either:
                          - you buy the support to sort everything for you
                          - you buy courses for them to teach you
                          - or you pay with your (work)hours to learn it yourself

                          Comment

                          Working...