-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Prometheus SNMP setup cannot be ported #50519
Comments
It appears that one needs snmpd to be installed for example, which is not even available on NixOS. |
Can you expand on what's not working, or what the desired setup is? I've been using the the snmp exporter for a while. The scrape_configs example in the snmp_exporter project can be fairly directly ported to
The exporter itself requires almost no configuration:
The exporter returns the results of scraping a remote host
And prometheus is including those metrics
|
@thefloweringash In your example, you set Now, I do believe that it might work if one actually has an SNMP implementation, but I wanted to use Prometheus to keep track of bandwidth throughput/second over time (to compute max, average, etc.). So, there are two issues. One of the is the small deviation from upstream in the module configuration. The other is how to get an SNMP implementation on my NixOS system (or otherwise some method to accomplish the goal described earlier (I don't care about SNMP)). |
I see it configured exactly the same in the upstream landing page, your copy-pasted example, and my example config. I think for tracking network devices on a linux, you want the node exporter's "netdev" collector and a prometheus query like |
@thefloweringash Note the last element of the relabel_configs and observe that the source_label is not defined there. |
@thefloweringash Thanks for the query. |
Indeed, apologies for being slow on the uptake there. |
cc @WilliButz |
I discussed that during the weekend with @WilliButz. We believe requiring assigning an empty list ( It is counter-intuitive but semantically seems to be the same. The re-exported Prometheus configuration doesn't list the attribute if it is set like this. |
@andir with that in mind, to avoid having the users explicitly set --- a/nixos/modules/services/monitoring/prometheus/default.nix
+++ b/nixos/modules/services/monitoring/prometheus/default.nix
@@ -318,6 +318,7 @@ let
options = {
source_labels = mkOption {
type = types.listOf types.str;
+ default = [];
description = ''
The source labels select values from existing labels. Their content
is concatenated using the configured separator and matched against Not sure if we wan't to do this though. |
Shouldn't we instead make it a `nullOr (listOf str)` and default to `null`
while checking for `null` further down the file?
…On Tue, 20 Nov 2018, 17:12 WilliButz ***@***.*** wrote:
@andir <https://github.com/andir> with that in mind, to avoid having the
users explicitly set source_labels = []; for their relabel_configs we
could add it as the default in the prometheus module:
--- a/nixos/modules/services/monitoring/prometheus/default.nix+++ b/nixos/modules/services/monitoring/prometheus/default.nix@@ -318,6 +318,7 @@ let
options = {
source_labels = mkOption {
type = types.listOf types.str;+ default = [];
description = ''
The source labels select values from existing labels. Their content
is concatenated using the configured separator and matched against
Not sure if we wan't to do this though.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#50519 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAm_dKSkqJnFcaBWmueBsFSNV00-44wVks5uxCoAgaJpZM4YnnPO>
.
|
Issue description
Either the example of the snmp-exporter people (https://github.com/prometheus/snmp_exporter) is wrong, or it cannot be expressed with the current module (which requires the source_labels attribute to be set).
The text was updated successfully, but these errors were encountered: