Open elfranne opened 2 months ago
Yeah, I have the same issue 🤔 Were you ever able to resolve it?
I found a workaround by changing a registry key.
I use Puppet with Chocolatey and Sensu (monitoring), here is how I solved my issue:
# Prometheus Collector for Windows,
# see list of all collectors available: https://github.com/prometheus-community/windows_exporter/?tab=readme-ov-file#collectors
class profile::win_exporter (
Hash $config,
) {
$config_file = 'C:\\ProgramData\\Sensu\\config\\win_exporter.yaml' # sensu::etc_dir
file { $config_file:
ensure => 'file',
content => to_yaml($config),
require => Class['sensu::agent'],
notify => Service['windows_exporter'],
}
package { 'prometheus-windows-exporter.install' :
ensure => 'latest',
provider => 'chocolatey',
}
service { 'windows_exporter':
ensure => 'running',
require => Package['prometheus-windows-exporter.install'],
}
registry_value { 'windows_exporter-use-config-file':
ensure => 'present',
path => 'HKLM\\System\\CurrentControlSet\\Services\\windows_exporter\\ImagePath',
data => "\"C:\\Program Files\\windows_exporter\\windows_exporter.exe\" --log.file eventlog --web.listen-address 0.0.0.0:9182 --config.file \"${config_file}\"",
provider => 'registry',
type => 'expand',
notify => Service['windows_exporter'],
require => Package['prometheus-windows-exporter.install'],
}
}
What is the correct install syntax (or is it a bug?) for specifying
config.file
? Installing withoutparams
works fine. OS: Windows Server 2019 DatacenterDetails:
prometheus-windows-exporter.install.0.25.1.MsiInstall.log
chocolatey.log