Closed derSchweiger closed 1 year ago
It seems like that there is a bug similar as described in 181. When creating sensors based on SNMP, I receive the following error message:
Add-Sensor : Could not authenticate to PRTG; the specified username and password were invalid. In H:\Scripting\A8N\Automatisierung\anx-win-roles-prtg\scripts\CreateWindowsPRTGDevice.ps1:106 Zeichen:47 + ... $sensor = Get-Device -Id $device.Id | Add-Sensor $params -Resolve + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Add-Sensor], HttpRequestException + FullyQualifiedErrorId : System.Net.Http.HttpRequestException,PrtgAPI.PowerShell.Cmdlets.AddSensor
$error[1].Exception.StackTrace bei PrtgAPI.Request.RequestEngine.ValidateHttpResponse(HttpResponseMessage responseMessage, PrtgResponse response) bei PrtgAPI.Request.RequestEngine.ExecuteRequest(PrtgRequestMessage request, CancellationToken token, Func`2 responseParser) bei PrtgAPI.Request.RequestEngine.ExecuteRequest(ICommandParameters parameters, Func`2 responseParser, CancellationToken token) bei PrtgAPI.PrtgClient.AddObjectInternalDefault(ICommandParameters internalParams, CancellationToken token) bei PrtgAPI.Request.VersionClient18_1.AddSensorInternal(ICommandParameters internalParams, Int32 index, CancellationToken token) bei PrtgAPI.PrtgClient.AddObjectInternal(Either`2 parent, NewObjectParameters parameters, CancellationToken token) bei PrtgAPI.PrtgClient.<>c__DisplayClass151_0`1.<AddObject>b__0(CancellationToken t) bei PrtgAPI.PrtgClient.ResolveWithDiff[T](Action`1 createObject, Func`2 getObjects, Func`3 exceptFunc, CancellationToken token, Action`2 errorCallback, Func`1 shouldStop, Boolean allowMultiple, String enhancedResolutionError) bei PrtgAPI.PrtgClient.AddObject[T](Either`2 parent, NewObjectParameters parameters, Func`3 getObjects, Boolean resolve, CancellationToken token, Action`2 errorCallback, Func`1 shouldStop, Boolean allowMultiple) bei PrtgAPI.PowerShell.Base.NewObjectCmdlet.<>c__DisplayClass6_0`1.<AddAndResolveObject>b__0() bei PrtgAPI.PowerShell.Base.NewObjectCmdlet.AddAndResolveRunner[T](Func`1 addObject) bei PrtgAPI.PowerShell.Base.AddObject`2.ExecuteOperationAction(Int32 destinationId) bei PrtgAPI.PowerShell.Base.PrtgOperationCmdlet.ExecuteOperation(Action action, String progressMessage, Boolean complete, Boolean incrementRecord) bei PrtgAPI.PowerShell.Base.AddObject`2.AddObjectInternal(Int32 destinationId) bei PrtgAPI.PowerShell.Cmdlets.AddSensor.ProcessRecordEx() bei PrtgAPI.PowerShell.Base.PrtgCmdlet.ExecuteWithCoreState(Action action) bei System.Management.Automation.CommandProcessor.ProcessRecord()
There are no issues while creating or deleting the device. Seems like the bug came with one of the newest PRTG updates. Details about my environment:
$params = Get-Device -Id $device.Id | New-SensorParameters -RawType snmptraffic $params.interfacenumber__check = $params.Targets["interfacenumber__check"] | Where-Object {($_.Name -like "*Ethernet Traffic*" -OR $_.Name -like "*Ethernet? Traffic*") -AND $_.Properties -like "*Connected*"} $sensor = Get-Device -Id $device.Id | Add-Sensor $params -Resolve
PSVersion : 5.1.19041.3031 PSEdition : Desktop OS : Microsoft Windows 10 Pro PrtgAPIVersion : 0.9.18 Culture : de-AT CLRVersion : 528372 PrtgVersion : 23.3.86.1520 PrtgLanguage : english.lng
Can you please try the latest pre-release as described in #345
Yep, it's working. Thank you very much and sorry for the duplicate!
Working great in this one
Describe the bug
It seems like that there is a bug similar as described in 181. When creating sensors based on SNMP, I receive the following error message:
There are no issues while creating or deleting the device. Seems like the bug came with one of the newest PRTG updates. Details about my environment:
Steps to reproduce
What is the output of 'Get-PrtgClient -Diagnostic'?