Commit 2ef8b007 by Rinat K. Nugaev

Added some improvements

parent 9f847963
...@@ -56,15 +56,15 @@ Break ...@@ -56,15 +56,15 @@ Break
} }
#Getting and defining some vars #Getting and defining some vars
#$urldistzabbix where your zabbix_agent archive #$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 #$temparchivedir where you'll download zabbix_agent archive
$temparchive = "$env:TEMP\zabbix_agent.zip" $temparchive = "$env:TEMP\zabbix_agent.zip"
#$PathZabbix folder where you'll install zabbix agent #$PathZabbix folder where you'll install zabbix agent
$PathZabbix = ${env:ProgramFiles} + '\Zabbix' $PathZabbix = ${env:ProgramFiles} + '\Zabbix'
#$ZabbixConf zabbix agent config #$ZabbixConf zabbix agent config
$ZabbixConf = $PathZabbix + '\conf\zabbix_agentd.conf' $ZabbixConf = $PathZabbix + '\conf\zabbix_agentd.win.conf'
#Your OS architechture #Your OS architechture
$OsArch = wmic os get OSArchitecture /value $OsArch = wmic os get OSArchitecture /value
#Getting monitoring server ip for Firewall Rule #Getting monitoring server ip for Firewall Rule
...@@ -101,15 +101,15 @@ $HostnameFull ="$env:computername.$env:userdnsdomain" ...@@ -101,15 +101,15 @@ $HostnameFull ="$env:computername.$env:userdnsdomain"
$HostnameFull = $HostnameFull -replace "\.(?<=\z)", "" $HostnameFull = $HostnameFull -replace "\.(?<=\z)", ""
#Creating config #Creating config
#Preparing content for config gile #Preparing content for config gile
$confcont = "#This is a Nugaev NET Monitoring Server config file $confcont = "
LogFile=${env:ProgramFiles}\Zabbix\log\zabbix_agentd.log LogFile=$PathZabbix\log\zabbix_agentd.log
Server=monitoring.nugaev.net Server=monitoring.nugaev.net
ServerActive=monitoring.nugaev.net ServerActive=monitoring.nugaev.net
Hostname=$HostnameFull Hostname=$HostnameFull
HostMetadataItem=system.uname HostMetadataItem=system.uname
" "
#Adding content to the config file #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 #Defining $OsArch variable. It depend on system platform, 64 or 32 bits
$OsArch = wmic os get OSArchitecture /value $OsArch = wmic os get OSArchitecture /value
...@@ -124,8 +124,7 @@ else ...@@ -124,8 +124,7 @@ else
#Defining zabbix install command. It depends on $OsArch variable #Defining zabbix install command. It depends on $OsArch variable
$ZabbixInstallCommand = ` $ZabbixInstallCommand = "`"$PathZabbix\bin\$OsArch\zabbix_agentd.exe`" --config `"$ZabbixConf`""
"`"C:\Program Files\Zabbix\bin\$OsArch\zabbix_agentd.exe`" --config `"C:\Program Files\Zabbix\conf\zabbix_agentd.conf`""
#Installing Zabbix Service #Installing Zabbix Service
Try Try
......
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