I want to monitor a value in the HTML of a web page.

Depending on the returned values the sensor should show different states and different sensor messages.

The values on the web page I want to monitor are in a similar format that you would use for the HTTP Content sensor:

[integer][string]

The HTTP Content sensor can only monitor integers, not strings.

How can I achieve my goal?


Article Comments

This article applies to PRTG Network Monitor 12 or later

Monitoring Strings in the HTML of Web Pages

In order to process the HTML of web pages to receive sensor states corresponding to the returned values in the format [value][string], you can use a custom sensor with a script file. Create a powershell script for this issue and add it to an EXE/Script Advanced Sensor in PRTG.

For more details and a basic script, please refer to the following article: Monitor 1 value, on error send 2nd value.


Feb, 2013 - Permalink

Is this still the best way to achieve this? Can we not add the string you are looking for using advanced http sensor or other http sensors? Seems a bit old school to have to write a script to achieve it when you have so many http sensor templates


Mar, 2022 - Permalink

Hello Anthony,

This post is indeed quite old (2013), you indeed have the possibility to search for a specific string by using the HTTP Advanced sensor whose manual is available there: https://www.paessler.com/manuals/prtg/http_advanced_sensor.

The latter gets the source code and look for the string there. Afterwards, depending on your configuration and the result, the sensor will go in warning/error state and trigger an alert accordingly.

Please, note that you might not be able to monitor a specific string from a website whose content is added dynamically via JavaScript for example.

Regards.


Mar, 2022 - Permalink