Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use token credentials for two separte PVE nodes #236

Open
braham2019 opened this issue Mar 22, 2024 · 2 comments
Open

how to use token credentials for two separte PVE nodes #236

braham2019 opened this issue Mar 22, 2024 · 2 comments

Comments

@braham2019
Copy link

I have added a second Proxmox node to my setup. The first one is working fine using token authentication:

default:
    user: monitoring@pam
    token_name: "somename"
    token_value: "somevalue"
    verify_ssl: false

But the second one (they are not part of a cluster) has a different token secret (albeit the token_name and token_value are the same).

As expected it gives an error when trying this.

proxmoxer.core.ResourceException: 401 Unauthorized: invalid token value! - {'errors': b''}

How can I pass those separate credentials to that particular node ? Is there a way to create an entry for that in pve.yml ?

@danpoltawski
Copy link

I was looking for the same thing, looks like you can do this with the module request param:

Specify the module request parameter, to choose which module to use from the config file.

@xzivzs
Copy link

xzivzs commented Dec 20, 2024

Hey guys, can you help me with that situation ? I've been monitoring my "main" Proxmox server for a long time now and I recently add another Proxmox server but it needs to be separate from my main for specific reason. Anyways, I would like to monitor this one as well but can't make it work . Do I need to create another "module" inside "pve.yml" ?

default:
  user: monitor@pam
  token_name: "somename"
  token_value: "somevalue"
  verify_ssl: false

default2:
  user: monitor@pam
  token_name: "somename"
  token_value: "somevalue"

I then specify the module's name inside prometheus.yml config but it doesn't work obviously :

  - job_name: 'somename'
    scrape_interval: 1m
    static_configs:
      - targets:
        - someip # Proxmox VE node 1

    metrics_path: /pve
    params:
      module: [default]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: someip:9221


  - job_name: 'somename'
    scrape_interval: 1m
    static_configs:
      - targets:
        - someip # Proxmox VE 2

    metrics_path: /pve
    params:
      module: [default2]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: someip:9221

How can I do that ?

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants