prometheus-community / windows_exporter

Prometheus exporter for Windows machines
MIT License
2.86k stars 684 forks source link

How do I update windows exporter with config-file...using msiexec? more in-depth docs on using config file #1420

Closed njoylif closed 5 months ago

njoylif commented 6 months ago

Hello, new to github, so bear with me if improper process/formatting...

I'm trying to get this exporting using a config file and can't figure out formatting when updating with msiexec. I've tried: msiexec /i c:\netdata\windows_exporter-0.25.1-amd64.msi --% EXTRA_FLAGS="--config.file=c:\netdata\netdata_config.yaml" I've been able to get it exporting defaults using: msiexec /i c:\netdata\windows_exporter-0.25.1-amd64.msi ENABLED_COLLECTORS="[default]" that works. I can't seem to get IIS exporting when using config nor this commandline: msiexec /i c:\netdata\windows_exporter-0.25.1-amd64.msi ENABLED_COLLECTORS="[default],iis,process"

I also need formatting examples of config file past what's there. not sure what's right and cant seem to test it yet. i.e. do I just remove this section if I want all services and tasks? Are wildcards supported?

collector:

service: services-where: Name='windows_exporter' scheduled_task: include: /Microsoft/.+

TYIA

ankurkdubey commented 6 months ago

One way - msiexec /i C:\windows_exporter-0.25.1-amd64.msi ENABLED_COLLECTORS=cpu,cs,iis,logical_disk,net,os,memory,process,tcp,service,system,textfile LISTEN_PORT=9182

The second way - using the config file msiexec /i "C:\windows_exporter\windows_exporter-0.25.1-amd64.msi" --% EXTRA_FLAGS="--config.file=C:\windows_exporter\config.yml"

config.yml

Note this is not an exhaustive list of all configuration values #cpu,cs,logical_disk,net,os,service,system,textfile,iis

collectors: enabled: cpu,iis,cs,logical_disk,net,os #please add collector name here using comma separated collector: service: services-where: Name='windows_exporter' scheduled_task: include: /Microsoft/.+ log: level: debug scrape: timeout-margin: 0.5 telemetry: path: /metrics max-requests: 5 web: listen-address: ":9182"

njoylif commented 6 months ago

I'll test, though I couldn't seem to get it working last time I tried. thanks for your response/time! I'll post results

njoylif commented 6 months ago

that just gives me the msiexec help popup:

Windows ® Installer. V 5.0.17763.4644

msiexec /Option [Optional Parameter]

Install Options </package | /i> Installs or configures a product /a Administrative install - Installs a product on the network /j<u|m> [/t ] [/g ] Advertises a product - m to all users, u to current user </uninstall | /x> <Product.msi | ProductCode> Uninstalls the product Display Options /quiet Quiet mode, no user interaction /passive Unattended mode - progress bar only /q[n|b|r|f] Sets user interface level n - No UI b - Basic UI r - Reduced UI f - Full UI (default) /help Help information Restart Options /norestart Do not restart after the installation is complete /promptrestart Prompts the user for restart if necessary /forcerestart Always restart the computer after installation Logging Options /l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] i - Status messages w - Nonfatal warnings e - All error messages a - Start up of actions r - Action-specific records u - User requests c - Initial UI parameters m - Out-of-memory or fatal exit information o - Out-of-disk-space messages p - Terminal properties v - Verbose output x - Extra debugging information

Consult the Windows ® Installer SDK for additional documentation on the command line syntax.

Copyright © Microsoft Corporation. All rights reserved. Portions of this software are based in part on the work of the Independent JPEG Group.

njoylif commented 6 months ago

ok, not to proud....PICNIC.

was in CMD...needed to be in powershell.

msiexec /i windows_exporter-0.25.1-amd64.msi --% EXTRA_FLAGS="--config.file=C:\Users\\downloads\config.yml"

worked when in right env. sigh. Thanks for response