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 Advanced Push Sensor (alerting based on limits)

Votes:

0

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

api prtg rest

Created on Sep 27, 2021 1:55:47 PM



6 Replies

Votes:

0

Hello Jason,

Thank you for your message.

Regarding what you would like to achieve, you can apply limits via the options below:

  • Within the data sent to PRTG (only at the sensor creation)

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:

{
    "prtg": {
        "result": [
            {
                "channel": "Value",
                "value": 20,
                "limitmode": 1,
                "LimitMaxError": 50,
                "LimitMaxWarning": 40
            },
            ...
        ]
    }
}

Note that the limits are applied only once, at the sensor creation and then will be discarded by PRTG for the next data received.

  • Via the multi-edit

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.

  • Via the API of PRTG

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.

Created on Sep 28, 2021 8:07:54 AM by  Florian Lesage [Paessler Support]

Last change on Sep 28, 2021 8:22:11 AM by  Florian Lesage [Paessler Support]



Votes:

0

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

Created on Sep 30, 2021 10:36:47 AM



Votes:

0

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.

Created on Sep 30, 2021 11:55:41 AM by  Florian Lesage [Paessler Support]



Votes:

0

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

Created on Sep 30, 2021 12:03:42 PM

Last change on Sep 30, 2021 12:24:59 PM by  Florian Lesage [Paessler Support]



Votes:

0

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

Created on Sep 30, 2021 1:10:58 PM



Votes:

0

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.

Created on Sep 30, 2021 1:24:48 PM by  Florian Lesage [Paessler Support]

Last change on Sep 30, 2021 1:25:21 PM by  Florian Lesage [Paessler Support]




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.