What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Manipulating SNMP credentials settings via API call

Votes:

0

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?

api snmp snmp-sensor

Created on Oct 14, 2019 3:07:02 AM



3 Replies

Votes:

0

Hi there,

Unfortunately, there is no official way to change the SNMP Credentials Parameters via the API of PRTG.

Best regards.

Created on Oct 14, 2019 8:25:15 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

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

Created on Oct 14, 2019 8:53:26 AM



Votes:

0

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

Created on Oct 15, 2019 1:40:06 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.