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

No luck trying to change OID of SNMPCustomSensor thru API

Votes:

0

I'm trying to change the OID's of a SNMPCustomSensor by using the API setobjectproperty method. PRTG returns OK, but the value hasn't changed.

Probably I'm not using not the correct subid=channelid &name=property_name. At least none of the combo's I've tried seem to work. What do I miss here?

In de example it is: Sensor Channel #2 OID I try to change.

According to html that is channel2oid_ (with or without _ ?):

<input class="text valid" data-rule-oid="true" data-rule-required="true" type="text" name="channel2oid_" id="channel2oid_" autocomplete="off" value="1.3.6.1.4.1.2011.6.139.13.3.3.1.40.0" aria-required="true" aria-invalid="false">

According to prtg edit channel it is: Name: Memory Usage ID: 3

So I tried (without luck) the ChannelID : Property_Name Combo's:

2 : channel2oid

https://myurl/api/setobjectproperty.htm?id=17548&subid=2&subtype=channel&name=channel2oid&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

2 : channel2oid_

https://myurl/api/setobjectproperty.htm?id=17548&subid=2&subtype=channel&name=channel2oid_&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

3 : channel2oid

https://myurl/api/setobjectproperty.htm?id=17548&subid=3&subtype=channel&name=channel2oid&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

3 : channel2oid_

https://myurl/api/setobjectproperty.htm?id=17548&subid=3&subtype=channel&name=channel2oid_&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

channel2oid_ : channel2oid_

https://myurl/api/setobjectproperty.htm?id=17548&subid=channel2oid_&subtype=channel&name=channel2oid_&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

channel2oid : channel2oid

https://myurl/api/setobjectproperty.htm?id=17548&subid=channel2oid&subtype=channel&name=channel2oid&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

channel2oid_ : channel2oid

https://myurl/api/setobjectproperty.htm?id=17548&subid=channel2oid_&subtype=channel&name=channel2oid&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

channel2oid : channel2oid_

https://myurl/api/setobjectproperty.htm?id=17548&subid=channel2oid&subtype=channel&name=channel2oid_&value=1.3.6.1.4.1.2011.6.139.13.3.3.1.40.252.227.60.177.214.96

Anyone?

Thanks in advance!

api channeltry setobjectproperty snmpcustomsensor

Created on Jan 18, 2017 6:18:32 PM

Last change on Jan 19, 2017 11:01:04 AM by  Luciano Lingnau [Paessler]



1 Reply

Accepted Answer

Votes:

0

Hello, thank you for your post.

Please keep in mind that the OID is a setting from the sensor, so you need to change the sensor, not the channel. Within the settings of an "SNMP Custom" sensor, you will locate the following when inspecting the OID Value input field:

<input class="text valid" data-rule-oid="true" data-rule-required="true" type="text" name="oid_" id="oid_" autocomplete="off" value="1.3.6.1.2.1.1.3.0" aria-required="true" aria-invalid="false">

It tells us that oid if the setting that we're looking to change. In this case, the URL to change sensor with ID 23371 to use the OID "1.3.6.1.2.1.1.5.0" instead is:

/api/setobjectproperty.htm?id=23371&name=oid&value=1.3.6.1.2.1.1.5.0

If you were referring to the SNMP Custom Advanced, then the names of the input fields change a bit. They range from channel1oid to channel10oid. Example to change one of the OID's, for instance channel1oid to "1.3.6.1.2.1.1.5.0":

/api/setobjectproperty.htm?id=23372&name=channel1oid&value=1.3.6.1.2.1.1.5.0

It's also possible to change the name of the "channel name" setting (Sensor setting). For that, you may reference the property channel1name_ and so on..


Best Regards,
Luciano Lingnau [Paessler Support]

Created on Jan 19, 2017 11:06:12 AM by  Luciano Lingnau [Paessler]

Last change on Jan 19, 2017 11:12:01 AM by  Luciano Lingnau [Paessler]




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.