fix: Set default values for MSI web.listen-address
This prevents the exporter HTTP port from being omitted from the firewall rule DisplayName. I've tested this in the following four scenarios, and web.listen-address is set correctly for each: * Nothing set: 0.0.0.0:9182 * LISTEN_PORT=9184: 0.0.0.0:9184 * LISTEN_ADDR=127.0.0.1: 127.0.0.1:9182 * LISTEN_PORT=9184 LISTEN_ADDR=127.0.0.1: 127.0.0.1:9184 Signed-off-by: Ben Reedy <breed808@breed808.com>
This commit is contained in:
parent
d4b48e52e6
commit
7feafc1238
|
@ -15,11 +15,8 @@
|
||||||
<Property Id="EXTRA_FLAGS" Secure="yes" />
|
<Property Id="EXTRA_FLAGS" Secure="yes" />
|
||||||
<SetProperty Id="ExtraFlags" After="InstallFiles" Sequence="execute" Value="[EXTRA_FLAGS]" Condition="EXTRA_FLAGS" />
|
<SetProperty Id="ExtraFlags" After="InstallFiles" Sequence="execute" Value="[EXTRA_FLAGS]" Condition="EXTRA_FLAGS" />
|
||||||
|
|
||||||
<Property Id="LISTEN_ADDR" Secure="yes" />
|
<Property Id="LISTEN_ADDR" Secure="yes" Value="0.0.0.0" />
|
||||||
<Property Id="LISTEN_PORT" Secure="yes" />
|
<Property Id="LISTEN_PORT" Secure="yes" Value="9182" />
|
||||||
<SetProperty Id="ListenFlagBoth" After="InstallFiles" Sequence="execute" Value="--web.listen-address [LISTEN_ADDR]:[LISTEN_PORT]" Condition="LISTEN_ADDR AND LISTEN_PORT" />
|
|
||||||
<SetProperty Id="ListenFlagAddr" After="InstallFiles" Sequence="execute" Value="--web.listen-address [LISTEN_ADDR]:9182" Condition="LISTEN_ADDR AND (NOT LISTEN_PORT)" />
|
|
||||||
<SetProperty Id="ListenFlagPort" After="InstallFiles" Sequence="execute" Value="--web.listen-address 0.0.0.0:[LISTEN_PORT]" Condition="LISTEN_PORT AND (NOT LISTEN_ADDR)" />
|
|
||||||
|
|
||||||
<Property Id="METRICS_PATH" Secure="yes" />
|
<Property Id="METRICS_PATH" Secure="yes" />
|
||||||
<SetProperty Id="MetricsPathFlag" After="InstallFiles" Sequence="execute" Value="--telemetry.path [METRICS_PATH]" Condition="METRICS_PATH" />
|
<SetProperty Id="MetricsPathFlag" After="InstallFiles" Sequence="execute" Value="--telemetry.path [METRICS_PATH]" Condition="METRICS_PATH" />
|
||||||
|
@ -39,7 +36,7 @@
|
||||||
<fw:RemoteAddress Value="[REMOTE_ADDR]" />
|
<fw:RemoteAddress Value="[REMOTE_ADDR]" />
|
||||||
</fw:FirewallException>
|
</fw:FirewallException>
|
||||||
</File>
|
</File>
|
||||||
<ServiceInstall Id="InstallExporterService" Name="windows_exporter" DisplayName="windows_exporter" Description="Exports Prometheus metrics about the system" ErrorControl="normal" Start="auto" Type="ownProcess" Arguments="--log.file eventlog [CollectorsFlag] [ListenFlagBoth] [ListenFlagAddr] [ListenFlagPort] [MetricsPathFlag] [TextfileDirFlag] [ExtraFlags]">
|
<ServiceInstall Id="InstallExporterService" Name="windows_exporter" DisplayName="windows_exporter" Description="Exports Prometheus metrics about the system" ErrorControl="normal" Start="auto" Type="ownProcess" Arguments="--log.file eventlog [CollectorsFlag] --web.listen-address [LISTEN_ADDR]:[LISTEN_PORT] [MetricsPathFlag] [TextfileDirFlag] [ExtraFlags]">
|
||||||
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" RestartServiceDelayInSeconds="60" />
|
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" RestartServiceDelayInSeconds="60" />
|
||||||
<ServiceDependency Id="wmiApSrv" />
|
<ServiceDependency Id="wmiApSrv" />
|
||||||
</ServiceInstall>
|
</ServiceInstall>
|
||||||
|
|
Loading…
Reference in New Issue