Ad Widget

Collapse

Proxmox agent config

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andersostling56
    Junior Member
    • Sep 2023
    • 7

    #1

    Proxmox agent config

    Is there a guide on how to configure the agent on Proxmox? I found one guide, but it was very confusing on accounts and API keys setup. I spent an hour trying different ways but no luck. I can see the host but get an error message "Proxmox: API service not available". PVE is 8. and Zabbix agent 6.2
  • vijayk
    Senior Member
    • May 2023
    • 305

    #2
    Did you checked with this KB?

    Comment

    • andersostling56
      Junior Member
      • Sep 2023
      • 7

      #3
      Originally posted by vijayk
      I did, but I cant figure out how to do this. In the Permissions dialog for the user, there are no Add or Create. Just a list that looks like this

      For the created API token and user, provide the necessary access levels:
      • Check: ["perm","/",["Sys.Audit"]]
      • Check: ["perm","/nodes/{node}",["Sys.Audit"]]
      • Check: ["perm","/vms/{vmid}",["VM.Audit"]]
      ​In the Permissions dialog for the user, there are no Add or Create. Just a list that looks like this

      Click image for larger version  Name:	image.png Views:	0 Size:	23.9 KB ID:	471262
      So I still get this when checking Latest data under Monitoring

      Click image for larger version  Name:	image.png Views:	2 Size:	36.0 KB ID:	471265
      and this

      Click image for larger version

Name:	image.png
Views:	4099
Size:	46.6 KB
ID:	471266
      Last edited by andersostling56; 28-09-2023, 11:00.

      Comment

      • vijayk
        Senior Member
        • May 2023
        • 305

        #4
        Please refer the link.
        Zabbix template for Proxmox. Contribute to mverboom/zabbix-pve-api development by creating an account on GitHub.

        Comment


        • andersostling56
          andersostling56 commented
          Editing a comment
          I added a few screenshots. Maybe they can help :/
      • vijayk
        Senior Member
        • May 2023
        • 305

        #5
        Trigger showing API service available. It may be permission issue. Please check with above given link.

        Comment

        • andersostling56
          Junior Member
          • Sep 2023
          • 7

          #6
          Originally posted by vijayk
          Trigger showing API service available. It may be permission issue. Please check with above given link.
          It probably is. Maybe caused by the lack of these settings.

          Create an API token for the monitoring user. Important note: for security reasons, it is recommended to create a separate user (Datacenter - Permissions).

          For the created API token and user, provide the necessary access levels:
          • Check: ["perm","/",["Sys.Audit"]]
          • Check: ["perm","/nodes/{node}",["Sys.Audit"]]
          • Check: ["perm","/vms/{vmid}",["VM.Audit"]]
          I cannot figure out how to configure the zabbix user account in PVE with these permissions.
          Cant see any option to add permissions for the account

          Click image for larger version

Name:	image.png
Views:	4053
Size:	42.1 KB
ID:	471281

          Comment

          • vijayk
            Senior Member
            • May 2023
            • 305

            #7
            Originally posted by andersostling56

            It probably is. Maybe caused by the lack of these settings.

            Create an API token for the monitoring user. Important note: for security reasons, it is recommended to create a separate user (Datacenter - Permissions).

            For the created API token and user, provide the necessary access levels:
            • Check: ["perm","/",["Sys.Audit"]]
            • Check: ["perm","/nodes/{node}",["Sys.Audit"]]
            • Check: ["perm","/vms/{vmid}",["VM.Audit"]]
            I cannot figure out how to configure the zabbix user account in PVE with these permissions.
            Cant see any option to add permissions for the account

            Click image for larger version

Name:	image.png
Views:	4053
Size:	42.1 KB
ID:	471281
            This video will help you.

            Comment

            • andersostling56
              Junior Member
              • Sep 2023
              • 7

              #8
              Originally posted by vijayk

              This video will help you.
              https://youtu.be/DLh_j1CAj44
              Now I was able to add the required permissions to the zabbix account on PVE. One step closer I guess, but still the same issue. I did restart the zabbix-agent service on PVE and rebooted the Zabbix server. I still get this

              Click image for larger version

Name:	image.png
Views:	4048
Size:	58.9 KB
ID:	471289

              Comment

              • vijayk
                Senior Member
                • May 2023
                • 305

                #9
                Have you configured the Macro in host?

                Comment

                • andersostling56
                  Junior Member
                  • Sep 2023
                  • 7

                  #10
                  Yes I have. Two macros for the token name and secret key.

                  Comment

                  • vijayk
                    Senior Member
                    • May 2023
                    • 305

                    #11
                    Originally posted by andersostling56
                    Yes I have. Two macros for the token name and secret key.
                    And URL port (8006 by default) is respond from server?

                    Comment


                    • andersostling56
                      andersostling56 commented
                      Editing a comment
                      Yes, port 8006 is in state LISTEN on the PVE host. No macro defined though.
                  • andersostling56
                    Junior Member
                    • Sep 2023
                    • 7

                    #12
                    Let me recapitulate my steps so far

                    On PVE host:
                    1. zabbix@pam user created
                    2. API token for the user created
                    3. Permissions as described in the guide assigned to the user
                    On the Zabbix server:
                    1. Macros defined (PVE.TOKEN.ID and PVE.TOKEN.SECRET) with the values from PVE
                    2. PVE host created with Proxmox VE by HTTP template assigned (IP address defined)
                    3. Added to host groups Linux and Hypervisors
                    4. Monitoring/Hosts shows 2 hosts, the zabbix server itself and the PVE host
                    5. Selecting Latest data show this
                    Click image for larger version

Name:	image.png
Views:	4132
Size:	68.5 KB
ID:	471333
                    So here we are. I cannot think of anything that I may have missed. PVE version is 8.06 and Zabbix 6.2 (agent and server appliance)
                    Agent logfile on PVE does not indicate any errors.
                    Server logfile on the Zabbix server has this error message. Unfortunately is doesnt tell which hostname is missing/failing. It would have been quite useful ...

                    2352:20230928:135920.322 Proxmox API failed: *UNKNOWN* Error: Error: cannot get URL: Couldn't resolve host name

                    Comment

                    • vijayk
                      Senior Member
                      • May 2023
                      • 305

                      #13
                      Looks like, need a deep dive in logs. Can you please enable debug level in agent if available and gather the logs?

                      Comment


                      • andersostling56
                        andersostling56 commented
                        Editing a comment
                        I'm not sure what I did, except adding a macro PVE.HOST.NAME, but it seems to be working now. I see a lot of stuff in "Latest data" now, but most of the data is empty. So some progress at least ...
                    • andersostling56
                      Junior Member
                      • Sep 2023
                      • 7

                      #14
                      This looks better. Next is to actually have data pulled from the agent


                      Click image for larger version

Name:	image.png
Views:	4011
Size:	129.0 KB
ID:	471342

                      Comment

                      • vijayk
                        Senior Member
                        • May 2023
                        • 305

                        #15
                        Great. You will receive the data soon.

                        Comment

                        Working...