mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-21 12:16:36 +00:00
MSI parameter - EXTRA_FLAGS (#291)
Added the parameter called EXTRA_FLAGS to handle additional unspecified flags within the MSI installer.
This commit is contained in:
committed by
Calle Pettersson
parent
f27fdbbbf5
commit
b2cb04834a
@@ -44,13 +44,19 @@ Name | Description
|
|||||||
`LISTEN_PORT` | The port to bind to. Defaults to 9182.
|
`LISTEN_PORT` | The port to bind to. Defaults to 9182.
|
||||||
`METRICS_PATH` | The path at which to serve metrics. Defaults to `/metrics`
|
`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
|
`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
|
```powershell
|
||||||
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,iis LISTEN_PORT=5000
|
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,iis LISTEN_PORT=5000
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Example service collector with a custom query.
|
||||||
|
```powershell
|
||||||
|
msiexec /i <path-to-msi-file> ENABLED_COLLECTORS=os,service --% EXTRA_FLAGS="--collector.service.services-where ""Name LIKE 'sql%'"""
|
||||||
|
```
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
See [open issues](https://github.com/martinlindhe/wmi_exporter/issues)
|
See [open issues](https://github.com/martinlindhe/wmi_exporter/issues)
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
<Property Id="ENABLED_COLLECTORS" Secure="yes"/>
|
<Property Id="ENABLED_COLLECTORS" Secure="yes"/>
|
||||||
<SetProperty Id="CollectorsFlag" After="InstallFiles" Sequence="execute" Value="--collectors.enabled [ENABLED_COLLECTORS]">ENABLED_COLLECTORS</SetProperty>
|
<SetProperty Id="CollectorsFlag" After="InstallFiles" Sequence="execute" Value="--collectors.enabled [ENABLED_COLLECTORS]">ENABLED_COLLECTORS</SetProperty>
|
||||||
|
|
||||||
|
<Property Id="EXTRA_FLAGS" Secure="yes"/>
|
||||||
|
<SetProperty Id="ExtraFlags" After="InstallFiles" Sequence="execute" Value="[EXTRA_FLAGS]">EXTRA_FLAGS</SetProperty>
|
||||||
|
|
||||||
<Property Id="LISTEN_ADDR" Secure="yes" />
|
<Property Id="LISTEN_ADDR" Secure="yes" />
|
||||||
<Property Id="LISTEN_PORT" Secure="yes" Value="9182" />
|
<Property Id="LISTEN_PORT" Secure="yes" Value="9182" />
|
||||||
<SetProperty Id="ListenFlag" After="InstallFiles" Sequence="execute" Value="--telemetry.addr [LISTEN_ADDR]:[LISTEN_PORT]">LISTEN_ADDR OR LISTEN_PORT</SetProperty>
|
<SetProperty Id="ListenFlag" After="InstallFiles" Sequence="execute" Value="--telemetry.addr [LISTEN_ADDR]:[LISTEN_PORT]">LISTEN_ADDR OR LISTEN_PORT</SetProperty>
|
||||||
@@ -42,7 +45,7 @@
|
|||||||
<File Id="wmi_exporter.exe" Name="wmi_exporter.exe" Source="Work\wmi_exporter.exe" KeyPath="yes">
|
<File Id="wmi_exporter.exe" Name="wmi_exporter.exe" Source="Work\wmi_exporter.exe" KeyPath="yes">
|
||||||
<fw:FirewallException Id="MetricsEndpoint" Name="WMI Exporter (HTTP [LISTEN_PORT])" Description="WMI Exporter HTTP endpoint" Port="[LISTEN_PORT]" Protocol="tcp" Scope="any" IgnoreFailure="yes" />
|
<fw:FirewallException Id="MetricsEndpoint" Name="WMI Exporter (HTTP [LISTEN_PORT])" Description="WMI Exporter HTTP endpoint" Port="[LISTEN_PORT]" Protocol="tcp" Scope="any" IgnoreFailure="yes" />
|
||||||
</File>
|
</File>
|
||||||
<ServiceInstall Id="InstallExporterService" Name="wmi_exporter" DisplayName="WMI exporter" Description="Exports Prometheus metrics from WMI queries" ErrorControl="normal" Start="auto" Type="ownProcess" Arguments="--log.format logger:eventlog?name=wmi_exporter [CollectorsFlag] [ListenFlag] [MetricsPathFlag] [TextfileDirFlag]">
|
<ServiceInstall Id="InstallExporterService" Name="wmi_exporter" DisplayName="WMI exporter" Description="Exports Prometheus metrics from WMI queries" ErrorControl="normal" Start="auto" Type="ownProcess" Arguments="--log.format logger:eventlog?name=wmi_exporter [CollectorsFlag] [ListenFlag] [MetricsPathFlag] [TextfileDirFlag] [ExtraFlags]">
|
||||||
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" RestartServiceDelayInSeconds="5" />
|
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" RestartServiceDelayInSeconds="5" />
|
||||||
</ServiceInstall>
|
</ServiceInstall>
|
||||||
<ServiceControl Id="ServiceStateControl" Name="wmi_exporter" Remove="uninstall" Start="install" Stop="both" />
|
<ServiceControl Id="ServiceStateControl" Name="wmi_exporter" Remove="uninstall" Start="install" Stop="both" />
|
||||||
|
|||||||
Reference in New Issue
Block a user