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
2ef8b007
Commit
2ef8b007
authored
Jun 11, 2018
by
Rinat K. Nugaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some improvements
parent
9f847963
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
zabbix_install.ps1
+7
-8
No files found.
zabbix_install.ps1
View file @
2ef8b007
...
...
@@ -56,15 +56,15 @@ Break
}
#Getting and defining some vars
#$urldistzabbix where your zabbix_agent archive
#
$urldistzabbix = "https://support.nugaev.net/files/distrib/zabbix_agent.zip"
$urldistzabbix
=
"https://support.nugaev.net/files/distrib/zabbix_agent.zip"
$urldistzabbix
=
"https://www.zabbix.com/downloads/3.4.6/zabbix_agents_3.4.6.win.zip"
#
$urldistzabbix = "https://www.zabbix.com/downloads/3.4.6/zabbix_agents_3.4.6.win.zip"
#$temparchivedir where you'll download zabbix_agent archive
$temparchive
=
"
$env
:TEMP\zabbix_agent.zip"
#$PathZabbix folder where you'll install zabbix agent
$PathZabbix
=
${
env
:ProgramFiles
}
+
'\Zabbix'
#$ZabbixConf zabbix agent config
$ZabbixConf
=
$PathZabbix
+
'\conf\zabbix_agentd.conf'
$ZabbixConf
=
$PathZabbix
+
'\conf\zabbix_agentd.
win.
conf'
#Your OS architechture
$OsArch
=
wmic os get OSArchitecture /value
#Getting monitoring server ip for Firewall Rule
...
...
@@ -101,15 +101,15 @@ $HostnameFull ="$env:computername.$env:userdnsdomain"
$HostnameFull
=
$HostnameFull
-replace
"\.(?<=\z)"
,
""
#Creating config
#Preparing content for config gile
$confcont
=
"
#This is a Nugaev NET Monitoring Server config file
LogFile=
$
{
env
:ProgramFiles
}
\
Zabbix\log\zabbix_agentd.log
$confcont
=
"
LogFile=
$
Path
Zabbix
\log\zabbix_agentd.log
Server=monitoring.nugaev.net
ServerActive=monitoring.nugaev.net
Hostname=
$HostnameFull
HostMetadataItem=system.uname
"
#Adding content to the config file
Add
-Content
-Value
"
$confcont
"
-Path
$ZabbixConf
Set
-Content
-Value
"
$confcont
"
-Path
$ZabbixConf
#Defining $OsArch variable. It depend on system platform, 64 or 32 bits
$OsArch
=
wmic os get OSArchitecture /value
...
...
@@ -124,8 +124,7 @@ else
#Defining zabbix install command. It depends on $OsArch variable
$ZabbixInstallCommand
=
`
"
`"
C:\Program Files\Zabbix\bin\
$OsArch
\zabbix_agentd.exe
`"
--config
`"
C:\Program Files\Zabbix\conf\zabbix_agentd.conf
`"
"
$ZabbixInstallCommand
=
"
`"
$PathZabbix
\bin\
$OsArch
\zabbix_agentd.exe
`"
--config
`"
$ZabbixConf
`"
"
#Installing Zabbix Service
Try
...
...
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