Ad Widget

Collapse

Proxmox VE by HTTP - Some Items do not populate from my Proxmox Cluster

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • greavette
    Member
    • Jul 2015
    • 82

    #1

    Proxmox VE by HTTP - Some Items do not populate from my Proxmox Cluster

    Hello,

    I have Zabbix 6.0 LTS installed and for one of my Proxmox Nodes I've added as a host to my Zabbix with two Templates:

    Linux by Zabbix agent​
    Template Proxmox VE by HTTP
    https://git.zabbix.com/projects/ZBX/...Frelease%2F6.0

    I searched and found this post, but their solution was to recreate the API Token which I did and my cluster is not showing in the latest data captured by my Zabbix.




    I've read through the instructions and also had a friend who also has a Proxmox cluster try this template as well. Both of us do not have cluster data or VM data from our clusters captured in Zabbix.

    Click image for larger version

Name:	image.png
Views:	2959
Size:	88.3 KB
ID:	451694

    Many of the items being monitored using this Promox Template have errors in Latest Data:

    Proxmox: Node []: Status - Response code "403" did not match any of the required status codes "200"

    I see this error on many items being monitored.

    Can anyone provide me with some ideas on what I'm doing wrong in using this template to monitor my Proxmox cluster?

    Any advice you can give would be greatly apprecaited.

    Thank you,

  • greavette
    Member
    • Jul 2015
    • 82

    #2
    More information regarding my issue:

    I'm looking at the Item - Proxmox: Get cluster resources.

    looking at the configuration for this item I've run a Tes and I can see data coming back from the Result of my cluster. It's accurate in that it shows which hosts are online or offline.

    Click image for larger version

Name:	image.png
Views:	2511
Size:	79.1 KB
ID:	451751

    Any idea why running the test on this item is working, but the Display Data for this item shows nothing and the History shows nothing as well?

    Thank you,​

    Comment

    • greavette
      Member
      • Jul 2015
      • 82

      #3
      Hello,

      Can anyone provide a reason or lead for me to follow on why my Zabbix Latest Data does not show the item details I need to see from this template? My test does show that the details are there but for some reason the latest data is showing blank and no history or graph details. Is this template specific to the version of Proxmox?

      Any advice or direction you may have would be greatly appreciated.

      Thank you.

      Comment

      • greavette
        Member
        • Jul 2015
        • 82

        #4
        Hello Forum,

        Is my post in the right forum group? I'm having a template issue and the github page for this template " Proxmox VE by HTTP" said to use the forums. Is this forum group the right place?

        Thank you.


        Comment

        • greavette
          Member
          • Jul 2015
          • 82

          #5
          Can anyone provide direction on why this template is not working with my Proxmox Cluster?

          Thank you.​

          Comment

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

            #6
            I am not familiar with proxmox or the tempalte here.. but you say you have "Response code "403"" there... which is "forbidden" ... So... check the credentials...

            Comment

            • greavette
              Member
              • Jul 2015
              • 82

              #7
              Originally posted by cyber
              I am not familiar with proxmox or the tempalte here.. but you say you have "Response code "403"" there... which is "forbidden" ... So... check the credentials...
              Hello cyber, I apologize for not responding sooner. Thanks for responding to my post!

              I don't think it's a permission issue although it could be a problem with how the template can connect to the Proxmox API that is giving the 403 error.

              I have done a lot more digging. This template is inherent within Zabbix 6 so I'm hoping the person/people who created the template at Zabbix can step in and provide some direction for me. I would very much like to get this template fully working!

              I found this post that outlines - https://i12bretro.github.io/tutorials/0572.html. Where it provides very good detail how to create the REST API in Proxmox and how to test connect to Proxmox through Postman. I've done this and found that some of the commands work like version and nodes but status didn't work for m from postman. Could the problem be that this template was created/tested for Proxmox version 6 and I'm using Proxmox version 7?

              I've looked at the github page for this template and it says for any issues to open a forum post.

              Thank you.
              Last edited by greavette; 23-10-2022, 17:07.

              Comment

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

                #8
                Originally posted by greavette
                Can anyone provide a reason or lead for me to follow on why my Zabbix Latest Data does not show the item details I need to see from this template? My test does show that the details are there but for some reason the latest data is showing blank and no history or graph details. Is this template specific to the version of Proxmox?
                That's because the "Proxmox: Get cluster resources" item does not save the data at all: it is only used for populating the other (dependent) items in the template. See the other items and discovery rules in the template to find out which are dependent of that item.

                Markku

                Comment

                • greavette
                  Member
                  • Jul 2015
                  • 82

                  #9
                  I may have further found my problem. Thank you Markku fo your comments. It seems I needed to add more permissions to my Proxmox API.
                  Last edited by greavette; 26-10-2022, 22:53.

                  Comment

                  • wyang
                    Member
                    • Mar 2016
                    • 93

                    #10
                    @greavette​ would you mind to share detailed steps to configure a host for Proxmox cluster monitoring?

                    I created a user and an API token with Privilege Separation unchecked on a Proxmox cluster. API call from Zabbix 6 LTS server to the cluster works well.

                    For monitoring the Proxmox cluster, I created a host linked to the template 'Proxmox VE by HTTP' with
                    • Host name: FQDN of a node in the Proxmox cluster
                    • Host macros for {$PVE.TOKEN.ID} and {$PVE.TOKEN.SECRET}
                    • No interface is configured
                    However, the item 'Proxmox: API service status' stays as 'Unknown Error (520)' and thus the alert 'Proxmox: API service not available' is triggered.

                    I was wondering which piece is missing in my config, if Zabbix agent is a must for the template to work.

                    Any advice would be much appreciated!!!​

                    Comment


                    • w3data
                      w3data commented
                      Editing a comment
                      Try this command on zabbix server.
                      setsebool -P zabbix_can_network 1

                    • muhammadsaeed
                      muhammadsaeed commented
                      Editing a comment
                      I was able to resolve the issue by following (for Proxmox VE by HTTP template):



                      1. make sure you have PVE user created (not pam)

                      2. On zabbix server of zabbix proxy try putting selinux to permissive or run following:

                      setsebool -P zabbix_can_network 1


                      3. Proxmox > Datacenter > Permission: assign " PVE auditor" role to both User (user@pve) and API Token Permission (user@pve!TokenName)

                      /
                      /nodes/<PVE hostname>
                      /vms
                      /storage


                      4. Make sure zabbix server/proxy trusts your proxmox host certificate


                      5. use following command for troubleshooting on zabbix server/proxy:

                      curl -d "username=user@pve&password=<your secret>" https://<URL>:8006/api2/json/access/token -v

                      curl -d "username=user@pve&password=<your secret>" https://<URL>:8006/api2/json/access/cluster/status -v

                    • gehkah
                      gehkah commented
                      Editing a comment
                      thank you muhammadsaeed - with the hint of double permissions, it is finally working now. This should be officially documented - due to I was not able to find it anywhere - except here. Awesome, Sir
                  • bryanvold
                    Junior Member
                    • Jul 2023
                    • 1

                    #11
                    I was getting the same exact error as you (Proxmox: API service not available). When I was trying to debug, I used Insomnia (a postman-like tool for direct REST testing). I discovered that the $PVE.TOKEN.ID is not the ID by itself, but actually needs to be the "user@realm!pve_token=pve_secret" Once I used this in Insomnia for the "Authorization: ..." header, it was able to get the status correctly. I still can't get it to populate the VMs etc, but this was a breakthrough for me.

                    Comment


                    • simpo
                      simpo commented
                      Editing a comment
                      Hi can you give more details about how you fix the situation?

                      Thanks
                  • muhammadsaeed
                    Junior Member
                    • Oct 2024
                    • 1

                    #12

                    I was able to resolve the issue by following (for Proxmox VE by HTTP template):



                    1. make sure you have PVE user created (not pam)

                    2. On zabbix server of zabbix proxy try putting selinux to permissive or run following:

                    setsebool -P zabbix_can_network 1


                    3. Proxmox > Datacenter > Permission: assign " PVE auditor" role to both User (user@pve) and API Token Permission (user@pve!TokenName)

                    /
                    /nodes/<PVE hostname>
                    /vms
                    /storage


                    4. Make sure zabbix server/proxy trusts your proxmox host certificate


                    5. use following command for troubleshooting on zabbix server/proxy:

                    curl -d "username=user@pve&password=<your secret>" https://<URL>:8006/api2/json/access/token -v

                    curl -d "username=user@pve&password=<your secret>" https://<URL>:8006/api2/json/access/cluster/status -v

                    Comment

                    Working...