I have a Discovery process that uses a script to discover clusters and it returns all the clusters that are available, then creates them as new Host Prototypes.
Under that Host, I have a discovery rule that discovers all the nodes of the cluster and adds them as item prototypes because I'd prefer them to be part of the cluster host instead of their own host prototype.
Herein lies the rub. I want to monitor the health of the individual hard drives inside of the nodes. I can run a discover script that will return an appropriate JSON with a list of all the hard drives that are discovered, but I need item prototypes for each drive so I can report on the individual health and wellness of each. What I end up with is a structure that would look like this:
Discovered Cluster
-- Discovered Node
-- -- Discovered Disk
-- -- -- Disk Item 1
-- -- -- Disk Item 2
I don't want to break Nodes out into their own hosts, which would let me discover the disks. But my discovery script for the disk item requires the NodeID in order discover the disks. I can't send the discovered nodes {#NODEID} because zabbix wouldn't know which one to attach, it isn't like {#HOST} where there is only one per host.
Is there another way to have the discovery script receive a Macro in that way, where I could discover all those sub items without needing break them out?
What about discovering the disks at the same time I discover the node, so it reports:
{"data":[
{"{#NODEID}":"node1","{#DISK1}":"disk1","{#DISK2}" :"disk2"},
{"{#NODEID}":"node2","{#DISK1}":"disk1","{#DISK2}" :"disk2"}]
}
But the issue is there is a variable number of disks. Some nodes will have 4, some will have 2, some will have 7... so when I create the item prototypes I'd need some way of iterating until I get them all.
Any suggestions?
EDIT:
Apologies, adding version information. I'm running 3.4 across the board on CentOS7
Under that Host, I have a discovery rule that discovers all the nodes of the cluster and adds them as item prototypes because I'd prefer them to be part of the cluster host instead of their own host prototype.
Herein lies the rub. I want to monitor the health of the individual hard drives inside of the nodes. I can run a discover script that will return an appropriate JSON with a list of all the hard drives that are discovered, but I need item prototypes for each drive so I can report on the individual health and wellness of each. What I end up with is a structure that would look like this:
Discovered Cluster
-- Discovered Node
-- -- Discovered Disk
-- -- -- Disk Item 1
-- -- -- Disk Item 2
I don't want to break Nodes out into their own hosts, which would let me discover the disks. But my discovery script for the disk item requires the NodeID in order discover the disks. I can't send the discovered nodes {#NODEID} because zabbix wouldn't know which one to attach, it isn't like {#HOST} where there is only one per host.
Is there another way to have the discovery script receive a Macro in that way, where I could discover all those sub items without needing break them out?
What about discovering the disks at the same time I discover the node, so it reports:
{"data":[
{"{#NODEID}":"node1","{#DISK1}":"disk1","{#DISK2}" :"disk2"},
{"{#NODEID}":"node2","{#DISK1}":"disk1","{#DISK2}" :"disk2"}]
}
But the issue is there is a variable number of disks. Some nodes will have 4, some will have 2, some will have 7... so when I create the item prototypes I'd need some way of iterating until I get them all.
Any suggestions?
EDIT:
Apologies, adding version information. I'm running 3.4 across the board on CentOS7
Comment