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

Multiple Servers #3

Closed
sshaikh opened this issue Dec 26, 2020 · 2 comments
Closed

Multiple Servers #3

sshaikh opened this issue Dec 26, 2020 · 2 comments

Comments

@sshaikh
Copy link

sshaikh commented Dec 26, 2020

Thank you for this software, works a treat. I especially like how it doesn't assume to be on the same server as NUT.

To that end it seems useful to be able to leverage multiple servers, so that you only need a single bridge if you have multiple UPS's with local NUT servers.

For this to work you'd probably need a further query parameter, or perhaps use the instance@server format that upsc uses.

@DRuggeri
Copy link
Owner

I really like this idea. I've added it in b92a59b as well as released v1.2.0 incorporating it.

@sshaikh
Copy link
Author

sshaikh commented Dec 28, 2020

Amazing work, thank you for the quick turnaround!

I'm using the following scrape config to scrape multiple servers in a single job using the new functionality:

  - job_name: ups
    static_configs:
      - targets: ['server1','server2'] # nut exporter
    metrics_path: /ups_metrics
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_server
      - source_labels: [__param_server]
        target_label: instance
      - target_label: __address__
        replacement: nut-exporter.local:9199

This will generate two targets of:

http://nut-exporter.local:9199/ups_metrics?server=server1
http://nut-exporter.local:9199/ups_metrics?server=server2

and set the instance label of each metric to serverx as appropriate.

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

2 participants