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

nixos/prometheus-snmp-exporter: fix command line argument format #47990

Merged
merged 1 commit into from Oct 7, 2018

Conversation

thefloweringash
Copy link
Member

@thefloweringash thefloweringash commented Oct 7, 2018

Motivation for this change

No longer works after upgrading to NixOS 18.09, so should be backported.

snmp_exporter[847]: snmp_exporter: error: unknown short flag '-c', try --help
systemd[1]: prometheus-snmp-exporter.service: Main process exited, code=exited, status=1/FAILURE

The argument format changed:

$ nix run -f channel:nixos-18.03 prometheus-snmp-exporter -c snmp_exporter --help
Usage of snmp_exporter:
  -config.file string
    	Path to configuration file. (default "snmp.yml")
  -log.format value
    	Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true" (default "logger:stderr")
  -log.level value
    	Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal] (default "info")
  -version
    	Print version information.
  -web.listen-address string
    	Address to listen on for web interface and telemetry. (default ":9116")
$ nix run -f channel:nixos-18.09 prometheus-snmp-exporter -c snmp_exporter --help
usage: snmp_exporter [<flags>]

Flags:
  -h, --help                    Show context-sensitive help (also try --help-long and --help-man).
      --config.file="snmp.yml"  Path to configuration file.
      --web.listen-address=":9116"
                                Address to listen on for web interface and telemetry.
      --log.level="info"        Only log messages with the given severity or above. Valid levels: [debug, info, warn,
                                error, fatal]
      --log.format="logger:stderr"
                                Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or
                                "logger:stdout?json=true"
      --version                 Show application version.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Oct 7, 2018

cc @WilliButz

@WilliButz
Copy link
Member

Oh yes, I noticed this recently but was kind of busy. I already have a prometheus exporter test for almost all exporters on my stash which should prevent such problems in the future. I really need to clean it up and submit it upstream.

LGTM 👍

@Mic92 Mic92 merged commit 68bd7c3 into NixOS:master Oct 7, 2018
@Mic92
Copy link
Member

Mic92 commented Oct 7, 2018

backport 2b3b607

@thefloweringash thefloweringash deleted the prometheus-snmp-exporter-args branch November 4, 2018 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants