Hello,
I am currently using your advanced push sensor to push requests to our prtg platform and i was wondering if there was a way of setting all alerting limits within that sensor at once so i dont have to go tough each subsensor to do it.
If I have not explained this correctly please let me know.
Kind Regards, Jason
Article Comments
Hello,
Thank you for providing us with that information but is there a way of getting the child id of the advanced push sensory via the api.
I have a main sensor of sensor.htm?id=129368&tabid=1 i just want all of the chanel id's then i think what i need to do would be done.
Kind Regards, Jason
Sep, 2021 - Permalink
Hello Jason,
I'm not quite sure to understand what you would like exactly ? Are you referring to get the channel IDs via the API ?
If so, then you need to execute the following request:
https://PRTGSERVER/api/table.json?content=channels&columns=objid,name,lastvalue&noraw=1&count=*&showhide=1&id=SENSORID&username=PRTGUSER&passhash=PASSHASH
If it's not what you are looking for, please provide me further details so I can better help you here.
Regards.
Sep, 2021 - Permalink
Hello,
I can confirm that is what I am thanks but I am still having some issues.
From the looks of it when i do the following it does not seem to change "Enable alerting based on lookups" to "Enable alerting based on limits" within prtg itself
#/bin/bash #Variables prtgsensorid="" # Get Channel ID and update limit for n in $(curl --silent "https://prtg/api/table.xml?content=channels&id=$prtgsensorid&columns=objid&username=&passhash=" | grep "<objid>" | grep -Eo '[0-9]{1,4}') do echo " $n" curl --silent "https://prtg/api/setobjectproperty.htm?id=$prtgsensorid&subtype=channel&subid=$n&name=limitminerror&value=1&username=&passhash=" done
Can you confirm what i have missed please?
Kind Regards, Jason
Sep, 2021 - Permalink
Hello,
I can confirm i have now managed to get this working with a bit of trial and play.
One last thing i am after is there a way to get the device id from a device name?
Kind Regards Jason
Sep, 2021 - Permalink
Thank you for the update.
Regarding your question, you can use the following API call which will filter the result based on the device name:
/api/table.xml?content=devices&output=xml&columns=objid,device&count=*&noraw=1&filter_name=@sub(NAME)
Kind regards.
Sep, 2021 - Permalink
Hello Jason,
Thank you for your message.
Regarding what you would like to achieve, you can apply limits via the options below:
In the data sent to the HTTP Push Data Advanced sensor, you have the possibility to define limits by using the following elements (documented there: Custom sensors) :
- limitmode
- limitmaxerror
- limitmaxwarning
- limitminwarning
- limitminerror
Here is an example of response which includes the configuration of the limits:
Note that the limits are applied only once, at the sensor creation and then will be discarded by PRTG for the next data received.
If you have many HTTP Push sensors with the same channels, you can also use the multi-edit feature to apply limits for each of them at once. To do so, go to Sensors > By Type > H.. > HTTP Push Data Advanced then select the sensors you desire to modify and open the Settings menu on the right.
You can also use the API of PRTG via the PowerShell module PRTGAPI to modify all sensor(s) channels limits. Here is the GitHub page of the module as well as its documentation:
https://github.com/lordmilko/PrtgAPI
https://github.com/lordmilko/PrtgAPI/wiki
If you have questions, let me know.
Kind regards.
Sep, 2021 - Permalink