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

MSI parameter - EXTRA_FLAGS #291

Merged

Conversation

kpettijohn
Copy link
Contributor

Added the ENABLED_COLLECTOR_SERVICE_FILTERS parameter to the MSI installer in order to allow specifying a custom service query (collector.service.services-where).

Example:

msiexec /i wmi_exporter-0.5.1-amd64.msi ENABLED_COLLECTORS="service" ENABLED_COLLECTOR_SERVICE_FILTERS="""Name LIKE 'sql%'"""

Overall this is a rough attempt (I'm not familiar with MSI/windows packaging) at addressing #170.

Added the ENABLED_COLLECTOR_SERVICE_FILTERS to the MSI installer in
order to allow specifying a custom service query
(collector.service.services-where).

Example:
msiexec /i wmi_exporter-0.5.1-amd64.msi ENABLED_COLLECTORS="service" ENABLED_COLLECTOR_SERVICE_FILTERS="""Name LIKE 'sql%'"""
@carlpett
Copy link
Collaborator

Thanks @kpettijohn!
I was thinking about if it would make sense to just have a EXTRA_FLAGS parameter instead, so we don't need to do this for every flag to the exporter, what do you think?

Switched to using a single parameter called EXTRA_FLAGS to handle
additional unspecified flags within the MSI installer.
@kpettijohn kpettijohn changed the title MSI parameter - ENABLED_COLLECTOR_SERVICE_FILTERS MSI parameter - EXTRA_FLAGS Nov 28, 2018
@kpettijohn
Copy link
Contributor Author

kpettijohn commented Nov 28, 2018

@carlpett sounds good! I believe I have things working with the EXTRA_FLAGS parameter now after fighting with how quoting/escaping is being handled.

Example:

msiexec /log C:\pkg_install.log /i wmi_exporter-0.5.0-amd64.msi ENABLED_COLLECTORS=cpu,cs,net,os,service,system --% EXTRA_FLAGS="--collector.service.services-where ""Name LIKE 'sql%'"""

Let me know if you need any changes!

@carlpett
Copy link
Collaborator

Nice! The --% thing looks interesting, what does it mean? 😄
It'd be great with a short mention of this in the README file, too, but otherwise looks good!

@kpettijohn
Copy link
Contributor Author

The stop-parsing symbol (--%) prevents PowerShell from interpreting arguments in program calls as PowerShell commands and expressions.

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_special_characters?view=powershell-6#stop-parsing----

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-6

Im not very familiar with PowerShell but it seemed required to use --% in order to prevent spaces/quotes/symbols in the EXTRA_FLAGS parameter from being interpreted incorrectly.

@carlpett
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants