Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
install_zabbix_agent_win
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rinat K. Nugaev
install_zabbix_agent_win
Commits
d3edc1d6
Commit
d3edc1d6
authored
Jun 09, 2018
by
Rinat K. Nugaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update has some bugfixes
parent
719684c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
zabbix_install.ps1
+8
-10
No files found.
zabbix_install.ps1
View file @
d3edc1d6
...
@@ -17,12 +17,12 @@ If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
...
@@ -17,12 +17,12 @@ If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
{
{
Write-Warning
"You do not have Admin
istrator rights to run this script!
`n
Please re-run this script as an Administrator
!"
Write-Warning
"You do not have Admin
rights to run this script!
`n
Please re-run this script with Admin rights
!"
Break
Break
}
}
#Importing module BitsTransfer
#Importing module BitsTransfer
for downloading zip archive with zabbix agent
Try
Try
{
{
Import-Module BitsTransfer -ErrorAction stop
Import-Module BitsTransfer -ErrorAction stop
...
@@ -45,8 +45,8 @@ $monserverip = (Test-Connection -ComputerName monitoring.nugaev.net -count 1).IP
...
@@ -45,8 +45,8 @@ $monserverip = (Test-Connection -ComputerName monitoring.nugaev.net -count 1).IP
Try
Try
{
{
$url
=
"https://support.nugaev.net/files/distrib/zabbix_agent.zip"
$url
=
"https://support.nugaev.net/files/distrib/zabbix_agent.zip"
$
output
=
$env
:TEMP
$
temparchive
=
$env
:TEMP
Start-BitsTransfer
-Source
$url
-Destination
$
output
-ErrorAction stop
Start-BitsTransfer
-Source
$url
-Destination
$
temparchive
-ErrorAction stop
}
}
Catch
Catch
{
{
...
@@ -65,8 +65,8 @@ function Unzip
...
@@ -65,8 +65,8 @@ function Unzip
[
System.IO.Compression.ZipFile]::ExtractToDirectory
(
$zipfile
,
$outpath
)
[
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
#Getting computer hostname for config file
$HostnameFull
=
"
$env
:computername.
$env
:userdnsdomain"
$HostnameFull
=
"
$env
:computername.
$env
:userdnsdomain"
#Removing dot from end of the hostname (this behavior possible if computer is not domain joined)
#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
...
@@ -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 10050
New-NetFirewallRule
-DisplayName
"ZabbixOUT"
-RemoteAddress
$monserverip
-Profile Any -Action Allow -Direction OutBound -Protocol TCP -LocalPort 10051
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
"Firewall rule for Monitoring Server added..."
Write-host
"Installation completed!"
Write-host
"Installation completed!"
\ No newline at end of file
Write-host
"Dont worry.. some red output because cmd command run in powershell )))"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment