Ad Widget

Collapse

Proxmox Ve Template with HTTP Agent and Query fileds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galvy
    Junior Member
    • Jun 2020
    • 19

    #1

    Proxmox Ve Template with HTTP Agent and Query fileds

    Hi zabbix users
    I have an issue related to the HTTP Agent and Proxmox VE HTTP. The problem is as follows: even if the query fields are empty, Zabbix still attempts to send the call to the server.
    Click image for larger version  Name:	image.png Views:	3 Size:	4.4 KB ID:	488365
    In the Proxmox template, if I remove the empty query fields, save, and reopen, an empty query field always reappears.
    In the host associated with the template, I duplicated 'Get cluster status.' By doing so, during the test phase, I can remove the query field. However, if I close and reopen the item, Zabbix still adds an empty query field again.
    I don't think the problem is related to the Proxmox template because I have other agents installed, and I've noticed that this behavior of adding an empty query field is systematic across all of them. However, I don't have this issue with the other APIs I monitor because, in the GET request, I simply discard any query fields, whereas the Proxmox APIs return a 400 error.
    Click image for larger version  Name:	image.png Views:	2 Size:	9.7 KB ID:	488366

    The problem started after migrating to zabbix 7
    Last edited by galvy; 26-07-2024, 12:01.
  • gzdaniel
    Junior Member
    • Jul 2024
    • 1

    #2
    I encountered the same problem, and I hope it can be resolved as soon as possible.

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1782

      #3
      Unable to reproduce in Zabbix 7.0.1:

      ::ffff:192.168.7.80 - root@pam!Test [29/07/2024:10:23:01 +0300] "GET /api2/json/cluster/status HTTP/1.1" 200 121

      Using the "Proxmox VE by HTTP" template that installed with 7.0.0.

      Markku

      Comment

      • galvy
        Junior Member
        • Jun 2020
        • 19

        #4
        Originally posted by Markku
        Unable to reproduce in Zabbix 7.0.1:

        ::ffff:192.168.7.80 - root@pam!Test [29/07/2024:10:23:01 +0300] "GET /api2/json/cluster/status HTTP/1.1" 200 121

        Using the "Proxmox VE by HTTP" template that installed with 7.0.0.

        Markku
        My Zabbix server was upgraded from version 6.4. After upgrading to 7.0.1, the problem appeared. I also tried both upgrading and downgrading the Proxmox template, but the issue persists.
        Now, for testing, I will try creating a Docker instance just to see if the issue is related solely to the upgrade. Additionally, I will create an ASP.NET web API to check what the Zabbix server is requesting.

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1782

          #5
          I also tested with a new host+HTTP item "http://127.0.0.1/test" (to connect to the web UI on the Zabbix server), didn't see any empty query parameters there either.

          Markku

          Comment

          • galvy
            Junior Member
            • Jun 2020
            • 19

            #6
            Originally posted by Markku
            I also tested with a new host+HTTP item "http://127.0.0.1/test" (to connect to the web UI on the Zabbix server), didn't see any empty query parameters there either.

            Markku
            Is there a way to "grab" http request from server?

            Comment

            • Markku
              Senior Member
              Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
              • Sep 2018
              • 1782

              #7
              Yes, using tcpdump, when using non-encrypted http.

              If testing on the local Zabbix web UI itself (using localhost = 127.0.0.1), this works:

              sudo tcpdump -A -n -i lo port 80

              GET /test HTTP/1.1
              Host: 127.0.0.1
              Accept: */*
              Accept-Encoding: deflate, gzip, br, zstd

              If using over network to remote host, capturing on the Zabbix server side, this works:

              sudo tcpdump -A -n port 80 and host x.x.x.x
              (where x.x.x.x = the IP address of the destination)

              You can also use "-w filename.pcap" option to save the capture in a file and then inspect it better with Wireshark.

              Markku

              Comment

              • galvy
                Junior Member
                • Jun 2020
                • 19

                #8
                Click image for larger version

Name:	image.png
Views:	151
Size:	77.2 KB
ID:	488527
                From a web api view point
                Click image for larger version

Name:	image.png
Views:	154
Size:	27.9 KB
ID:	488526
                Just to clarify
                If I click "Remove" and test everything works as expected
                Click image for larger version

Name:	image.png
Views:	144
Size:	41.2 KB
ID:	488528
                But when click on "Update" and open it again an a empty query field appers​
                Attached Files

                Comment

                • Markku
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                  • Sep 2018
                  • 1782

                  #9
                  Are you only testing with the Test button or also by letting Zabbix to use the item? Asking because I saw the empty parameter with Test but not in the real item request.

                  Markku

                  Comment

                  • galvy
                    Junior Member
                    • Jun 2020
                    • 19

                    #10
                    Originally posted by Markku
                    Are you only testing with the Test button or also by letting Zabbix to use the item? Asking because I saw the empty parameter with Test but not in the real item request.

                    Markku
                    Zabbix is using the item, before the upgrade to 7.0.1 it was working with out problem
                    Last edited by galvy; 29-07-2024, 13:09.

                    Comment

                    • Markku
                      Senior Member
                      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                      • Sep 2018
                      • 1782

                      #11
                      How about adding a dummy query parameter (foo=bar), saving the item, then opening item again and deleting the parameter, does it then still have an empty query parameter in the request?

                      Markku

                      Comment

                      • galvy
                        Junior Member
                        • Jun 2020
                        • 19

                        #12
                        Originally posted by Markku
                        How about adding a dummy query parameter (foo=bar), saving the item, then opening item again and deleting the parameter, does it then still have an empty query parameter in the request?

                        Markku
                        Did it, yes, same as before
                        Click image for larger version

Name:	image.png
Views:	143
Size:	21.8 KB
ID:	488541

                        Comment

                        • Markku
                          Senior Member
                          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                          • Sep 2018
                          • 1782

                          #13
                          Strange, in my 7.0.1 (btw 7.0.2 was just released) I can create new items without that problem, but in your setup creating new item always includes that empty query parameter.

                          Markku

                          Comment

                          • CharlieRoot
                            Junior Member
                            Zabbix Certified Specialist
                            • Oct 2020
                            • 15

                            #14
                            Originally posted by galvy

                            Did it, yes, same as before
                            Click image for larger version

Name:	image.png
Views:	143
Size:	21.8 KB
ID:	488541
                            I can confirm we see the same behaviour. We do not use Query Fields but we see the ?= in the URL causing a 501 on our templates. I just updated to 7.0.2 this morning to see if that would resolve it, but that is sadly not the case.

                            Code:
                            Response code "501" did not match any of the required status codes "200" HTTP/1.1 301 Moved Permanently Location: https://xxxxxxx/Chassis/1/Power/?=/

                            Comment

                            • Markku
                              Senior Member
                              Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                              • Sep 2018
                              • 1782

                              #15
                              You could open an issue at support.zabbix.com if you don't find a local reason, maybe they'll notice something that causes that in specific circumstances.

                              Markku

                              Comment

                              Working...