Ad Widget

Collapse

Zabbix Agent to connecting to server.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gregorywest
    Junior Member
    • Jan 2025
    • 11

    #1

    Zabbix Agent to connecting to server.

    I am running Zabbix 7.4.1 and am having issues conect remote computers. Oddly enough my switchs are connecting just fine under SNMP.
    I have three devices with Zabbix Agents/SNMP
    1) Zabbix server itself - works just fine
    2) Linux box - both ZBX & SNMP indicators are black, yet I am getting CPU % information
    3) Windows 10 - Box ZBX & SNMP are black, and getting no information on this device.

    is there issue with the agent, and Zabbix 7.4.1?
  • MRedbourne
    Senior Member
    • Feb 2023
    • 103

    #2
    Are you using an active connection (Agent -> Server:10051) or a passive connection (Server -> Agent:10050)? Are the necessary ports open on any firewalls that may be in use? Is the agent listening? What happens if you port scan from one side to the other? If for example you have two devices:
    Hostname IP Address Role
    zabbix01.example.com 10.0.0.1 ZBX Server
    fileserver.example.com 10.0.0.2 Windows File Server
    ntp.example.com 10.0.0.3 Linux NTP Server
    From Zabbix Server
    • nmap -Pn -vvv -p 10050 10.0.0.2 10.0.0.3
    From Client Devices
    • nmap -Pn -vvv -p 10051 10.0.0.1
    If those returned closed ports, you're missing firewall rules somewhere. Could be perimeter/internal firewalls (SonicWall, Palo Alto, etc.) or host-based firewalls (Windows Firewall, iptables, ufw, firewalld)
    • (PowerShell) New-NetFirewallRule -DisplayName "Allow Zabbix Server to Agent" ` -Direction Inbound -LocalPort 10050 -Protocol TCP ` -RemoteAddress 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 ` -Action Allow
    • sudo ufw allow from 10.0.0.0/8 to any port 10050 proto tcp
    • sudo firewall-cmd --add-port=10050/tcp
    Change your ports (or ranges) as you see fit. ChatGPT can help modify these commands if you want something more specific. Also, it wouldn't hurt to check your AppArmor or SELinux logs for linux.

    Comment

    • kz3
      Junior Member
      • Jul 2025
      • 20

      #3
      Hey think that this is the issue
      "is there issue with the agent, and Zabbix 7.4.1?"

      Are you trying to use the zabbix agent on a windows 10 to catch data via snmp???

      In windows 10 you need to add the snmp service via powershell or at least thats how it worked to me in windows server you can add the service on the server manager tool
      the snmp service is no longer installed in windows 10 and you need to installe it manually

      1º Install the snmp service
      Powershell> Add-WindowsCapability -Online -Name SNMP.Client~~~~0.0.1.0

      2º Create the file were the community name are going to be located
      Powershell>New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\ Para meters\ValidCommunities" -Force | Out-Null

      3º Add a community name , change the word public to your election
      ​Powershell>New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\ Para meters\ValidCommunities" -Name "public" -PropertyType DWord -Value 4 -Force

      4º And then you need to create a firewall rule to allow inbound trafic on 161 via tcp and restart the snmp service , then it should work



      Comment

      • kz3
        Junior Member
        • Jul 2025
        • 20

        #4
        to add the firewall rule
        New-NetFirewallRule -DisplayName "SNMP" -Protocol UDP -LocalPort 161 -Action Allow -Direction Inbound
        And to restart the snmp service
        Restart-Service -Name SNMP -Force

        Once restarted i will try to snmpwalk from terminal
        because is faster than waiting the device to add on the UI

        try
        snmpwalk -v 2c -c yourcommunityname ipfromthewindows10

        Comment

        • gregorywest
          Junior Member
          • Jan 2025
          • 11

          #5
          I did nmap from Zabbix server to the two workstations. On both port 10050 was open, 10051 closed. From workstation to server both 10050 and 10051 are closed. Did not think I had a firewall running on the server. Everything is behind a fairly massive firewall facing the internet. Server ports open are 22, 80, 10000. I checked all processes on the Zabbix server. There is no firewall running. Could I be missing something in one of the .CONF files?

          re: SNMP this is a separate issue, I have SNMP configured on the workstation, but I will double check it. I did run nmap from the server to the windows workstation port 161 is showing as being closed.

          Greg

          P.S.
          Here is nmap from the zabbix server itself:
          root@Zibbix:/etc/zabbix# nmap -Pn -vvv -p 10050 10.10.10.71
          Starting Nmap 7.93 ( https://nmap.org ) at 2025-08-25 10:47 CDT
          Initiating Parallel DNS resolution of 1 host. at 10:47
          Completed Parallel DNS resolution of 1 host. at 10:47, 0.01s elapsed
          DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 2, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
          Initiating SYN Stealth Scan at 10:47
          Scanning 10.10.10.71 [1 port]
          Discovered open port 10050/tcp on 10.10.10.71
          Completed SYN Stealth Scan at 10:47, 0.03s elapsed (1 total ports)
          Nmap scan report for 10.10.10.71
          Host is up, received user-set (0.00023s latency).
          Scanned at 2025-08-25 10:47:28 CDT for 0s

          PORT STATE SERVICE REASON
          10050/tcp open zabbix-agent syn-ack ttl 64

          Read data files from: /usr/bin/../share/nmap
          Nmap done: 1 IP address (1 host up) scanned in 0.47 seconds
          Raw packets sent: 1 (44B) | Rcvd: 2 (88B)
          root@Zibbix:/etc/zabbix#
          root@Zibbix:/etc/zabbix# nmap -Pn -vvv -p 10051 10.10.10.71
          Starting Nmap 7.93 ( https://nmap.org ) at 2025-08-25 10:50 CDT
          Initiating Parallel DNS resolution of 1 host. at 10:50
          Completed Parallel DNS resolution of 1 host. at 10:50, 0.01s elapsed
          DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 2, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
          Initiating SYN Stealth Scan at 10:50
          Scanning 10.10.10.71 [1 port]
          Discovered open port 10051/tcp on 10.10.10.71
          Completed SYN Stealth Scan at 10:50, 0.03s elapsed (1 total ports)
          Nmap scan report for 10.10.10.71
          Host is up, received user-set (0.00025s latency).
          Scanned at 2025-08-25 10:50:08 CDT for 0s

          PORT STATE SERVICE REASON
          10051/tcp open zabbix-trapper syn-ack ttl 64

          Read data files from: /usr/bin/../share/nmap
          Nmap done: 1 IP address (1 host up) scanned in 0.47 seconds
          Raw packets sent: 1 (44B) | Rcvd: 2 (88B)
          root@Zibbix:/etc/zabbix#

          I have verified there is no firewall running. Is there something in the agent that would stop it from listening to the server if configured wrong?

          Last edited by gregorywest; 25-08-2025, 17:51.

          Comment

          • kz3
            Junior Member
            • Jul 2025
            • 20

            #6
            Heyy
            So as i understand now the problem is whit the conection from the zabbix server to a workstation via zabbix agent on 10050

            the connection attemps are over a windows or linux ????
            just asking just to say that in linux the minimum for the agent on the host to work is at least in my case(ubuntu 24.04) the minimun config required in the /etc/zabbix/zabbix-agent.conf is
            SERVER=<yourserverip>
            ListenPort=<yourlistenport>

            On windows is faster that just executing the .exe agent downloaded from https://www.zabbix.com/la/download_agents
            you just have yo put the server ip

            by knowing that you already have switches and other host even via snmp it means that zabbix is working good
            it is strange for me that it isn´t working because the 10050

            is the agent running???
            because sometimes by changing something on the .CONF on the agents they fail

            try to conect from the zabbix server and then watch the logs of the agents

            Comment

            • gregorywest
              Junior Member
              • Jan 2025
              • 11

              #7
              Server is Linux, WS one windows, one Linux. Let me verify the .CONF. And yes the windows agent is running. been tripped by agents not running in the past

              Comment

              • kz3
                Junior Member
                • Jul 2025
                • 20

                #8
                This works for both windows and linux
                Server=theipfromtheserver
                ListenPort=usually10050
                ListenIP=iusuallyleaveitlikethat

                Click image for larger version

Name:	image.png
Views:	62
Size:	14.2 KB
ID:	506576

                Comment

                • gregorywest
                  Junior Member
                  • Jan 2025
                  • 11

                  #9
                  I had the ListenIP #'d out. Set it to what you have. Here is an odd thing. I have a zabbix_agent2.conf, but not a zabbix-agent2.conf _ vs - Which is correct?

                  Here is the odd part. With Windows WS is found with the agent discovery:
                  Click image for larger version

Name:	image.png
Views:	80
Size:	13.2 KB
ID:	506590it is Master-New 10.10.10.216. But on the Hosts screen showing unavailable.
                  Click image for larger version

Name:	image.png
Views:	57
Size:	48.8 KB
ID:	506591
                  Last edited by gregorywest; 26-08-2025, 14:49.

                  Comment

                  • kz3
                    Junior Member
                    • Jul 2025
                    • 20

                    #10
                    In windows the conf appears like zabbix_agentd.conf
                    so its good

                    yesterday you said " Everything is behind a fairly massive firewall facing the internet. Server ports open are 22, 80, 10000"

                    maybe it was a typo but the only idea i have at this moment is that really the port 10000 was open instead of 10050
                    because on the same range of ips you have connection to hosts via snmp

                    i just checked an windows server but except the snmp everithing related to te agents are the same

                    What i checked was this

                    1º a network rule
                    Click image for larger version

Name:	image.png
Views:	58
Size:	59.4 KB
ID:	506596

                    2º The agent conf - its even working just whit the server ip so my bad
                    Click image for larger version

Name:	image.png
Views:	61
Size:	83.6 KB
ID:	506597


                    3º Agent is running
                    Click image for larger version

Name:	image.png
Views:	59
Size:	87.0 KB
ID:	506598


                    4º trying a zabbix get from the zabbix server

                    zabbix_get -s 192.168.184.126 -p 10050 -k "agent.ping"

                    Click image for larger version

Name:	image.png
Views:	58
Size:	4.0 KB
ID:	506599​​
                    ​​

                    This is just working . maybe take a look in what i quoted before about the firewall and the port open 10000 instead of 10050
                    The 99,99% of problems ive had whit connections at the end most of them were closed ports and firewalls

                    i hope it helps till tomorrow
                    Attached Files

                    Comment

                    • gregorywest
                      Junior Member
                      • Jan 2025
                      • 11

                      #11
                      zabbix_get -s 192.168.184.126 -p 10050 -k "agent.ping" returned a 1
                      10000 is WEBMIN (Web browser server admin program. It is expected. The firewall is between the 10.10.8.1/22 network and the internet propper. There should be nothing between the devices on the 10.10...... backbone.

                      Very odd (or not) I have three Android tablets/phones using the "Unofficial Zabbix Agent" and they are showing up (yellow ZBX icons.
                      Click image for larger version  Name:	image.png Views:	0 Size:	66.3 KB ID:	506604
                      Looking more and more like a WS issue, not a server issue.
                      Now this is interesting. From the Linux WS nmap - 10051 shows up. Might be a different issue on the linux WS. Will look into that now.
                      pi@PiTorrent:~ $ nmap -Pn -vvv -p 10051 10.10.10.71
                      Starting Nmap 7.70 ( https://nmap.org ) at 2025-08-26 09:24 CDT
                      Initiating Parallel DNS resolution of 1 host. at 09:24
                      Completed Parallel DNS resolution of 1 host. at 09:24, 0.03s elapsed
                      DNS resolution of 1 IPs took 0.03s. Mode: Async [#: 4, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
                      Initiating Connect Scan at 09:24
                      Scanning 10.10.10.71 [1 port]
                      Discovered open port 10051/tcp on 10.10.10.71
                      Completed Connect Scan at 09:24, 0.01s elapsed (1 total ports)
                      Nmap scan report for 10.10.10.71
                      Host is up, received user-set (0.0056s latency).
                      Scanned at 2025-08-26 09:24:48 CDT for 1s

                      PORT STATE SERVICE REASON
                      10051/tcp open zabbix-trapper syn-ack

                      Read data files from: /usr/bin/../share/nmap
                      Nmap done: 1 IP address (1 host up) scanned in 0.17 seconds
                      pi@PiTorrent:~ $
                      Last edited by gregorywest; 26-08-2025, 16:26.

                      Comment

                      • gregorywest
                        Junior Member
                        • Jan 2025
                        • 11

                        #12
                        I checked the windows firewall settings. As expected the firewall appears to be off.
                        Click image for larger version

Name:	image.png
Views:	47
Size:	30.1 KB
ID:	506815
                        On odd thing, I am getting data from my PI's but the ZBX indicator is off:
                        Click image for larger version

Name:	image.png
Views:	42
Size:	22.0 KB
ID:	506816
                        Is this normal?
                        Greg

                        So Linux sort of working, windows not working...... god I hate windows!

                        Comment

                        • gregorywest
                          Junior Member
                          • Jan 2025
                          • 11

                          #13
                          OK got everything connected and talking. Switched all the problem workstations from "Agent Active" to "Agent". What is the difference between Active and 'regular'
                          Greg

                          Comment

                          • troffasky
                            Senior Member
                            • Jul 2008
                            • 567

                            #14
                            Active = agent connects in to server and delivers metrics. Hostnames must be unique. The items also are of their own type.
                            Passive = server connects to agent and polls metrics. Hostnames are not important.

                            Comment

                            Working...