Ad Widget

Collapse

Zabbix on device running on DHCP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AntonyWij
    Junior Member
    • Dec 2023
    • 4

    #1

    Zabbix on device running on DHCP

    Hi all,
    Has anyone setup Zabbix on a Win 10 PC running on DHCP? I tried the Agent Active/Passive method with changing the config file, but had no luck connecting the server to the agents. Anyone knows a workaround for this?
  • solution
    Senior Member
    • Jun 2020
    • 269

    #2
    Zabbix Agent in Active Mode does NOT require devices with Static IP.
    If you are using monitoring in Passive mode, you will have to make a reservation in DHCP so that the Host always receives the same IP, or configure the Hostname/dnsname of the Host in Agent Interface and select DNS.
    **The Zabbix server must be able to communicate with the Host by name.

    Wellington​

    Comment

    • AntonyWij
      Junior Member
      • Dec 2023
      • 4

      #3
      Originally posted by solution
      Zabbix Agent in Active Mode does NOT require devices with Static IP.
      If you are using monitoring in Passive mode, you will have to make a reservation in DHCP so that the Host always receives the same IP, or configure the Hostname/dnsname of the Host in Agent Interface and select DNS.
      **The Zabbix server must be able to communicate with the Host by name.

      Wellington​
      Hi Solution, Thank you for the reply.
      I have already tried what you described. May be my configuration was off? refer to the screenshots I have attached. AL5QNSTT3 is the test host (win 10) I am using. I already tried this with the FQDN but no luck.​
      Attached Files

      Comment

      • solution
        Senior Member
        • Jun 2020
        • 269

        #4
        Hi Antony,
        The items you showed are for Active Mode.
        1) In Active mode, the Agent installed on the Hosts consults the Zabbix Server and receives the list of what to monitor on the host.
        2) IP or FQDN defined in Interfaces are NOT used.

        Then do the following:
        In Latest Data is displaying received data?
        If the answer is No, then:
        - Confirm that in the Zabbix Agent conf the "ActiveServer" line has the Zabbix Server ip/hostname
        Code:
        #ServerActive=
        
        ServerActive=192.168.0.11
        - Consult the Zabbix Agent log on the device

        And remember: in active mode, Agents consult the server, so in the Zabbix Server Firewall you need to open/allow port 10051


        Wellington​

        Comment

        • LenR
          Senior Member
          • Sep 2009
          • 1005

          #5
          Is your DNS update from DHCP working? On the zabbix server, can you resolve your host DNS name as it is configured? Is it the current IP for the host?

          Comment


          • AntonyWij
            AntonyWij commented
            Editing a comment
            Hi LenR, thank you for the reply
            DNS is resolving to the Zabbix server from my test PC. Unfortunately, I don’t have access to the Zabbix Linux box to test if the Zabbix server can resolve to my Test PC. I do have the rules (attached below) setup in the firewall opening the ports for Zabbix. I have already asked the Cyber guys to test this for me. Will update ones I get their feedback.
        • AntonyWij
          Junior Member
          • Dec 2023
          • 4

          #6
          Originally posted by solution
          Hi Antony,
          The items you showed are for Active Mode.
          1) In Active mode, the Agent installed on the Hosts consults the Zabbix Server and receives the list of what to monitor on the host.
          2) IP or FQDN defined in Interfaces are NOT used.

          Then do the following:
          In Latest Data is displaying received data?
          If the answer is No, then:
          - Confirm that in the Zabbix Agent conf the "ActiveServer" line has the Zabbix Server ip/hostname
          Code:
          #ServerActive=
          
          ServerActive=192.168.0.11
          - Consult the Zabbix Agent log on the device

          And remember: in active mode, Agents consult the server, so in the Zabbix Server Firewall you need to open/allow port 10051


          Wellington​
          Thank you for your reply, Solution.
          Please refer to the screenshots I have attached. I have already configured the Zabbix Agent config file to point the “ServerActive=Zabbix server” and “Hostname=AL5QNSTT3”. I tried changing the host name to FQDN as will with no luck. The ports 10051and 10050 is open from my local to Zabbizx server. Unfortunately, I don’t have access to the Zabbix Linux box to see if it can resolve to my test pec. I have already asked the cyber guys to verify that and waiting for their feedback. I do have the following firewall (attached) rule set in the firewall for Zabbix.

          Attached Files

          Comment

          • solution
            Senior Member
            • Jun 2020
            • 269

            #7
            I think after so many tests everything seems confusing.
            In the images above there is no Host Latest Data screen, so start over.

            How is data collection going now?
            Hosts --> AL5QNSTT3 --> Latest Data

            Ping from Zabbix Server to Host without CLI access?
            Zabbix Gui Interface --> Hosts --> Zabbix Server
            Create an item with the key:
            Example for IP: system.run["ping -c 3 192.168.0.1"]
            Example for Hostname: system.run["ping -c 3 AL5QNSTT3"]
            type:text
            Check Latest Data for this item

            Now let's go to the Host:
            Testing in passive mode (Zabbix Server contacts the Host to collect data)
            **Delete the Host and recreate it if necessary.
            Zabbix Gui --> Hosts

            - Name: AL5QNSTT3
            - Template: Windows by Zabbix agent
            - Agent Interface: enter the IP Address and/or DNS Name
            - Connect to: IP
            ***for test 2 try: Connect to: DNS
            - ADD or Update
            - Check Latest Data for this Host.

            Note: On the Windows 10 Host, confirm that:
            - Zabbix service is running
            - Firewall: Open port 10050
            - Zabbix service is listening on port 10050: cmd --> netstat -abn
            - Restart service if necessary

            Test in Active Mode (Zabbix Agent contacts the Zabbix Server and receives the list of items to monitor and sends the collected data)

            Zabbix Gui --> Hosts

            - Name: AL5QNSTT3
            - Template: Windows by Zabbix agent active
            ** Unlike and Clear Windows by Zabbix agent if associated with the host
            - Agent Interface: Mandatory but NOT used in Active Mode
            - ADD or Update
            - Check Latest Data for this Host.

            Compare the tests.
            If necessary, check the Zabbix Agent log in AL5QNSTT3/Windows 10

            Wellington​

            Comment

            • AntonyWij
              Junior Member
              • Dec 2023
              • 4

              #8
              Originally posted by solution
              I think after so many tests everything seems confusing.
              In the images above there is no Host Latest Data screen, so start over.

              How is data collection going now?
              Hosts --> AL5QNSTT3 --> Latest Data

              Ping from Zabbix Server to Host without CLI access?
              Zabbix Gui Interface --> Hosts --> Zabbix Server
              Create an item with the key:
              Example for IP: system.run["ping -c 3 192.168.0.1"]
              Example for Hostname: system.run["ping -c 3 AL5QNSTT3"]
              type:text
              Check Latest Data for this item

              Now let's go to the Host:
              Testing in passive mode (Zabbix Server contacts the Host to collect data)
              **Delete the Host and recreate it if necessary.
              Zabbix Gui --> Hosts

              - Name: AL5QNSTT3
              - Template: Windows by Zabbix agent
              - Agent Interface: enter the IP Address and/or DNS Name
              - Connect to: IP
              ***for test 2 try: Connect to: DNS
              - ADD or Update
              - Check Latest Data for this Host.

              Note: On the Windows 10 Host, confirm that:
              - Zabbix service is running
              - Firewall: Open port 10050
              - Zabbix service is listening on port 10050: cmd --> netstat -abn
              - Restart service if necessary

              Test in Active Mode (Zabbix Agent contacts the Zabbix Server and receives the list of items to monitor and sends the collected data)

              Zabbix Gui --> Hosts

              - Name: AL5QNSTT3
              - Template: Windows by Zabbix agent active
              ** Unlike and Clear Windows by Zabbix agent if associated with the host
              - Agent Interface: Mandatory but NOT used in Active Mode
              - ADD or Update
              - Check Latest Data for this Host.

              Compare the tests.
              If necessary, check the Zabbix Agent log in AL5QNSTT3/Windows 10

              Wellington​

              Hi Solution, Like you mentioned I have started over (deleted all previous entries from Zabbix)

              Added host
              Zabbix Gui > configuration > host
              Hostname: AL5QNSTT3
              Template: wouldn’t let me add the name Windows by Zabbix agent so left blank
              Interface: DNS (AL5QNSTT3:10050)


              Before adding any items, I went in to Monitoring > Hosts > AL5QNSTT3 > right click > ping

              --- AL5QNSTT3.xxxx.xxxxxx.net ping statistics ---

              3 packets transmitted, 3 received, 0% packet loss, time 2003ms
              rtt min/avg/max/mdev = 17.859/19.458/21.404/1.467 ms

              Then went in to Zabbix Gui > configuration > host > AL5QNSTT3 > Add item
              Name: Ping (passive)

              Type: Zabbix agent
              Key: system.run["ping -c AL5QNSTT3"]
              Type of information: Text
              Host interface: AL5QNSTT3:10050
              Update interval: 1m > Save

              Zabbix availability is still Red with the error
              Get value from agent failed: ZBX_TCP_READ() failed: [104] Connection reset by peer
              There’s no log file under C:\Program Files\Zabbix Agent\zabbix_agentd.d


              At the same time I restart the Zabbix Agent service and ran a netstat netstat -abn. Oddly enough it is listening to port 49664 (screen shot attached)
              Attached Files

              Comment

              • solution
                Senior Member
                • Jun 2020
                • 269

                #9
                1) From your test on the interface, ping by dnsname is working.
                And since you didn't send the Host's "Latest Data" screen, if you check the created item it is also receiving data, correct?

                2) do the test in Active Mode by associating the template "Windows by Zabbix agent Active" or "Zabbix Agent Active" and check the Host data collection in Latest data.

                3) We can see in your prints that the Agent is listening on port 10050

                4) the "Zabbix availability is still Red with the error" the message "indicates that it is not possible to communicate with the Agent on port 10050.
                - Disable the Host Firewall temporarily;
                - Change Interface Agent from DNS to IP and define the Host IP;
                - Associate the "Zabbix Agent" Template with the Host;
                - Does Zabbix server have a firewall with outbound traffic rules? allow outgoing traffic to hosts and port 10050/TCP

                Observations:
                - Zabbix availability only turns green if you use Passive Mode (unknown appears in active mode)
                -Templates mentioned:​
                Click image for larger version

Name:	image.png
Views:	2007
Size:	24.8 KB
ID:	475569



                Wellington

                Comment

                Working...