Using variables inside of Zabbix queries

I am sure this is just because I am noob, but i cannot figure this out:

I am trying to set up a dashboard based on Zabbix data populated from a Proxmox Cluster.

The Proxmox template is not creating individual hosts for each node but rather represent them inside the data structure.

So I cannot reference a node directly as a host but inside of the item names. So when I want to show the uptime of some element coming from the proxmox node, it looks like this:
Node [<node-name>/<VM-name>]: Uptime, so I am having like 50 uptime entries for each node and VM inside those nodes.

My issue is, that apparently I cannot reference a variable as part of the item, only just the whole item. So i can do $node , but cannot do Node [$node]: Uptime.

The Zabbix data source does not seem to have a code query editor where I could maybe add this.

So what am I missing here to set up those queries properly?

Helo @molnarti
try in Item this… you will need to escape your regex using \.

Node \[$node\]: Uptime

the $node variable will be the Server variable that you defined in the print variable you sent.

doesnt seem to work unfortunately…

also judging from the color of the text the variable embedded into the string is not recognized

image

when we use regex, we need to pass the / at the beginning and at the end,

/Node [$node]: Uptime/

try without using tag too.

turns out i was just stupid and used forward slash / instead of back slash \ as you suggested. so its working now, thanks a lot !!!

1 Like