Greetings,
After tinkering around with this for a while now, I'm wondering if my plan needs to be re-evaluated.
Running Zabbix 6.0.5.
[Edit: please see post #3 for current request for help]
# primary problem
I have a bunch of devices that aren't things I can put an agent on. However, I can drop a sender on them and with a simple query I can return JSON with everything I need. I can also cron the Zabbix sender to give me the values on a somewhat regular basis.
But, of course, things have to be challenging. Depending on what the device is doing it returns only relevant details. What I'd like to do is slurp in this JSON and per-host capture the metrics into items. Ideally, I'm applying the same template with all the same items/graphs/triggers to all the hosts but only seeing the relevant items on each host.
So, here's my testing code:
From the three hosts, the ONLY TWO fields that are uniform and consistent are the hostname and the version. The first has a beverage, the second has a beverage but not the same fields and a car, the third has a car and a garage_space. The only information I don't actually care about is the hostname, because that will be passed to it from the Zabbix sender and I can filter that out easily enough on either end.
What I was attempting to do was create a discovery rule then set dependent items based on what is discovered. However, once I've created the discovery item and I verify that I'm getting data into it, I can't seem to create a dependent item. When I create an item prototype, there is no drop down for dependent item.
# secondary problem
I thought maybe I'm doing this wrong. So I went over to the documentation: https://www.zabbix.com/documentation...ery-on-the-fly
Well, that is not very clear is it? I'm sure it's fine for someone who knows what they are doing but for someone trying to figure it out then it isn't so helpful. But it looks rather close to what I would like to do so let's try it.
I created a new template.
I created an item called "Get zones" with the key get.zones, set the url to http://demo.nginx.com/api/3/http/server_zones (per the documentation), and set an update interval of 1h.
Then I create a Discovery rule. Named it zones, type is dependent item, key is zones, set the master to "Get zones", click on Preprocessing and set the data per the documentation. If I run the "Test all steps", I verify that I am getting data through the javascript.
Hooray! My host with this template is now getting this get.zones data! However, I'm not getting anything else. Just the one item. Makes sense because my discovery doesn't have any items yet.
Back to the template, click on the Discovery rules, then the zones, then Item prototypes. Create item prototype. And now it doesn't matter what I put here because I'm in the exact same spot as before! There is no Dependent Item in the Type drop down!
Therefore, I'm either doing both my initial goal AND the documentation wrong - or maybe I'm trying to go about solving this problem wrong (possibly both! :-D ).
So my first question, is this a good case for LLD? Should I be trying to approach this from a different angle?
My second question is, why doesn't this work? How am I supposed to create Dependent items from the Discovery filter?
Thanks!
After tinkering around with this for a while now, I'm wondering if my plan needs to be re-evaluated.
Running Zabbix 6.0.5.
[Edit: please see post #3 for current request for help]
# primary problem
I have a bunch of devices that aren't things I can put an agent on. However, I can drop a sender on them and with a simple query I can return JSON with everything I need. I can also cron the Zabbix sender to give me the values on a somewhat regular basis.
But, of course, things have to be challenging. Depending on what the device is doing it returns only relevant details. What I'd like to do is slurp in this JSON and per-host capture the metrics into items. Ideally, I'm applying the same template with all the same items/graphs/triggers to all the hosts but only seeing the relevant items on each host.
So, here's my testing code:
Code:
{
"hostname1": {
"version": 1.0,
"beverage": {
"type": "tea",
"temp": "hot",
"total": 317
},
"received": 11
}
}
Code:
{
"hostname2": {
"version": 1.1,
"beverage": {
"type": "soda",
"temp": "cold"
},
"car": {
"make": "Mazda",
"model": "RX-7",
"generation": 1
}
}
}
Code:
{
"hostname3": {
"version": 1.2,
"car": {
"make": "Chevy",
"model": "Corvette",
"generation": 6
},
"garage_space": 1
}
}
What I was attempting to do was create a discovery rule then set dependent items based on what is discovered. However, once I've created the discovery item and I verify that I'm getting data into it, I can't seem to create a dependent item. When I create an item prototype, there is no drop down for dependent item.
# secondary problem
I thought maybe I'm doing this wrong. So I went over to the documentation: https://www.zabbix.com/documentation...ery-on-the-fly
Well, that is not very clear is it? I'm sure it's fine for someone who knows what they are doing but for someone trying to figure it out then it isn't so helpful. But it looks rather close to what I would like to do so let's try it.
I created a new template.
I created an item called "Get zones" with the key get.zones, set the url to http://demo.nginx.com/api/3/http/server_zones (per the documentation), and set an update interval of 1h.
Then I create a Discovery rule. Named it zones, type is dependent item, key is zones, set the master to "Get zones", click on Preprocessing and set the data per the documentation. If I run the "Test all steps", I verify that I am getting data through the javascript.
Hooray! My host with this template is now getting this get.zones data! However, I'm not getting anything else. Just the one item. Makes sense because my discovery doesn't have any items yet.
Back to the template, click on the Discovery rules, then the zones, then Item prototypes. Create item prototype. And now it doesn't matter what I put here because I'm in the exact same spot as before! There is no Dependent Item in the Type drop down!
Therefore, I'm either doing both my initial goal AND the documentation wrong - or maybe I'm trying to go about solving this problem wrong (possibly both! :-D ).
So my first question, is this a good case for LLD? Should I be trying to approach this from a different angle?
My second question is, why doesn't this work? How am I supposed to create Dependent items from the Discovery filter?
Thanks!
Comment