-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from opinkerfi/okconfig_versioning
Added adagios.ini for versioning check, removed Adagios versioning in…
- Loading branch information
Showing
3 changed files
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,14 +62,14 @@ Try { | |
[string]$appArch = '' | ||
[string]$appLang = 'EN' | ||
[string]$appRevision = '01' | ||
[string]$appScriptVersion = '1.0.5' | ||
[string]$appScriptVersion = '1.0.0.1' | ||
[string]$appScriptDate = '23/01/2019' | ||
[string]$appScriptAuthor = 'Gardar Thorsteinsson<[email protected]>' | ||
##*=============================================== | ||
## Variables: Install Titles (Only set here to override defaults set by the toolkit) | ||
[string]$installName = 'NSClient++ Deployment' | ||
[string]$installTitle = '' | ||
[version]$AdagiosRelease = [version]'1.0.5' | ||
[version]$AdagiosAgentVersion = [version]'1.0.0.1' | ||
## Variables: System architecture detection | ||
#If([IntPtr]::Size -eq 8) | ||
#{ | ||
|
@@ -189,17 +189,14 @@ Try { | |
[string]$installPhase = 'Post-Installation' | ||
|
||
## <Perform Post-Installation tasks here> | ||
if((Get-RegistryKey "HKLM:\SOFTWARE\OpinKerfi\Adagios" -Value CurrentVersion) -lt $AdagiosRelease) { | ||
Write-Log -Source $deployAppScriptFriendlyName -Message "Adagios OKconfig templates are < [string]$AdagiosRelease, installing" | ||
Stop-ServiceAndDependencies -Name 'nscp' | ||
Copy-File -Path "$dirSupportFiles\*.*" -Destination "$envProgramFiles\NSClient++\" | ||
Copy-File -Path "$dirSupportFiles\Scripts" -Destination "$envProgramFiles\NSClient++" -Recurse | ||
|
||
# Update registry key for Adagios agent version (OKconfig version) | ||
Set-RegistryKey -Key 'HKEY_LOCAL_MACHINE\SOFTWARE\OpinKerfi\Adagios' -Name 'CurrentVersion' -Value $AdagiosRelease -Type String -ContinueOnError:$True | ||
Start-ServiceAndDependencies -Name 'nscp' | ||
|
||
} | ||
|
||
# nscp settings --path /adagios --key "adagios_agent_version" --show | ||
# nscp settings --path /adagios --key "adagios_agent_version" --set "1.0.0.1" | ||
Stop-ServiceAndDependencies -Name 'nscp' | ||
Copy-File -Path "$dirSupportFiles\*.*" -Destination "$envProgramFiles\NSClient++\" | ||
Copy-File -Path "$dirSupportFiles\Scripts" -Destination "$envProgramFiles\NSClient++" -Recurse | ||
|
||
Start-ServiceAndDependencies -Name 'nscp' | ||
|
||
## Display a message at the end of the install | ||
If (-not $useDefaultMsi) { Show-InstallationPrompt -Message 'Installation completed successfully. Remember to add the ip address of your Nagios server to the "allowed hosts" variable located in the file $envProgramFiles\NSClient++\allowed_hosts.ini. At last, restart the NSClient++ service.' -ButtonRightText 'OK' -Icon Information -NoWait } | ||
|
@@ -266,4 +263,4 @@ Catch { | |
Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName | ||
Show-DialogBox -Text $mainErrorMessage -Icon 'Stop' | ||
Exit-Script -ExitCode $mainExitCode | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
; Adagios agent configuration | ||
; nscp.exe settings --path /adagios --key "adagios_agent_version" --show | ||
; nscp.exe settings --path /adagios --key "adagios_agent_version" --set "1.0.0.1" | ||
[/adagios] | ||
adagios_agent_version = 1.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters