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

    #16
    I did change the hostname recently but I restarted the service by typing

    systemctl restart zabbix-agent2.service

    in the agent conf, the passive and active are both set to the server IP it should be reporting to. If you want screenshots of something I can upload them.

    Comment

    • bloodyskullz
      Member
      • Jan 2025
      • 40

      #17
      So I just installed the agent on a windows server vm and it auto added to the hosts immediately.

      If the linux VM had the agent installed and configured before the auto discovery rules on the server were setup, will it still auto discover the linux vm?

      Comment

      • kyus
        Senior Member
        • Feb 2024
        • 172

        #18
        Yes, it would still discover your hosts.

        Try to add your linux host manually without any interfaces and link the template "Linux by Zabbix agent active", see if it collect metrics... That way you can be sure that your configuration is setup correctly and there's no communication issues between agent and server.

        Also make sure that the hostname you put in the frontend is the same as you defined in your agent config.

        Comment

        • bloodyskullz
          Member
          • Jan 2025
          • 40

          #19
          Yea that didn't do the trick

          Click image for larger version

Name:	image.png
Views:	112
Size:	23.4 KB
ID:	497848

          I am going to try another linux server and see if its just a one off.

          Comment

          • kyus
            Senior Member
            • Feb 2024
            • 172

            #20
            If monitoring your VM with active items didn't work, then you have some issue with the communication between your agent and server... That's why autoregistration isn't working.

            Try to check logs from agent and server.

            Comment

            • bloodyskullz
              Member
              • Jan 2025
              • 40

              #21
              The agent server is using agent 2 (which I believe is the newer one??) and i went to /var/log/zabbix and there is no file at all. If it's not there, what directory am I checking?

              Comment

              • kyus
                Senior Member
                • Feb 2024
                • 172

                #22
                Well, that's the default path for the log file...

                Your agent is running without any problems?
                Try checking the journal for the service.

                journalctl -xeu zabbix-agent2.service

                Also, check the permissions for user zabbix in the log folder

                Comment

                • bloodyskullz
                  Member
                  • Jan 2025
                  • 40

                  #23
                  I think there is an issue with the service but I can't tell:

                  journalctl -xeu zabbix-agent2.service
                  Code:
                  Feb 04 15:08:42 zabbix-agent zabbix_agent2[804]: 2025/02/04 15:08:42.919888 [NVIDIA] failed to kill plugin /usr/libexec/zabbix/zabbix-agent2-plugin-nvidia-gpu: Failed to kill plug>
                  Feb 04 15:08:42 zabbix-agent zabbix_agent2[804]: zabbix_agent2 [804]: ERROR: Cannot register plugins: failed to register metrics of plugin "NVIDIA": failed to start plugin: failed>
                  Feb 04 15:08:42 zabbix-agent systemd[1]: zabbix-agent2.service: Main process exited, code=exited, status=1/FAILURE
                  ░░ Subject: Unit process exited
                  ░░ Defined-By: systemd
                  ░░ Support: https://www.debian.org/support
                  ░░
                  ░░ An ExecStart= process belonging to unit zabbix-agent2.service has exited.
                  ░░
                  ░░ The process' exit code is 'exited' and its exit status is 1.
                  Feb 04 15:08:42 zabbix-agent systemd[1]: zabbix-agent2.service: Failed with result 'exit-code'.
                  ░░ Subject: Unit failed
                  ░░ Defined-By: systemd
                  ░░ Support: https://www.debian.org/support
                  ░░
                  ░░ The unit zabbix-agent2.service has entered the 'failed' state with result 'exit-code'.


                  However when I run systemctl status zabbix-agent2.service, I get this output:

                  Code:
                  ● zabbix-agent2.service - Zabbix Agent 2
                       Loaded: loaded (/lib/systemd/system/zabbix-agent2.service; enabled; preset: enabled)
                       Active: active (running) since Tue 2025-02-04 15:08:39 EST; 191ms ago
                     Main PID: 804 (zabbix_agent2)
                        Tasks: 6 (limit: 2261)
                       Memory: 5.7M
                          CPU: 76ms
                       CGroup: /system.slice/zabbix-agent2.service
                               └─804 /usr/sbin/zabbix_agent2 -c /etc/zabbix/zabbix_agent2.conf
                  ​

                  Comment

                  • kyus
                    Senior Member
                    • Feb 2024
                    • 172

                    #24
                    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

                    • bloodyskullz
                      Member
                      • Jan 2025
                      • 40

                      #25
                      Yea that did the trick, plugin was the issue. I didn't think my nvidia GPU as being passed through to the vm.

                      So the conf file must be edited every time and the hostname + the passive and active check parameters need to be set for the agent to talk to the server?

                      If someone has hundreds of VM's, how does it get deployed?

                      Comment

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

                        #26
                        For hundreds of servers you should have tools for deploying.. Puppet, Ansible, Terraform etc etc..

                        Comment

                        • bloodyskullz
                          Member
                          • Jan 2025
                          • 40

                          #27
                          Thank you to everyone who assisted in supporting this. I will create another topic regarding what I am looking to do.

                          Comment

                          Working...