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
Add netbox services discovery #116
Comments
This would be very useful to us as well. |
We already have service support included. I use it to configure node exporter for example and filter hosts on this. Anything specific you have demand on? |
The only service support I see is the I have created a fork with a /api/plugins/prometheus-sd/services/ endpoint that gives us what we need. Maybe we don't need that if you can explain to me how to use the existing service support. |
Use keep and drop rules to filter relevant targets by service. You can find an example here: #97 (comment) But may be I should add some more examples. Feel free to make am merge request of your solution with an example prometheus config, so we can discuss if it's also an option. I'm open to multiple solutions as long as it works and tests are available. |
So if I understand your example, for it to work you have to make the Virtual Machine name a DNS or IP address because the prometheus config uses that as the I added a |
This config has two jobs. The first using blackbox to check a URL for a 200 OK response. There is no IP defined for the service because its not applicable. I have added a custom field for the Heath Check URL for blackbox to probe. For some web services we can hit the root URL, others have a specific endpoint we need to access. The second job is node-exporter. In this case the Virtual Machine has a primary IP of prometheus.yaml
API output of the http_sd URLs used in the above config:
|
Sounds good to me. More powerful than my current solution. Looking forward to the PR! |
Hi, interested as well and would love to see this services endpoint as well. |
I have created PR #122 for this issue. I have been running this code for the last week in my production Netbox. |
@jeffbaier is possible to add filter for parent devices? Your PR looks good for us, but useless, because we can't filter We filter devices like this /api/plugins/prometheus-sd/devices/?status=active&has_primary_ip=true&cf_prometheus_server=<prometheus server name, that request for targets> With current /api/plugins/prometheus-sd/services/?{parent|device}_status=active&{parent|device}_has_primary_ip=true&{parent|device}_cf_prometheus_server=<prometheus server name, that request for targets> Thanks |
https://demo.netbox.dev/static/docs/core-functionality/services/
I think one of the great use cases could be if netbox services could be discovered as well.
Critical services can be defined in the netbox, to be checked by blackbox exporter later on.
The text was updated successfully, but these errors were encountered: