Reputation: 914
I want to monitor my pfsense's gateway in zabbix and I need your help with low-level discovery. Currently, I have a script that return me a json object like this :
{
"data":[
{"{#GATEWAY}":"WAN_SFRGW", "{{#LOSS}}":"0.0"},
{"{#GATEWAY}":"WAN_NUMERICABLE_DHCP", "{{#LOSS}}":"0.0"}
]
}
I have created discovery rules in my host setting:
I have nothing in Filters
.
Then, how can I get the information in my JSON ? I tried to create an item prototype but I can't see the result in Monitoring -> Overview
.
I want to save packets loss, associate them with an interface and made an alert if it's > X% but I don't know how do to this.
I tried some settings in item prototypes but I don't know how to debug and if it's really possible.
Regards.
Upvotes: 1
Views: 2855
Reputation: 2250
There is an error in the JSON: it should be {#LOSS}
instead of {{#LOSS}}
.
Once that is fixed, you can create an item prototype, like so:
gateway[{#GATEWAY}]
From this item prototype, the following items will be created:
gateway[WAN_SFRGW]
gateway[WAN_NUMERICABLE_DHCP]
You can also create a trigger prototype like the following:
{host:gateway[{#GATEWAY}].min(#3)} > {#LOSS}
This will create the following triggers:
{host:gateway[WAN_SFRGW].min(#3)} > 0.0
{host:gateway[WAN_NUMERICABLE_DHCP].min(#3)} > 0.0
Hopefully that describes the general idea, assuming I understood your intention correctly. Of course, you need to replace gateway[]
items with those that actually gather some data.
The process of low-level discovery is described in great detail in the official documentation at https://www.zabbix.com/documentation/2.4/manual/discovery/low_level_discovery .
Upvotes: 3