9 Upgrade notes for 2.4.1

Bug in converting triggers and calculated items to the new syntax

The database upgrade patches in 2.4.0 automatically converted the existing triggers and calculated items to the new syntax.

However, these patches had a bug, namely replacing “#” in low-level discovery macros with “<>”. Thus, {#MACRO} would be replaced with {<>MACRO}.

This only affected macros which were an independent part of the expression, not part of the key. For instance, the expession {host:snmp.oid[{#SNMPINDEX}].last()} # {#SNMPVALUE} would be transformed into {host:snmp.oid[{#SNMPINDEX}].last()} <> {<>SNMPVALUE}.

In 2.4.1, the database upgrade patches have been fixed, so an upgrade from 2.2 to 2.4.1 should now work fine. However, they do not fix expressions that have already been broken by the upgrade from 2.2 to 2.4.0.

If you wish to fix these broken expressions, you can start by finding which expressions were affected by using the following queries:

select triggerid, expression from triggers where expression like '%{<>%';
select itemid, key_, params from items where type=15 and params like '%{<>%';

You should then replace “{<>” in these expressions with “{#”.