From 98ab8d4d69d7dab676ca384afe7c9d996f852341 Mon Sep 17 00:00:00 2001 From: dotneft Date: Fri, 17 Sep 2021 00:14:49 +0300 Subject: [PATCH] Updated Zabbix agent 2 for Windows --- Dockerfiles/agent2/windows/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfiles/agent2/windows/Dockerfile b/Dockerfiles/agent2/windows/Dockerfile index b668e5993..0a22a5365 100644 --- a/Dockerfiles/agent2/windows/Dockerfile +++ b/Dockerfiles/agent2/windows/Dockerfile @@ -286,14 +286,17 @@ USER ContainerAdministrator RUN $env:PATH = [string]::Format('{0}\zabbix\sbin;{0}\zabbix\bin;', $env:SystemDrive) + $env:PATH; ` [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); ` + ` $env:ZBX_HOME = [string]::Format('{0}\zabbix', $env:SystemDrive); ` [Environment]::SetEnvironmentVariable('ZBX_HOME', $env:ZBX_HOME, [EnvironmentVariableTarget]::Machine); -RUN Set-Location -Path "$env:SystemDrive"\; ` +RUN Set-Location -Path $env:SystemDrive\.; ` + ` New-Item -ItemType directory -Path "$env:ZBX_HOME\conf\zabbix_agentd.d" | Out-Null; ` New-Item -ItemType directory -Path "$env:ZBX_HOME\enc" | Out-Null; ` New-Item -ItemType directory -Path "$env:ZBX_HOME\modules" | Out-Null; ` New-Item -ItemType directory -Path "$env:ZBX_HOME\buffer" | Out-Null; ` + ` net user /add zabbix; ` $acl = Get-Acl -Path $env:ZBX_HOME; ` $ace = New-Object Security.AccessControl.FileSystemAccessRule ('zabbix', 'Modify', 'ContainerInherit, ObjectInherit', 'InheritOnly', 'Allow'); `