Browse Source

Install and configure glpi, windows exporter and promtail

master
Akshay 1 year ago
parent
commit
567692409b
1 changed files with 36 additions and 0 deletions
  1. +36
    -0
      collectors.ps1

+ 36
- 0
collectors.ps1 View File

@ -0,0 +1,36 @@
# install glpi and windows exporter
New-Item -Path "c:\\" -Name "collectors" -ItemType "directory"
$exporter_url = "https://sovran.dev/akshay/promtail-windows/raw/branch/master/windows_exporter-0.24.0-amd64.msi"
$exporter_dir= "c:\collectors\windows_exporter.msi"
Invoke-WebRequest -Uri $exporter_url -OutFile $exporter_dir
msiexec /i windows_exporter.msi ENABLED_COLLECTORS="service,system,textfile,cpu,cs,logial_disk,net,os,logon,memory,process"
$glpi_url = "https://sovran.dev/akshay/promtail-windows/raw/branch/master/GLPI-Agent-1.5-x64.msi"
$glpi_dir= "c:\collectors\glpi_agent.msi"
$glpi_config_url = "https://sovran.dev/akshay/promtail-windows/raw/branch/master/agent.cfg"
$glpi_config_dir= "c:\Program Files\GLPI-Agent\etc\agent.cfg"
Invoke-WebRequest -Uri $glpi_url -OutFile $glpi_dir
Invoke-WebRequest -Uri $glpi_config_curl -OutFile $glpi_config_dir
msiexec /i glpi_agent.msi
# Install promtail for event logs
New-Item -Path "c:\\" -Name "promtail" -ItemType "directory"
$exec_url = "https://sovran.dev/akshay/promtail-windows/raw/branch/master/promtail-windows-amd64.exe.zip"
$config_url = "https://sovran.dev/akshay/promtail-windows/raw/branch/master/promtail-config.yaml"
$exec_dir= "c:\promtail\promtail-windows-amd64.exe.zip"
$config_dir= "c:\promtail\promtail-config.yaml"
Invoke-WebRequest -Uri $exec_url -OutFile $exec_dir
Invoke-WebRequest -Uri $config_url -OutFile $config_dir
Expand-Archive -LiteralPath $exec_dir -DestinationPath "c:\\promtail"
C:\promtail\promtail-windows-amd64.exe --config.file="C:\promtail\promtail-config.yaml" --config.expand-env=true

Loading…
Cancel
Save