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

PRTG API - Get all sensors and their config values ?

Votes:

0

I would like to export all snmp sensors with their snmp config values aka snmp version, community ... Can PRTG API help ?

api configuration snmp

Created on Feb 28, 2019 10:19:04 AM



Best Answer

Accepted Answer

Votes:

3

Hi Lubomir,

You can easily do this with PrtgAPI

The SNMP settings you've specified are typically defined on devices; you can view all SNMP properties of a device using the Get-ObjectProperty cmdlet

C:\> Get-Device -Id 1001 | Get-ObjectProperty | select *snmp*

InheritSNMPCredentials   : False
SNMPVersion              : v3
SNMPCommunityStringV1    : public
SNMPCommunityStringV2    : public
SNMPv3AuthType           : SHA
SNMPv3UserName           : SNMP_v3
HasSNMPv3Password        : True
SNMPv3EncryptionType     : AES
HasSNMPv3EncryptionKey   : True
...

As PrtgAPI doesn't contain intimate knowledge of all sensor types, if you want to get the SNMP specific settings of a sensor (such as its OID), you can retrieve this information by specifying Get-ObjectProperty -Raw

Regards,

lordmilko

Created on Mar 1, 2019 10:36:56 AM



3 Replies

Votes:

0

Hello Lubomir,

Thank you very much for your contact.

The PRTG API won't provide you with the requested information, because information such as the SNMP version, community string etc. are stored within the "Settings" tab of a device or inherited by an parent object such as a Group or Probe.

You can try how far you come by exporting a hierarchical list of all groups, devices and sensors using the following API call: /api/table.xml?content=sensortree Afterwards, export the object IDs of your probes, groups and devices and use them to create configuration reports applying the IDs in the URL: https:/your-prtg-server/config_report_object.htm?id=%id_of_the_object% Please note that the community string will be obliterated.

Best regards,
Sebastian

Created on Mar 1, 2019 6:56:37 AM by  Sebastian Kniege [Paessler Support]



Accepted Answer

Votes:

3

Hi Lubomir,

You can easily do this with PrtgAPI

The SNMP settings you've specified are typically defined on devices; you can view all SNMP properties of a device using the Get-ObjectProperty cmdlet

C:\> Get-Device -Id 1001 | Get-ObjectProperty | select *snmp*

InheritSNMPCredentials   : False
SNMPVersion              : v3
SNMPCommunityStringV1    : public
SNMPCommunityStringV2    : public
SNMPv3AuthType           : SHA
SNMPv3UserName           : SNMP_v3
HasSNMPv3Password        : True
SNMPv3EncryptionType     : AES
HasSNMPv3EncryptionKey   : True
...

As PrtgAPI doesn't contain intimate knowledge of all sensor types, if you want to get the SNMP specific settings of a sensor (such as its OID), you can retrieve this information by specifying Get-ObjectProperty -Raw

Regards,

lordmilko

Created on Mar 1, 2019 10:36:56 AM



Votes:

0

Hi lordmilko. Great !

I already made PrtgAPI ready on our system and tried some exports via this great powershell module. The point was the correct syntax :-)

Have a nice day.

Created on Mar 1, 2019 11:46:14 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.