Compare commits

..
4 Commits
Author SHA1 Message Date
dyoder 7825a5eb21 update 2021-10-07 09:40:42 -04:00
dyoder fe795e4ba1 update to use atera api to get customer host url 2021-10-07 09:29:46 -04:00
dyoder e9742704ff make prod ready 2021-10-05 13:42:34 -04:00
dyoder 641e88bd78 added Fix-AteraAgent.ps1 2021-10-05 13:35:39 -04:00
2 changed files with 38 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
$Global:_FixAteraAgentRestartAgent = $false
Function Delete-File ([Parameter(ValueFromPipeline=$true)][string]$path) {
If ( Test-Path $path ) {
If ( !((Get-Item $path) -is [System.IO.DirectoryInfo]) ) {
$Global:_FixAteraAgentRestartAgent = $true
Try {
LogMsg "Delete ""${path}"""
Remove-Item $path -Force
}
Catch { LogErr $_.Exception.Message }
}
}
}
## Remove cached files related to thresholds and alerts
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\AlertsCache.cch",
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\AlertsSentCache.cch",
"${Env:PROGRAMFILES}\ATERA Networks\AteraAgent\Packages\AgentPackageMonitoring\config.json" | Delete-File
If ($Global:_FixAteraAgentRestartAgent) {
LogMsg "Restarting Atera Agent service"
Try { Control-Service -Restart -Name "AteraAgent" -Force }
Catch { LogErr $_.Exception.Message }
}
+13 -1
View File
@@ -1,8 +1,20 @@
## Path to the MSI installer
$MSIURL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/LiquidFiles_Admin_2.0.129.msi'
Install-PSAteraModule
Import-Module -Name PSAtera
## Get LF host URL from Atera
LogMsg "Getting LiquidFiles host URL from Atera API"
Try {
Set-AteraAPIKey -APIKey $AteraAPIKey
$AteraAgent = Get-AteraAgent
$LFHost = $(Get-AteraCustomValue -ObjectType Customer -ObjectId $AteraAgent.CustomerID -FieldName 'LiquidFiles Host URL').ValueAsString
}
Catch { LogErr $_.Exception.Message }
## Set installer args
If ( $LFHost ) {
If (-not [string]::IsNullOrEmpty($LFHost) ) {
LogMsg "LiquidFiles target server: ${LFHost}"
$INSTALLER_ARGS = "REGKEYSCRIPT=""BaseUrl=${LFHost};"""
}