diff --git a/README.md b/README.md index 769981e..927e440 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,38 @@ # zabbix-agent-chocolatey This package installs the Zabbix agent using the pre-compiled files from [Zabbix SIA](https://www.zabbix.com/). -Executables are placed in `%ProgramFiles%\Zabbix Agent` and the zabbix_agentd.conf file is stored in `%ProgramData%\zabbix`. When new versions of the agent are installed, the config is not overwritten but rather the version number of the new file is appended to the name. For example, if version 3.2.0 is installed and then upgraded to version 3.4.6 you will find the sample 3.4.6 config files saved as “zabbix_agentd-3.4.6.conf”. +Executables are placed in "%ProgramFiles%\Zabbix Agent" and the zabbix_agentd.conf file is stored in "%ProgramData%\zabbix". -The source code for this Chocolatey package can be found on [GitHub](https://github.com/zabbix/zabbix-agent-chocolatey). Please file any issues you find in the project's [Issue tracker](https://github.com/zabbix/zabbix-agent-chocolatey/issues). +When new versions of the agent are installed, the original config is not overwritten but rather the version number of the new file is appended to the name. For example, if version 3.2.0 is installed and then upgraded to version 4.0.0 you will find the sample 4.0.0 config files saved as “zabbix_agentd-4.0.0.conf”. +The source code for this Chocolatey package can be found on [GitHub](https://github.com/zabbix/zabbix-agent-chocolatey). Please file any issues you find in the project's [Issue tracker](https://github.com/zabbix/zabbix-agent-chocolatey/issues). ## Release Notes +#### 2018-11-07 Release 4.0.0 +* Bumped up to Zabbix 4.0.0 +* Zabbix now places different arch into seperate zip files. + #### 2018-05-25 Release 3.4.6 -* Bumped up to Zabbix 3.4.6 -* Fix logo for nuspec config +* Bumped up to Zabbix 3.4.6. +* Fix logo for nuspec config. #### 2017-03-01 Release 3.2.0 -* Bumped up to Zabbix 3.2.0 -* Updated logo -* Swiched repository references github.com/genebean back to github.com/zabbix +* Bumped up to Zabbix 3.2.0. +* Updated logo. +* Swiched repository references github.com/genebean back to github.com/zabbix. #### 2017-03-01 Release 3.0.4 -* Removed depreciated values from install scripts -* Bumped up to Zabbix 3.0.4 -* Switched download url to https:// +* Removed depreciated values from install scripts. +* Bumped up to Zabbix 3.0.4. +* Switched download url to https://. #### 2015-03-22 Release 2.4.4 -* Moved config file from `$env:ProgramFiles\Zabbix Agent` to `$env:ProgramData\zabbix` -* Reworked `.nuspec` file to adhere to Chocolatey standards +* Moved config file from `$env:ProgramFiles\Zabbix Agent` to `$env:ProgramData\zabbix`. +* Reworked `.nuspec` file to adhere to Chocolatey standards. * Reworked scripts so that all variables are at the top and so that they are less likely to throw - errors or fail + errors or fail. * Made syntax more consistent throughout scripts. For example, changed to use `Join-Path` everywhere instead of just in some place. diff --git a/tools/chocolateyInstall.ps1 b/tools/chocolateyInstall.ps1 index 1a996ba..5d2ac83 100644 --- a/tools/chocolateyInstall.ps1 +++ b/tools/chocolateyInstall.ps1 @@ -1,25 +1,24 @@ -$version = '3.4.6' +$version = '4.0.0' $id = 'zabbix-agent' $title = 'Zabbix Agent' -$url = "https://www.zabbix.com/downloads/$version/zabbix_agents_$version.win.zip" -$url64 = $url -$checksum = "7ca9e6d059032d9d5b6c49a853850bc9" +$url = "https://www.zabbix.com/downloads/$version/zabbix_agents-$version-win-i386.zip" +$url64 = "https://www.zabbix.com/downloads/$version/zabbix_agents-$version-win-amd64.zip" +$checksum = "c3c2d5701bf1ade0e3a2c4dc63bb4dcd" $checksumType = "md5" -$checksum64 = $checksum -$checksumType64 = $checksumType +$checksum64 = "21a65223a730b35d75b3f2b8415deeca" +$checksumType64 = "md5" +$configDir = Join-Path $env:PROGRAMDATA 'zabbix' +$zabbixConf = Join-Path $configDir 'zabbix_agentd.conf' -$configDir = Join-Path $env:PROGRAMDATA 'zabbix' -$zabbixConf = Join-Path $configDir 'zabbix_agentd.conf' +$installDir = Join-Path $env:PROGRAMFILES $title +$zabbixAgentd = Join-Path $installDir 'zabbix_agentd.exe' -$installDir = Join-Path $env:PROGRAMFILES $title -$zabbixAgentd = Join-Path $installDir 'zabbix_agentd.exe' +$tempDir = Join-Path $env:TEMP 'chocolatey\zabbix' +$binDir = Join-Path $tempDir 'bin' +$binFiles = @('zabbix_agentd.exe', 'zabbix_get.exe', 'zabbix_sender.exe') +$sampleConfig = Join-Path $tempDir 'conf\zabbix_agentd.win.conf' -$tempDir = Join-Path $env:TEMP 'chocolatey\zabbix' - -$zipFile = Join-Path $tempDir "zabbix_agents_$version.win.zip" -$sampleConfig = Join-Path $tempDir 'conf\zabbix_agentd.win.conf' -$binFiles = @('zabbix_agentd.exe', 'zabbix_get.exe', 'zabbix_sender.exe') $is64bit = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture) -match '64' @@ -43,15 +42,15 @@ try { New-Item $tempDir -type directory } - Get-ChocolateyWebFile -PackageName "$id" -FileFullPath "$zipFile" -Url "$url" -Url64bit "$url64" -Checksum "$checksum" -ChecksumType "$checksumType" -Checksum64 "$checksum64" -ChecksumType64 "$checksumType64" - Get-ChocolateyUnzip "$zipFile" "$tempDir" - if ($is64bit) { - $binDir = Join-Path $tempDir 'bin\win64' + $zipFile = Join-Path $tempDir "zabbix_agents_$version.win-amd64.zip" } else { - $binDir = Join-Path $tempDir 'bin\win32' + $zipFile = Join-Path $tempDir "zabbix_agents_$version.win-i386.zip" } + Get-ChocolateyWebFile -PackageName "$id" -FileFullPath "$zipFile" -Url "$url" -Url64bit "$url64" -Checksum "$checksum" -ChecksumType "$checksumType" -Checksum64 "$checksum64" -ChecksumType64 "$checksumType64" + Get-ChocolateyUnzip "$zipFile" "$tempDir" + foreach ($executable in $binFiles ) { $file = Join-Path $binDir $executable Move-Item $file $installDir -Force diff --git a/zabbix-agent.nuspec b/zabbix-agent.nuspec index d0168de..cb3dc46 100644 --- a/zabbix-agent.nuspec +++ b/zabbix-agent.nuspec @@ -2,59 +2,31 @@ - zabbix-agent - 3.4.6 - https://github.com/zabbix/zabbix-agent-chocolatey + Zabbix Agent + 4.0.0 + Zabbix LLC Gene Liverman - - - - Zabbix Agent - Zabbix SIA - https://www.zabbix.com/ - https://raw.githubusercontent.com/zabbix/zabbix-agent-chocolatey/master/logo/zabbix_logo_500x131.png - GPL v2 - https://www.zabbix.com/license - false - https://www.zabbix.com/manuals - https://sourceforge.net/projects/zabbix/lists/zabbix-users - zabbix monitoring admin The Zabbix agent is used in conjunction with a Zabbix Server to for monitoring a system. This package installs the Zabbix agent using the pre-compiled files from [Zabbix SIA](https://www.zabbix.com/). -Executables are placed in `%ProgramFiles%\Zabbix Agent` and the zabbix_agentd.conf file is stored in `%ProgramData%\zabbix`. When new versions of the agent are installed, the config is not overwritten but rather the version number of the new file is appended to the name. For example, if version 3.2.0 is installed and then upgraded to version 3.4.6 you will find the sample 3.4.6 config files saved as “zabbix_agentd-3.4.6.conf”. +Executables are placed in "%ProgramFiles%\Zabbix Agent" and the zabbix_agentd.conf file is stored in "%ProgramData%\zabbix". -The source code for this Chocolatey package can be found on [GitHub](https://github.com/zabbix/zabbix-agent-chocolatey). Please file any issues you find in the project's [Issue tracker](https://github.com/zabbix/zabbix-agent-chocolatey/issues). +When new versions of the agent are installed, the original config is not overwritten but rather the version number of the new file is appended to the name. For example, if version 3.2.0 is installed and then upgraded to version 4.0.0 you will find the sample 4.0.0 config files saved as “zabbix_agentd-4.0.0.conf”. +The source code for this Chocolatey package can be found on [GitHub](https://github.com/zabbix/zabbix-agent-chocolatey). Please file any issues you find in the project's [Issue tracker](https://github.com/zabbix/zabbix-agent-chocolatey/issues). - -#### 2018-05-25 Release 3.4.6 -* Bumped up to Zabbix 3.4.6 -* Fix logo for nuspec config - -#### 2017-03-01 Release 3.2.0 -* Bumped up to Zabbix 3.2.0 -* Updated logo -* Swiched repository references github.com/genebean back to github.com/zabbix -* Updated to newer nuspec config - -#### 2017-03-01 Release 3.0.4 -* Removed depreciated values from install scripts -* Bumped up to Zabbix 3.0.4 -* Switched download url to https:// - -#### 2015-03-22 Release 2.4.4 -* Moved config file from `$env:ProgramFiles\Zabbix Agent` to `$env:ProgramData\zabbix` -* Reworked `.nuspec` file to adhere to Chocolatey standards -* Reworked scripts so that all variables are at the top and so that they are less likely to throw - errors or fail -* Made syntax more consistent throughout scripts. For example, changed to use `Join-Path` everywhere - instead of just in some place. - - - + https://www.zabbix.com/ + https://github.com/zabbix/zabbix + https://www.zabbix.com/manuals + https://support.zabbix.com/ + https://github.com/zabbix/zabbix-agent-chocolatey + https://lists.sourceforge.net/lists/listinfo/zabbix-announce + zabbix monitoring admin + https://www.zabbix.com/license + false + https://raw.githubusercontent.com/zabbix/zabbix-agent-chocolatey/master/logo/zabbix_logo_500x131.png