Available functions Flashcards

1
Q

abschange

A

Returns absolute difference between last and previous values.
For strings:
0 - values are equal
1 - values differ

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

avg

A

The average value of a period. The period is set in seconds or as a number of collected values (preceded by a # hash mark, for example, #5 - five latest values) in the first parameter.
The function accepts a second, optional parameter time_shift. It is useful when there is a need to compare the current average value with the average value time_shift seconds back. For instance, avg(3600,86400) will return the average value for an hour one day ago.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

change

A

Returns difference between last and previous values.
For strings:
0 - values are equal
1 - values differ

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

count (sec or #num)

A

The number of collected values in a period. The period is set in seconds or as a number of values (preceded by a # hash mark) in the first parameter.
The function accepts a second optional pattern parameter, a third operator parameter, and a fourth time_shift parameter.
For pattern: integer items - exact match; float items - match within 0.000001
Supported operators *:
eq - equal
(as for test bash)
like - matches if contains pattern.
*For integer and float items: operators eq (default), ne, gt, ge, lt, le are supported.
*For string, text and log items: operators like (default), eq, ne are supported.
Examples:
count(600) - the number of values for last 10 minutes
count(600,12) - the number of values for last 10 minutes that equal ‘12’
count(600,12,”gt”) - the number of values for last 10 minutes that are over ‘12’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

date

A

Returns current date in YYYYMMDD format.

For example: 20031025

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

dayofmonth

A

Returns day of month in range of 1 to 31.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

dayofweek

A

Returns day of week in range of 1 to 7. Mon - 1, Sun - 7.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

delta

A

Returns the difference between the maximum and minimum values in a period (‘max()’ minus ‘min()’). The period is set in seconds or as a number of collected values (preceded by a # hash mark) in the first parameter.
Since Zabbix 1.8.2, the function supports a second, optional parameter time_shift. See function avg() for an example of its use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

diff

A

Returns:
1 - last and previous values differ
0 - otherwise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

fuzzytime

A

Returns 1 if timestamp (item value) does not differ from Zabbix server time for more than N seconds, 0 - otherwise.
Usually used with system.localtime to check that local time is in sync with local time of Zabbix server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

iregexp (1st - string, 2nd - sec or #num)

A

This function is non case-sensitive analogue of regexp.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

last (sec or #num)

A

Last (most recent) value. Parameter:
sec - ignored
#num - Nth most recent value
Take note that #num, as can be expected, works differently here than with many other functions.
For example,
last(0) is always equal to last(#1)
last(#3) - third most recent value (not three latest values)
The function also supports a second optional time_shift parameter. For example,
last(0,86400) will return the most recent value one day ago.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

logeventid (string)

A

Check if Event ID of the last log entry matches a regular expression. Parameter defines the regular expression, POSIX extended style.
Returns:
0 - does not match
1 - matches

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

logseverity

A

Returns log severity of the last log entry. Parameter is ignored.
0 - default severity
N - severity (integer, useful for Windows event logs: 1 - Information, 2 - Warning, 4 - Error, 7 - Failure Audit, 8 - Success Audit). Zabbix takes log severity from field Information of Windows event log.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

logsource (string)

A

Check if log source of the last log entry matches parameter.
0 - does not match
1 - matches
Normally used for Windows event logs. For example, logsource(“VMware Server”).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

min (sec or #num)

A
The minimum (lowest) value of a period. The period is set in seconds or as a number of collected values (preceded by a # hash mark) in the first parameter.
Since Zabbix 1.8.2, the function supports a second, optional parameter time_shift. See function avg for an example of its use.
17
Q

nodata (sec)

A

Returns:
1 - if no data received during period of time in seconds. The period should not be less than 30 seconds.
0 - otherwise

18
Q

now

A

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

19
Q

prev

A

Returns previous value. Parameter is ignored.

Same as last(#2)

20
Q

regexp (1st - string, 2nd - sec or #num)

A

Check if last (most recent) value matches regular expression. Parameter defines regular expression, POSIX extended style.
Second optional parameter is number of seconds or number of collected values to analyse. In this case more than one value will be processed.
This function is case-sensitive.
Returns:
1 - found
0 - otherwise

21
Q

str (1st - string, 2nd - sec or #num)

A

Find string in last (most recent) value. Parameter defines string to find. Case sensitive!
Second optional parameter is number of seconds or number of collected values to analyse. In this case more than one value will be processed.
Returns:
1 - found
0 - otherwise

22
Q

strlen (sec or #num)

A

Length of the last (most recent) value in characters (not bytes).
Parameters work the same as with ‘last’ function (see above in the table).
For example,
strlen(0) is equal to strlen(#1)
strlen(#3) - length of the third most recent value
strlen(0,86400) - length of the most recent value one day ago.

23
Q

sum (sec or #num)

A

The sum of collected values in a period. The period is set in seconds or as a number of values (preceded by a # hash mark) in the first parameter.

24
Q

time

A

Returns current time in HHMMSS format. Example: 123055