Ad Widget

Collapse

Install Zabbix Massivelly Remotly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thenrique
    Junior Member
    • Mar 2020
    • 3

    #1

    Install Zabbix Massivelly Remotly

    Install Zabbix Massively Remotely
    I'm trying to write a Powershell script to install Zabbix Agent remotely, but i'm stuck on the command for install using msi.

    This is the script i'm using:

    Code:
    $lines = Get-Content c:\tmp\zabbix.txt
        $lines | 
        ForEach-Object{
    
            $server = $_.Split(' ')[0]
            $username = $_.Split(' ')[1]
            $senha = $_.Split(' ')[2]
    
            $pass = ConvertTo-SecureString -AsPlainText -Force -String $senha
            $credential = New-Object System.Management.Automation.PSCredential("$($server)\$username",$pass)
            $Session = New-PSSession -ComputerName "$server" -Credential $credential
    
            #Command to create folder using variables.
            Invoke-Command -Computername $server -Credential $credential -ScriptBlock {
            New-Item -Path $USING:zabbix_dir -ItemType Directory }
    
            #Copiar o instalador para o servidor
            Copy-Item "$zabbix_dir\*" -Destination "$zabbix_dir" -ToSession $Session -Recurse
    
            #Install Zabbix
            Write-Host Installing Zabbix Agent
            Invoke-Command -ComputerName $server -Credential $credential -ScriptBlock { 
            msiexec /I c:\tmp\zabbix\zabbix_agent-4.4.3-win-amd64-openssl.msi SERVER=fqdn.of.zabbix.server /qn
            }
    
            Write-Host Install End
    
            Remove-PSSession $Session
            }
    On remote system event viewer i got error 1603 on MSI Installer, but if i run this command line locally, agent works.

    Anybody can help-me to solve this issue ?

    Thanks.
  • vlad$$$
    Junior Member
    • Mar 2020
    • 16

    #2
    You can do it much easier:
    -Copy already prepared zabbix agent folder (containing agent, config file and etc) to all remote computers.
    - Execute following commands on all remote computers:
    c:\zabbix\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.conf -i (This command installs zabbix agent service)
    c:\zabbix\bin\zabbix_agentd.exe --start (This command starts zabbix agent service)

    Comment


    • thenrique
      thenrique commented
      Editing a comment
      Vlad,

      Thanks for your response, but i want to install Zabbix Agent on servers using MSI or the Installer, need to keep track of changes and software installed on my servers for compliance.
  • vlad$$$
    Junior Member
    • Mar 2020
    • 16

    #3
    You can try using psexec or logon script may be.

    Comment

    Working...