Hi,
I'm writing here after hours of debugging, hoping someone can help me.
I'm using Proxmox VE and Zabbix 7.0. I've started using the official template, which uses Proxmox API, but it lacks some items like ZFS pools status, so I've started creating a new template (also using Proxmox API) to get that information. I've managed to get a JSON with the information I'm interested into, but I'm struggling with Discovery rule + Item Prototype.
The new template has the following:
Master Item: Get ZFS Pools

URL: https://{$PVE.URL.HOST}:{$PVE.URL.PORT}/api2/json/nodes/{$PVE.NODE}/disks/zfs
I associated this master item to a host, and it returns the following JSON:
I would like to get the name of each item with its health.
I've created a Discovery Rule + Item Prototypes as dependent items of Get ZFS Pools.
Discovery rule: ZFS Pool Discovery

With LLD Macros to discover each storage and its health

Item Prototype: ZFS Pool [{#ZFS.POOL.NAME}] health

I've checked JSON Paths using https://jsonpath.com/ and everything seems OK to me. Despite of that, I get the following error:

To me, it seems that MACROS with the pool name are not being passed correctly to the Item prototype. Zabbix logs show:
Of course, the host has only this template and has no items. I even recreated the host a few times.
I would be extremely grateful if someone could point me in the right direction.
Cheers,
Carles
I'm writing here after hours of debugging, hoping someone can help me.
I'm using Proxmox VE and Zabbix 7.0. I've started using the official template, which uses Proxmox API, but it lacks some items like ZFS pools status, so I've started creating a new template (also using Proxmox API) to get that information. I've managed to get a JSON with the information I'm interested into, but I'm struggling with Discovery rule + Item Prototype.
The new template has the following:
Master Item: Get ZFS Pools
URL: https://{$PVE.URL.HOST}:{$PVE.URL.PORT}/api2/json/nodes/{$PVE.NODE}/disks/zfs
I associated this master item to a host, and it returns the following JSON:
Code:
{
"data":[
{
"alloc":3155472384,
"health":"ONLINE",
"size":33285996544,
"free":30130524160,
"frag":10,
"dedup":1,
"name":"rpool"
},
{
"frag":0,
"dedup":1,
"free":10200104960,
"name":"vmstorage-local",
"alloc":442368,
"size":10200547328,
"health":"ONLINE"
}
]
}
I've created a Discovery Rule + Item Prototypes as dependent items of Get ZFS Pools.
Discovery rule: ZFS Pool Discovery
With LLD Macros to discover each storage and its health
Item Prototype: ZFS Pool [{#ZFS.POOL.NAME}] health
I've checked JSON Paths using https://jsonpath.com/ and everything seems OK to me. Despite of that, I get the following error:
To me, it seems that MACROS with the pool name are not being passed correctly to the Item prototype. Zabbix logs show:
Code:
82569:20240930:174725.654 In zbx_substitute_lld_macros() data:'$.data[?(@.name=="{#ZFS.POOL.NAME}")].health'
82569:20240930:174725.654 cannot substitute macro "{#ZFS.POOL.NAME}": not found in value set
82569:20240930:174725.654 End of zbx_substitute_lld_macros():SUCCEED data:'$.data[?(@.name=="{#ZFS.POOL.NAME}")].health'
I would be extremely grateful if someone could point me in the right direction.
Cheers,
Carles