P
This commit is contained in:
@@ -18,7 +18,11 @@ prometheus.exporter.windows "local" {
|
|||||||
"service",
|
"service",
|
||||||
"logon",
|
"logon",
|
||||||
"update",
|
"update",
|
||||||
|
"textfile",
|
||||||
]
|
]
|
||||||
|
textfile {
|
||||||
|
directory = "C:/ProgramData/Alloy/metrics"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prometheus.scrape "windows_exporter" {
|
prometheus.scrape "windows_exporter" {
|
||||||
|
|||||||
12
get_version_chrome.ps1
Normal file
12
get_version_chrome.ps1
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Crear directorio si no existe
|
||||||
|
$dir = "C:\ProgramData\Alloy\metrics"
|
||||||
|
if (!(Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force }
|
||||||
|
|
||||||
|
# Obtener versión de Chrome
|
||||||
|
$path = "${env:ProgramFiles}\Google\Chrome\Application\chrome.exe"
|
||||||
|
if (Test-Path $path) {
|
||||||
|
$ver = (Get-Item $path).VersionInfo.ProductVersion
|
||||||
|
# Formato Prometheus: nombre_metrica{labels} valor
|
||||||
|
# Usamos valor 1 para que la métrica exista
|
||||||
|
"chrome_version_info{version=`"$ver`",arch=`"x64`"} 1" | Set-Content "$dir\chrome.prom" -Encoding ascii
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user