mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
scheduled_task: do not report windows_scheduled_task_last_result for task that never run before (#1562)
This commit is contained in:
@@ -25,7 +25,7 @@ $skip_re = "^(go_|windows_exporter_build_info|windows_exporter_collector_duratio
|
||||
$exporter_proc = Start-Process `
|
||||
-PassThru `
|
||||
-FilePath ..\windows_exporter.exe `
|
||||
-ArgumentList "--log.level=debug --web.disable-exporter-metrics --collectors.enabled=[defaults],textfile --collector.textfile.directories=$($textfile_dir)" `
|
||||
-ArgumentList "--log.level=debug --web.disable-exporter-metrics --collectors.enabled=[defaults],textfile,scheduled_task --collector.scheduled_task.include=.*WinSAT --collector.textfile.directories=$($textfile_dir)" `
|
||||
-WindowStyle Hidden `
|
||||
-RedirectStandardOutput "$($temp_dir)/windows_exporter.log" `
|
||||
-RedirectStandardError "$($temp_dir)/windows_exporter_error.log"
|
||||
@@ -36,7 +36,7 @@ for ($i=1; $i -le 5; $i++) {
|
||||
|
||||
$netstat_output = netstat -anp tcp | Select-String 'listening'
|
||||
if ($netstat_output -like '*:9182*') {
|
||||
break
|
||||
break
|
||||
}
|
||||
Write-Host "Waiting for exporter to start"
|
||||
}
|
||||
@@ -64,5 +64,6 @@ if (-not ($null -eq $output_diff)) {
|
||||
Get-Content "$($temp_dir)/windows_exporter.log"
|
||||
Write-Host "STDERR"
|
||||
Get-Content "$($temp_dir)/windows_exporter_error.log"
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user