Commit d3edc1d6 by Rinat K. Nugaev

Update has some bugfixes

parent 719684c9
......@@ -17,12 +17,12 @@ If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
{
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
Write-Warning "You do not have Admin rights to run this script!`nPlease re-run this script with Admin rights!"
Break
}
#Importing module BitsTransfer
#Importing module BitsTransfer for downloading zip archive with zabbix agent
Try
{
Import-Module BitsTransfer -ErrorAction stop
......@@ -45,8 +45,8 @@ $monserverip = (Test-Connection -ComputerName monitoring.nugaev.net -count 1).IP
Try
{
$url = "https://support.nugaev.net/files/distrib/zabbix_agent.zip"
$output = $env:TEMP
Start-BitsTransfer -Source $url -Destination $output -ErrorAction stop
$temparchive = $env:TEMP
Start-BitsTransfer -Source $url -Destination $temparchive -ErrorAction stop
}
Catch
{
......@@ -65,8 +65,8 @@ function Unzip
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
Unzip $output\zabbix_agent.zip $PathZabbix
Unzip $temparchive\zabbix_agent.zip $PathZabbix
Remove-Item -Force $temparchive\zabbix_agent.zip
#Getting computer hostname for config file
$HostnameFull ="$env:computername.$env:userdnsdomain"
#Removing dot from end of the hostname (this behavior possible if computer is not domain joined)
......@@ -95,6 +95,4 @@ New-NetFirewallRule -DisplayName "Zabbix" -RemoteAddress $monserverip -Profile
New-NetFirewallRule -DisplayName "ZabbixOUT" -RemoteAddress $monserverip -Profile Any -Action Allow -Direction OutBound -Protocol TCP -LocalPort 10050
New-NetFirewallRule -DisplayName "ZabbixOUT" -RemoteAddress $monserverip -Profile Any -Action Allow -Direction OutBound -Protocol TCP -LocalPort 10051
Write-host "Firewall rule for Monitoring Server added..."
Write-host "Installation completed!"
Write-host "Dont worry.. some red output because cmd command run in powershell )))"
\ No newline at end of file
Write-host "Installation completed!"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment