Hi,
Is it possible to change SNMP credentials settings in a device sensor such as community name, user name, password, SNMP version, authentication, encryption, IP address and etc. using API call?
Article Comments
Hi yychai97,
You can do this fairly easily via PowerShell using PrtgAPI
By using the Get-ObjectProperty cmdlet you can see many of the SNMP properties that are supported
C:\> Get-Device -count 1 | Get-ObjectProperty | select *snmp* InheritSNMPCredentials : True SNMPVersion : v2c SNMPCommunityStringV1 : public SNMPCommunityStringV2 : public SNMPv3AuthType : MD5 SNMPv3UserName : HasSNMPv3Password : False SNMPv3EncryptionType : DES HasSNMPv3EncryptionKey : False SNMPv3Context : SNMPPort : 161 SNMPTimeout : 5 InheritSNMPCompatibility : True SNMPDelay : 0 SNMPRetryMode : Retry SNMPOverflowMode : Handle SNMPZeroValueMode : Ignore SNMPCounterMode : Use64BitIfAvailable SNMPRequestMode : MultiGet SNMPPortNameTemplate : ([port]) [ifalias] SNMPPortNameUpdateMode : Manual SNMPPortIdMode : Automatic SNMPInterfaceStartIndex : 0 SNMPInterfaceEndIndex : 0
you can then modify these as desired using the Set-ObjectProperty cmdlet
Get-Device -Id 1234 | Set-ObjectProperty -SNMPCommunityStringV2 test -SNMPPort 162
Regards,
lordmilko
Oct, 2019 - Permalink
Hi lordmilko,
Thank you for your suggestion.
That might add complexity to my Python script.
I tried PrtgApi before and it is difficult for me to use it.
Somehow I figure it out later.
Thank you
Oct, 2019 - Permalink
Hi there,
Unfortunately, there is no official way to change the SNMP Credentials Parameters via the API of PRTG.
Best regards.
Oct, 2019 - Permalink