I am trying to set the "Additional Channels" setting via the API for SNMP Traffic Sensors. I seem to be only be able to set one value at a time (IE: errrors or discards, but not both). Is there a way to set more then one via the API?

Examples:

Sets errors https://<server>/setobjectproperty.htm?id=<objid>&name=trafficmode&value=errors&username=<user>&passhash=<hash>

Sets discards, unsets errors https://<server>/setobjectproperty.htm?id=<objid>&name=trafficmode&value=discards&username=<user>&passhash=<hash>

If I try doing value=errors,discards or value=Errors In &amp; Out<br>Discards In &amp; Out<br> none are set.

Running the latest stable version.


Article Comments

Hi there,

You can use the backend-api call of PRTG (the ones used to change the settings via the webinterface):

http(s)://<server>/editsettings?id=<SENSORID>&username=<user>&passhash=<hash>&trafficmode_=standinfornoselection&trafficmode_=errors&trafficmode_=discards&trafficmode_=unicast&trafficmode_=nonunicast&trafficmode_=multicast&trafficmode_=broadcast&trafficmode_=unknown

The above call will enable all Additional Channels. To just activate two, delete the other channels from the call (delete "trafficmode_=errors" for example).

Best regards.


Aug, 2018 - Permalink

That did the trick. It would be great if this could be done as regular API call (feature request), so that the return can be easily parsed to know if the call was good or not rather then getting the full html page for the object (sensor in this case).


Aug, 2018 - Permalink