diff --git a/collectors.ps1 b/collectors.ps1 new file mode 100644 index 0000000..737fe2a --- /dev/null +++ b/collectors.ps1 @@ -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