E
E
Evgeny N2020-11-02 09:49:02
Zabbix
Evgeny N, 2020-11-02 09:49:02

How to cut what you need in preprocessing in Zabbix?

Outdoor air temperature monitoring is set up and running through data that is taken from the site.

Thus, I get a row element with a temperature of the form:

<span class="warm txt-xxlarge"><strong>+4</strong> °С</span><br />

My preprocessing, Regular expression:
<span class="warm txt-xxlarge"><strong>[+]([0-9]+)[</strong> °С</span><br />]

/1

Zabbix gets response: 4 This is easy to handle, charting, configuring triggers. Data element information type: Positive integer number.

But there are two BUT:
The number cannot be negative, but the temperature outside can.
The string received changes to "with a minus" and everything does not work right away. For example:
<span class="warm txt-xxlarge"><strong>-7</strong> °С</span><br />

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
neol, 2020-11-02
@Evgen_N

The data type is "Numeric (floating point)" and the template can be made a little simpler.

<span class="warm txt-xxlarge"><strong>([+-0-9]+)</strong> °С</span><br /> \1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question