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
5e028b3f
Commit
5e028b3f
authored
Jun 08, 2018
by
Rinat K. Nugaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some useful comments
parent
efa10a15
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
zabbix_install.ps1
+11
-5
No files found.
zabbix_install.ps1
View file @
5e028b3f
...
@@ -37,23 +37,28 @@ $HostnameFull ="$env:computername.$env:userdnsdomain"
...
@@ -37,23 +37,28 @@ $HostnameFull ="$env:computername.$env:userdnsdomain"
#Creating config
#Creating config
#Preparing content for config gile
$confcont
=
"#This is a Nugaev NET Monitoring Server config file
$confcont
=
"#This is a Nugaev NET Monitoring Server config file
LogFile=
${
env
:ProgramFiles
}
\Zabbix\log\zabbix_agentd.log
LogFile=
${
env
:ProgramFiles
}
\Zabbix\log\zabbix_agentd.log
Server=monitoring.nugaev.net
Server=monitoring.nugaev.net
ServerActive=monitoring.nugaev.net
ServerActive=monitoring.nugaev.net
Hostname=
$HostnameFull
Hostname=
$HostnameFull
"
"
#Adding content to the config file
Add-Content
-Value
"
$confcont
"
-Path
$ZabbixConf
Add-Content
-Value
"
$confcont
"
-Path
$ZabbixConf
#Installing zabbix agent as a service
&
"c:\Program Files\Zabbix\bin\win64\zabbix_agentd.exe"
--config
"c:\Program Files\Zabbix\conf\zabbix_agentd.conf"
--install
&
"c:\Program Files\Zabbix\bin\win64\zabbix_agentd.exe"
--config
"c:\Program Files\Zabbix\conf\zabbix_agentd.conf"
--install
start-service
"Zabbix Agent"
#Starting zabbix agent
Get-service
-name
"Zabbix Agent"
|
start-service
#Dont remember why but entering to the temporary directory
cd
${
ENV
:temp
}
cd
${
ENV
:temp
}
#Adding firewall rules for zabbix agent inbound for zabbix server and outbound for agent
New-NetFirewallRule
-DisplayName
"Zabbix"
-RemoteAddress
$monserverip
-Profile Any -Action Allow -Direction Inbound -Protocol TCP -LocalPort 10050
New-NetFirewallRule
-DisplayName
"Zabbix"
-RemoteAddress
$monserverip
-Profile Any -Action Allow -Direction Inbound -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 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!"
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