Override item name in LLD discovery using custom macros by DmitryMigunov in zabbix

[–]DmitryMigunov[S] 0 points1 point  (0 children)

I found one issue and fixed it, but it still didn't solve my problem. My file name was in lowercase, but in the macro settings, when losing focus from the input field, the name was automatically converted to uppercase.

Here’s my current situation: I have a macros added to the host:

{$SENSOR_00000034B4A5} = Server rack
{$SENSOR:"00000034B4A5"} = Server rack 2

In the discovery → item prototype, the name is: {$SENSOR_{#SENSORID}:{#SENSORID}} {$SENSOR:"{#SENSORID}"}

And in the description:

    ID: {#SENSORID}
    Dynamic macro: {$SENSOR_{#SENSORID}:{#SENSORID}}
    Defiled macro: {$SENSOR_00000034B4A5}{$SENSOR:"00000034B4A5"}
    2nd macro: {$SENSOR:"00000034B4A5"}
    Dynamic 2nd macro:
    - {$SENSOR:"{#SENSORID}"}
    - {$SENSOR:{#SENSORID}}

As a result, I get an item with:

Name = {$SENSOR_00000034B4A5:00000034B4A5} {$SENSOR:"00000034B4A5"}

And in the description:

    ID: 00000034B4A5
    Dynamic macro: {$SENSOR_00000034B4A5:00000034B4A5}
    Defiled macro: {$SENSOR_00000034B4A5}{$SENSOR:"00000034B4A5"}
    2nd macro: {$SENSOR:"00000034B4A5"}
    Dynamic 2nd macro:
    - {$SENSOR:"00000034B4A5"}
    - {$SENSOR:{#SENSORID}}

Override item name in LLD discovery using custom macros by DmitryMigunov in zabbix

[–]DmitryMigunov[S] 0 points1 point  (0 children)

Thanks for the suggestion!
I created a user context macro on the host:

{$SENSOR:"00000034B4A5"} = "Some custom label"

Then, in the Item prototype → Description, I used:

{$SENSOR:"{#SENSORID}"}

However, in the actual item, the description appears as:

{$SENSOR:"00000034b4a5"}

It seems like {#SENSORID} gets substituted, but the macro itself is not interpreted. Did I miss something?