ricoberger / script_exporter

Prometheus exporter to execute scripts and collect metrics from the output or the exit status.
MIT License
354 stars 82 forks source link

Define script parameters in config as array #56

Closed Nick-Triller closed 2 years ago

Nick-Triller commented 2 years ago

Motivation: https://github.com/ricoberger/script_exporter/issues/55

Fixes https://github.com/ricoberger/script_exporter/issues/55, https://github.com/ricoberger/script_exporter/issues/51

@ricoberger Feel free to take a look at the implementation already. I still need to update README, examples, etc.

Example output for invalid configuration:

2022/09/06 14:19:01 Miconfiguration detected: script config ping combines mutually exclusive settings 'script' and 'command' / 'args'
2022/09/06 14:19:01 Miconfiguration detected: script config ping2 combines mutually exclusive settings 'script' and 'command' / 'args'
2022/09/06 14:19:01 Miconfiguration detected: script config helloworld has neither 'script' nor 'command'
2022/09/06 14:19:01 Invalid configuration
ricoberger commented 2 years ago

Hi @Nick-Triller, thanks for your contribution 🙂.

Nick-Triller commented 2 years ago

Thanks for the fast response and for updating the docs @ricoberger!