You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we have a quite large PRTG Installation and sometimes it takes a long time that the prtg api does it thing ;)
No i tried to set RetryCount and RetryDelay higher but it does not seem to work:
I set RetryCount and RetryDelay to 20: Connect-PrtgServer "https://$($PRTGServer):$($PRTGPort)" (New-Credential $PRTGUser $PRTGPassHash) -PassHash -RetryCount 20 -RetryDelay 20
And now i expected that i see something like Retries remaining 20 instead of 4 ?
Am i just doing it wrong?
The screenshot is not manipulated in any form. It was just a half output of the get-prtgclient.
Sure, here we go with some additional informations:
Get-PrtgClient-Diagnostic
PSVersion : 5.1.17763.2803
PSEdition : Desktop
OS : Microsoft Windows Server 2019 Standard
PrtgAPIVersion : 0.9.17
Culture : de-DE
CLRVersion : .NET Framework 4.7.2 (461814)
PrtgVersion : 22.2.76.1705
PrtgLanguage : german.lng
The "call" of the actual Add-Sensor/Add-Device Sensor is quite complex and i just can't copy paste it in three lines.
This is my Setup:
Script: Update-PRTGDevices.ps1
Import-Module prtghelper.psm1 -force # This is a custom helper module for us internal to share some methods between scriptsConnect-PrtgServer"https://$($PRTGServer):$($PRTGPort)" (New-Credential$PRTGUser$PRTGPassHash) -PassHash -RetryCount 50-RetryDelay 50# Gather some devices from the crmforeach($erpdevicein$erpdevices){
$myDevice=Set-PRTGDevice-Parent $someParentGroup-ERPDevice $erpdevice# now we add / replace some sensors with the "same" method as on the the device.
}
Custom Module: prtghelper.psm1
functionSet-PRTGDevice{
param($Parent,$ERPDevice)
$device=$Parent|Get-Device-Name $DeviceName# Sometimes this just return nothing even if there is a correct deviceif(($device|Measure-Object).Count -gt0){
if(($device|Measure-Object).Count -gt1){
throw"$DeviceName in $($Parent.Name) not unique"
}
$device|Set-ObjectProperty Host $Hostname
}else{
$device=$Parent|Add-Device$DeviceName$($Hostname)
# THIS will "fail" and take aged on adding multiple devices. and i return a wrong result
}
return$device
}
What's going on?
Hello,
we have a quite large PRTG Installation and sometimes it takes a long time that the prtg api does it thing ;)
No i tried to set RetryCount and RetryDelay higher but it does not seem to work:
I set RetryCount and RetryDelay to 20:
Connect-PrtgServer "https://$($PRTGServer):$($PRTGPort)" (New-Credential $PRTGUser $PRTGPassHash) -PassHash -RetryCount 20 -RetryDelay 20
And now i expected that i see something like Retries remaining 20 instead of 4 ?
Am i just doing it wrong?
thank you, best regards
xasz
Due Dilligance
The text was updated successfully, but these errors were encountered: