PrtgAPI icon indicating copy to clipboard operation
PrtgAPI copied to clipboard

Missing Property for 'SNMPv3EncryptionType' and 'SNMPv3AuthType'

Open schoenm1 opened this issue 2 years ago • 1 comments

Describe the bug

Not all Values for 'SNMPv3EncryptionType' and 'SNMPv3AuthType' are available in PRTGAPi PowerShell Module.

If e.g. AES 192 is chosen in GUI, the PRTGAPI Module shown an error. image

PS C:\Users\name> $dev | Get-ObjectSetting SNMPv3EncryptionType
Get-ObjectSetting : Could not deserialize value 'AES192PrivProtocol' as it is not a valid member of type 'PrtgAPI.EncryptionType'. Could not process XML '<snmpv3encryptiontype />'.
At line:1 char:8
+ $dev | Get-ObjectSetting SNMPv3EncryptionType
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ObjectProperty], XmlDeserializationException
    + FullyQualifiedErrorId : PrtgAPI.XmlDeserializationException,PrtgAPI.PowerShell.Cmdlets.GetObjectProperty

Could it be, that this is related to changes in PRTG 'May 24th 2023 - Version 23.2.84.1566' image

Steps to reproduce

Set in GUI in SNMPv3 "Authentication Method" to 'AES-192'

Save
Go to PowerShell Module

PS C:\Users\name> $dev | Get-ObjectSetting SNMPv3EncryptionType
Get-ObjectSetting : Could not deserialize value 'AES192PrivProtocol' as it is not a valid member of type 'PrtgAPI.EncryptionType'. Could not process XML '<snmpv3encryptiontype />'.
At line:1 char:8
+ $dev | Get-ObjectSetting SNMPv3EncryptionType
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ObjectProperty], XmlDeserializationException
    + FullyQualifiedErrorId : PrtgAPI.XmlDeserializationException,PrtgAPI.PowerShell.Cmdlets.GetObjectProperty

Set in GUI in SNMPv3 "Authentication Method" to 'AES'

PS C:\Users\name> $dev | Get-ObjectSetting SNMPv3EncryptionType AES

What is the output of 'Get-PrtgClient -Diagnostic'?

PSVersion      : 5.1.19041.2673
PSEdition      : Desktop
OS             : Microsoft Windows 10 Enterprise
PrtgAPIVersion : 0.9.18
Culture        : de-CH
CLRVersion     : 528372
PrtgVersion    : 23.2.84.1566
PrtgLanguage   : english.lng

Additional context

No response

schoenm1 avatar Jul 05 '23 10:07 schoenm1

Hi :) I investigated this a little and I think it's because the Enum doesn't have the new values, that PRTG added. And because this feature was just recently added to PRTG.

The new values would need to be added here: src/PrtgAPI/Enums/Deserialization/ObjectSettings/EncryptionType.cs Currently only DES and AES are supported by prtgAPI.

noaboa97 avatar Jul 20 '23 07:07 noaboa97