Zabbix_Trigger_Function介绍(zabbix3.4)

1 、 clamp

Parameters: Ignore the following parameters directly

Supported value types: float, int, str, text, log

Description: Returns the absolute value of the difference between the most recently acquired value and the previous value. For string types, 0 means the value is equal, 1 means the value is different

For example: {www.zabbix.com:vfs.fs.zise[/,free].abschange(10m)}<10, which means that the key value vfs.fs.size [/, free] in www.zabbix.com The difference between the most recent value and the previous 10 minutes is 10. The result may be that the most recent value is larger than before, or it may be smaller than the previous value, ie from -10 to 0, then from 0 to 10. A range between, can be called the jitter value or error range.

 

2、avg

Parameters: seconds or #num

Supported value types: float and int

Description: Returns the average value of the specified time interval. The time interval can be set or the number of collected values ​​by the first parameter seconds (need to add # in front, for example # 5 represents the last 5 values). If there is a second one, it means time shift, for example, to query the average value of the previous hour before one day, the corresponding function is avg (1h, 1d)

For example: {www.zabbix.com:vfs.fs.size[/,free].avg(#5,10m)}<50G, which means that in the Server device, the key value vfs.fs.size [/, free] is the most recent Within 10 minutes, the average of the last five values ​​is less than 50G. Please note that if the value update interval is 1 minute within 10 minutes, # 5 represents values ​​of 6, 7, 8, 9, and 10 minutes, and if the value update interval is 2 minutes, then # 5 represents 2, 4 , 6, 8, 10 minutes

 

3、change

Parameters: directly ignore the following parameters

Supported value types: float, int, str, text, log

Description: Returns the difference between the most recently acquired value and the previous value (note that, unlike the abschange function, it is not an absolute value). For string types, 0 means the value is equal, 1 means the value is different

For example: {www.zabbix.com:vfs.fs.size[/,free].change(5m)}<0, which means that the most recent value is smaller than the value obtained in the previous 5 minutes

 

4、count

Parameters: seconds or #num

Supported value types: float, int, str, text, log

Description: Returns the numerical statistics within the specified time interval. The time interval can be set to the time or the number of collected values ​​through the first parameter (need to add # before the value). This function can support the second parameter as the pattern data, the third parameter as the operator parameter, and the fourth parameter as the time shift parameter. For the sample, the exact match is used when the value of the monitoring item is an integer (iteger), and the allowable deviation is 0.0000001 when the value of the monitoring item is a floating point (float).

The supported types of operators are as follows

eq: equal ne: not equal gt: greater than lt: less than ge: greater than or equal to le: less than or equal to like: content matches

For integer and floating point monitoring items, support eq (default), ne, gt, ge, lt, le

For string, text, log monitoring items, support like (default), eq, ne

Examples:

count (600): the number of values ​​in the last 10 minutes

count (600,12): the number of values ​​equal to 12 in the last 10 minutes

count (600,12, "gt"): the number of values ​​greater than 12 in the last 10 minutes

count (# 10,12, "gt"): the number of values ​​with a value greater than 12 in the last 10 values

count (600,12, "gt", 86400): the number of values ​​greater than 12 in the first 10 minutes of data 24 hours ago

count (600 ,,, 86400): the number of the first 10 minutes before 24 hours

 

5、date

Parameters: Ignore the following parameters directly

Supported value types: all any

Description: Returns the current date, (format is YYYYMMDD), for example, 20150101

 

6、dayofmonth

Parameters: Ignore the following parameters directly

Supported value types: all any

Description: Returns the current day of the month (value range is 1-31)

 

7 、 dayofweek

Parameters: Ignore the following parameters directly

Supported value types: all any

Description: Returns the current day of the week (value range is 1-7)

 

8 、 pupil

Parameters: seconds or #num

Supported value types: float or int

Description: Returns the difference between the maximum and minimum values ​​within the specified time interval (max ()-min ()). Time interval as the first parameter, can be seconds or the number of collected values

For example: {www.zabbix.com:net.if.in[eth0].delta(10m)}>10M, which means that the interface eth0 of the device www.zabbix.com has been between the maximum and minimum values ​​in the last 10 minutes If the difference is greater than 10MB, the fault is considered to have occurred

 

9、diff

Parameter: Ignore

Supported value types: float, int, text, log, string

Description: The return value is 1, indicating that the most recent value is different from the previous value, and 0 is otherwise

For example: {www.zabbix.com:agent.version.diff(0)}>0, means that the latest value of agent.version of the device www.zabbix.com is different from the previous value

 

10、fuzzytime

Parameters: seconds

Supported value types: float, int

Description: The return value is 1, indicating that the timestamp of the value of the monitoring item is N seconds longer than the time of www.zabbix.com, and 0 is otherwise. Often use system.localtime to check whether the local time is the same as www.zabbix.com

 

11, iregexp

Parameters: the first is a string, the second is a second or #num

Supported value types: str, log, text

Description: Similar to regexp, the difference is not case sensitive

 

12、last

Parameters: seconds or #num

Supported value types: float, int, str, text, log

Description: The most recent value, if it is seconds, it is ignored, #num indicates the most recent Nth value. Note that the current #num and other functions #num mean different

last (0) is equivalent to last (# 1)

last (# 3) represents the third value (not the most recent three values) of the recently acquired monitoring item value. If the acquired values ​​are A, B, and C, respectively, from the chronological order Is the first value, B is the second value, # 3 is the third value C

This function also supports the second parameter time_shift, for example: last (0,86400) returns the tightest value one day ago. If there are multiple values ​​in the same second in history, zabbix does not guarantee the exact order of the values

For example: {www.zabbix.com:mysql.ping.last(#3,5m)}=0, it means that the MySQL value of the device www.zabbix.com for the third time in the last 5 minutes is 0, which means that the failure has occurred , Note that the usage of # 3 is different from other functions

13、logeventid

Parameter: string

Supported value type: log

Description: Check if the EventId of the most recent log entry matches the regular expression. The parameters are regular expressions and POSIX extended styles. When the return value is 0, it means no match, and 1 means match.

 

14、logseverity

Parameter: Ignore

Supported value type: log

Description: Returns the log severity of the most recent log entry. When the return value is 0, it indicates the default level, and N is the specific corresponding level (integer, commonly used in Windows event logs)

 

15、logsource

Parameter: string

Supported value type: log

Description: Check whether the most recent log entry matches the log source of the parameter. When the return value is 0, it means no match, and 1 means match. Usually used for Windows event logs monitoring

 

16、max

Parameters: seconds or #num

Supported value types: float or int

Description: Returns the maximum value of the specified time interval. The time interval as the first parameter can be seconds or the number of collected values ​​(prefix is ​​#). Starting from Zabbix 1.8.2, the function supports the second optional parameter time_shift.

For example: {www.zabbix.com:net.tcp.service[ftp].max(#3)}=0, indicating that the key in the device www.zabbix.com is net.tcp.service [ftp] obtained in the last three times The maximum value is 0, it is regarded as a fault

 

17. Min

Parameters: seconds or #num

Supported value types: float and int

Description: Returns the minimum value of the specified time interval. As the first parameter, the time interval can be seconds or the number of collected values ​​(prefix is ​​#). The function supports the second optional parameter time_shift

For example: {www.zabbix.com:icmppingloss.min(5m)}>20, which means that the minimum value of www.zabbix.com device obtained by icmppingloss in 5 minutes is greater than 20, that is, the fault occurs

 

18、nodata

Parameters: seconds

Supported value type: any

Description: When the return value is 1, it means that the specified interval (the interval should not be less than 30s) has not received data, and 0 means other conditions

For example: {www.zabbix.com:agent.ping.nodata(5m)}=1, it means that the agent.ping of the device www.zabbix.com has not received data in the last 5 minutes, and the failure occurred

 

19、now

Parameter: Ignore

Supported value type: any

Description: Returns the number of seconds since Epoch (00:00:00 UTC, January 1, 1970)

 

20、prev

Parameter: Ignore

Supported value types: float, int, str, log, text

Description: Returns the previous value, similar to last (# 2)

 

21、regexp

Parameters: The first parameter is string, the second parameter is seconds or #num

Supported value types: str, log, text

Description: Check if the most recent value matches the regular expression. The regular expression of the parameter is POSIX extended style. The second parameter is the number of seconds or the number of collected values. Multiple values ​​will be processed. This function is case sensitive, when the return value is 1, it means found, 0 is otherwise

 

22、str

Parameters: The first parameter is string, the second parameter is seconds or #num

Supported value types: str, log, text

Description: Find the string in the most recent value. The first parameter specifies the search string, which is case sensitive. The second optional parameter specifies the number of seconds or the number of collected values, and multiple values ​​will be processed. When the return value is 1, it means found, and 0 is otherwise

For example: {www.zabbix.com:jmx[“Catalina:type=ProtocolHandler,port=8080”,comprssin].str(off)}=1, indicating that the device www.zabbix.com obtained the string off from the key

 

23、strlen

Parameters: seconds or #num

Supported value types: str, log, text

Description: Specify the string length (not bytes) of the most recent value. The parameter value is similar to the last function. For example, strlen (0) is equivalent to strlen (# 1), strlen (# 3) represents the most recent third value, and strlen (0,86400) represents the most recent value one day ago.

 

24、sum

Parameters: seconds or #num

Supported value types: float or int

Description: Returns the sum of the values ​​collected in the specified time interval. As the first parameter, the time interval supports seconds or the number of collected values ​​(starting with #). This function supports time_shift as the second parameter.

 

25、time

Parameter: Ignore

Supported value type: any

Description: Returns the current time, the format is HHMMSS

Guess you like

Origin www.cnblogs.com/love-vce/p/12751585.html