Ad Widget

Collapse

Auto discovery - linux servers

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bloodyskullz
    Member
    • Jan 2025
    • 40

    #1

    Auto discovery - linux servers

    Hi All,

    Just started messing with zabbix and i setup some vms to get an understanding. Currently have an issue with the vm discovery:

    Setup is as follows:

    1 debian 12 vm running the zabbix server
    1 debian 12 vm running the zabbix agent 2

    On the server, I enabled the discovery rules and set it to check every 10 minutes, also configured the network range so it knows which network range to look at.

    On the agent side, i configured the config file to point to the zabbix server. If I do a manual host entry on the server, it works but I am trying to get it going automatically using the discover and add via that method.

    Is there anything I need to tweak or change in order to have auto discovery auto add new linux vms?
  • Answer selected by bloodyskullz at 05-02-2025, 15:24.
    kyus
    Senior Member
    • Feb 2024
    • 171

    Your service was up for 191ms

    Isn't it in a restart loop?

    Since the error you're getting is from this nvidia plugin, just disable it, there's been more people relating problems because of that.

    Edit this file: /etc/zabbix/zabbix_agent2.d/plugins.d/nvidia.conf
    Then comment out the following line:

    # Plugins.NVIDIA.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-nvidia-gpu
    Save the file and restart the Zabbix Agent 2 service. The error should no longer appear.

    Here's the discussion about this topic:

    Comment

    • Blevar
      Member
      • Jan 2025
      • 68

      #2
      On the machine running agent you should also edith the Hostname parameter in the config file. By default it is set to 'Zabbix server'. Just type what you would like this particular host to be identified by Zabbix server. This name has to be unique for every host you plan to monitor.

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #3
        Are you talking about "network discovery" or "Active agent autoregistration"?

        In case of network discovery, have you created an action to add host?​
        For auto-detection, you need to specify the address of the active server in the agent's configuration.


        Comment

        • bloodyskullz
          Member
          • Jan 2025
          • 40

          #4
          I am not too familiar with the terminology yet but I am uploading pictures of what I have configured. I suspect that I need an action or a rule that says to auto add the linux machines to inventory for monitoring.

          Those are the default rules that I tweaked slightly and I have enabled. Am I just missing a rule or an action that says auto add?

          Also your last link doesn't have any data.
          Attached Files

          Comment

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

            #5
            10s for a discovery rule to run.. too often... it is probably still busy with previous run...
            "add to hostgroups" already takes care of adding a host.. there would be nothing to add, if host is not created...

            I have always found all that network discovery to be awkward, if we already have autoregistration options... Why bother to search for those agents, if they can come by themselves, say hello and get their initial monitoring instructions? If you would need to discover some dumb printers or something, but agents... bleh.. Better add autoregistration action, than discovery...

            Comment

            • bloodyskullz
              Member
              • Jan 2025
              • 40

              #6
              Originally posted by cyber
              10s for a discovery rule to run.. too often... it is probably still busy with previous run...
              "add to hostgroups" already takes care of adding a host.. there would be nothing to add, if host is not created...

              I have always found all that network discovery to be awkward, if we already have autoregistration options... Why bother to search for those agents, if they can come by themselves, say hello and get their initial monitoring instructions? If you would need to discover some dumb printers or something, but agents... bleh.. Better add autoregistration action, than discovery...
              I initially had this at 1hr and nothing happened. Switched it to 10 minutes and nothing happened. I am currently on a test system right now but even if I stuck this in a non lab environment, there wouldn't be anything like printers etc..

              So I am confused at this moment. Right now, what do I need to do to add hosts automatically? Am I missing a step?

              Comment

              • kyus
                Senior Member
                • Feb 2024
                • 171

                #7
                Try to setup autoregistration as it was suggested... Documentation for that:


                Additionally, you can go to Monitoring -> Discovery
                You can check there if Zabbix discovered your vms, that way you can find out if the problem is in the discovery or in the action to add the hosts.

                Comment

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

                  #8
                  yea.. drop that discovery (all you can read in forum is that "my disco is not workin", "whats wrong with the disco", "help fix my disco")... Set up autoreg action (not discovery action). something like "if metadata contains "linux" add host to group "linux boxes" and add template "linux active"". Or if you have nicely defined naming for hosts, use that "hostname contains "lx"" or "hostname contains "win"... Add ServerActive parameter to your agent config (You might even have it already), which points to your Zabbix server. If there is no FW issues, your agent should, at startup, call in to server, stating, that it wants some monitoring parameters. Your server in turn, should register that host automatically, give it that template and everything should start working...

                  Comment

                  • bloodyskullz
                    Member
                    • Jan 2025
                    • 40

                    #9
                    Been trying to wrap my brain around this (slow learner, bare with me). I created one but I noticed the condition has hostname options and I left that blank. I am thinking that it will just dynamically populate the hostname but I guess I am wrong.

                    I also added some operations, nothing has populated just yet. Click image for larger version

Name:	2025-01-17_15-08.png
Views:	412
Size:	9.4 KB
ID:	497340

                    Comment

                    • kyus
                      Senior Member
                      • Feb 2024
                      • 171

                      #10
                      You created a autoregistration action, right?

                      In Zabbix 7:
                      Alerts -> Actions -> Autoregistration actions

                      In Zabbix 6:
                      Configuration -> Actions -> Autoregistration actions

                      If you did it, then yes, it is configured correctly, you don't need any conditions for it to work...

                      Are you sure that your agent can reach the server?

                      From the debian vm with the agent installed:
                      Code:
                      telnet serverip 10051
                      Does it connect to the server?

                      Comment

                      • bloodyskullz
                        Member
                        • Jan 2025
                        • 40

                        #11
                        Yes i created an auto registration action in version 7.

                        Ping and telnet are both successful
                        Last edited by bloodyskullz; 18-01-2025, 22:58.

                        Comment

                        • bloodyskullz
                          Member
                          • Jan 2025
                          • 40

                          #12
                          I double checked and the server can't connect to the agent VM on port 10050 but it can ping the agent server.

                          Could this be the reason the auto discovery isn't working?

                          EDIT: previous post was the agent VM being capable of connecting to the server using telnet and ping.

                          Comment

                          • kyus
                            Senior Member
                            • Feb 2024
                            • 171

                            #13
                            If the agent can reach the server then your host should've been created by the autoregistration action...

                            But your server not being able to connect to the agent is the reason why your first attempt with discovery + discovery action didn't work...

                            Just to make sure... Have you setup ServerActive parameter in your conf file /etc/zabbix/zabbix-agent2.conf ?

                            Comment

                            • bloodyskullz
                              Member
                              • Jan 2025
                              • 40

                              #14
                              Yes, it is set to the IP address of the server but without a network mask. Does this matter?

                              Comment

                              • kyus
                                Senior Member
                                • Feb 2024
                                • 171

                                #15
                                No, network mask isn't required.

                                Have you changed the Hostname of the agent so it is unique?
                                By default it is "Zabbix server" and that would conflict with the host that is already in Zabbix.

                                If you have setup "ActiveServer" and "Hostname", restarted your agent systemd service and added a autoregistration action, it should work...

                                Comment

                                Working...