Bug when obtaining the item's previous value to use in messages using "
{?last(//{ITEM.KEY},#2)}
, when the item is of type "External check", and arguments are passed to the script.
For example:
script["{HOST.CONN}","{$SNMP_COMMUNITY}"]
The information arrives as: "UNKNOWN".
Also, in Zabbix 6.x the previous value of the items goes in the message without pre-processing.
For example:
Value processed: 5.77 Gbps
Value obtained with "{?last(//{ITEM.KEY},#2)}": 5766602784
In Zabbix 5.x both cases worked normally with "{{HOST.CONN}:{ITEM.KEY}.last(#2)}", seems to be a bug from version 6.x onwards.
Screenshot 1 we have the item of type "External check" passing arguments in the script (trigger1.png).
Screenshot 2 we have the "External check" item without passing arguments (trigger2.png).
Screenshot 3 shows an example of a traffic item where the previous value was not processed when sending the alert (trigger3.png).
Message templates:
1 Problem
Problem ❌
Start in:
Problem:
{EVENT.NAME}Host: {HOST.NAME}
Item: {ITEM.NAME}
Host IP: {HOST.CONN}
Severity: {EVENT.SEVERITY}
Previous Status: {?last(//{ITEM.KEY},#2)}
Current Status: {EVENT.OPDATA}
Item ID: {ITEM.ID}
Action: Check device.❌
2 Problem recovery
Problem recovery ✅
Recovery in: {EVENT.RECOVERY.TIME} from {EVENT.RECOVERY.DATE}
Problem: {EVENT.NAME}
Duration:
{EVENT.DURATION}Host:
{HOST.NAME}Host IP:
{HOST.CONN}Severity:
{EVENT.SEVERITY}Previous Status: {?last(//{ITEM.KEY},#2)}
Current Status:
Item ID:
{ITEM.ID}Action: The problem was solved ✅.