Zabbix trigger str/strlen/timeleft usage example

Source: Internet
Author: User
Tags strlen

I. str

(Pattern, <sec | # num>)
Found in the latest (recent) value string.
Pattern: required string
<Sec | # num> values collected in seconds or the latest (starting with a well number) during the evaluation period ). In this case, more than one value can be processed. Supported: str, text, and log. If 1 is returned, it is found. If 0 is another condition.

Example:

{Www.linuxea.com: agent. version. str ("beta8")} = 1
If the current zabbix agent version contains beta8 (assuming the current version is 1.0beta8), this expression returns true.

{Www.zabbix.com: jmx ["Catalina: type = ProtocolHandler, port = 8080", comprssin]. str (off)} = 1
Indicates that the device www.zabbix.com has obtained the string off from the key.

{JMX Templates: jmx ["java. lang: type = Runtime", VmName]. str (Server **) **} <> 1
Runs suboptimal VM type
{JMX Templates: jmx ["java. lang: type = Compilation", Name]. str (Client)} = 1
Uses suboptimal JIT compiler

II. strlen

The length of the latest (recent) value of a character (rather than a byte. Supports str, text, and log
(Sec | # num, <time_shift>): Second (ignored) or # NUM-nth most recent value
Strlen and last are similar


Example:

{Www.linuxea.com. htpNUM. strlen (#3)} = 2
If the length of the third new value is 2
{Www.linuxea.com. htpNUM. strlen ()} = 2
Triggered when the obtained value is equal to 2.
{Www.linuxea.com. htpNUM. strlen (, 1d)} = 2
The current value obtained and the current value one day ago are triggered if it is equal to 2
You can also enter {www.linuxea.com. htpNUM. strlen (#1, 1d)} = 2

III. sum

(Sec | # num, <time_shift>) second or num, supporting str, log, text
Returns the sum of the values collected during the specified interval. The interval is used as the first parameter and supports the number of seconds or collected values (starting ). This function supports time_shift as the second parameter.

IV. timeleft

To reach the specified threshold at a specific time.
(Sec | # num, <time_shift>, threshold, <fit>
Sec or # num: Second or # NUM-seconds during evaluation or the specified newest value collected (starting with a hash mark). Optional, floating, INT
Timeleft means how long it takes to reach the threshold
Timeleft indicates how long the threshold can be reached

Reference: https://www.zabbix.com/documentation/3.4/manual/config/triggers/prediction

& RArr; timeleft (#10, 0) & rarr; the most recent value is 0.
& RArr; timeleft (1 h, 100) & rarr; data volume in the last hour reached 100
& RArr; timeleft (1 h, 1d, 0) & rarr; the value of the hour before the last day is 0

{Host: vfs. fs. size [/, free]. timeleft (1 h, 0)} <1 h
If the value of the last hour is less than the value of the next hour

{Host: vfs. fs. size [/, free]. timeleft (1 h, 0)} <1 h and {host: vfs. fs. size [/, free]. timeleft (1 h, 0)} <>-1
If the value of the last hour is less than the value of the next hour or there are other problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.