From b2cb04834aead5f9a8f35b1995d64270255e855a Mon Sep 17 00:00:00 2001 From: Kevin Pettijohn Date: Thu, 29 Nov 2018 11:14:37 -0800 Subject: [PATCH] MSI parameter - EXTRA_FLAGS (#291) Added the parameter called EXTRA_FLAGS to handle additional unspecified flags within the MSI installer. --- README.md | 8 +++++++- installer/wmi_exporter.wxs | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 12676658..cc65f25f 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,19 @@ Name | Description `LISTEN_PORT` | The port to bind to. Defaults to 9182. `METRICS_PATH` | The path at which to serve metrics. Defaults to `/metrics` `TEXTFILE_DIR` | As the `--collector.textfile.directory` flag, provide a directory to read text files with metrics from +`EXTRA_FLAGS` | Allows passing full CLI flags. Defaults to an empty string. -Parameters are sent to the installer via `msiexec`. Example invocation: +Parameters are sent to the installer via `msiexec`. Example invocations: ```powershell msiexec /i ENABLED_COLLECTORS=os,iis LISTEN_PORT=5000 ``` +Example service collector with a custom query. +```powershell +msiexec /i ENABLED_COLLECTORS=os,service --% EXTRA_FLAGS="--collector.service.services-where ""Name LIKE 'sql%'""" +``` + ## Roadmap See [open issues](https://github.com/martinlindhe/wmi_exporter/issues) diff --git a/installer/wmi_exporter.wxs b/installer/wmi_exporter.wxs index f45b78a5..7064a635 100644 --- a/installer/wmi_exporter.wxs +++ b/installer/wmi_exporter.wxs @@ -19,6 +19,9 @@ ENABLED_COLLECTORS + + EXTRA_FLAGS + LISTEN_ADDR OR LISTEN_PORT @@ -42,7 +45,7 @@ - +