Hello! I'm back with more LLD questions. I'm quite close to getting this worked out, but I can't quite get the final step. I have an item in a custom Zabbix which pulls JSON data from a monitored server. This is done using a custom UserParameter statement, which calls the local application with the correct flags. It then gets pre-processed by JS to remove the first line. The returned data at the item level is formatted like this:
The returned values are variable, so not every server's response will contain the same domains to check for. To solve this issue, I'm attempting to have Zabbix use discovery rules with LLD macros and item prototypes to dynamically create the items. My issue is, I can't seem to quote get the LLD macro correct.
Discovery Rule
Name: Discover Endpoints
Type: Dependent Item
Key: azcmagent.check.connectivity
Master Item: [Template] Azure Arc Check (JSON/Master)
LLD Macro: {#ENDPOINT} -> $.[*]
Item Prototype (I've tried variations on the JSON path here)
Name: {#ENDPOINT}: TLS Version
Type: Dependent Item
key: azcmagent.check.connectivity.tlsversion[{#ENDPOINT}]
Type of Info: Text
Master Item: [Template] Azure Arc Check (JSON/Master)
Processing: JSONPath -> $.[{#ENDPOINT}].tls

If I manually set the macro value in the prototype to "https://agentserviceapi.guestconfiguration.azure.com" for example, I get the correct value of "TLS 1.3". However, if I just leave the item prototype as is, it doesn't process anything. Which makes me think something is wrong with the LLD macro
I've been writing the JSON parsers in JQ and then fiddling with it once I get to Zabbix. What I'm using the capture the "LLD" part in JQ is:
It doesn't work in Zabbix. I also tried $.[*] as the LLD macro, which also didn't work. Any ideas what I'm doing wrong?
Edit: Bad OpSec...
Code:
{
"https://agentserviceapi.guestconfiguration.azure.com": {
"hostname": "agentserviceapi.guestconfiguration.azure.com",
"ipAddresses": [
"20.125.173.160"
],
"private": "false",
"reachable": true,
"proxyStatus": "not used",
"tls": "TLS 1.3",
"legacy": false,
"useCase": "core",
"error": "",
"requiredForPrivateLinkScope": true,
"privateLinkScopeWarnings": null,
"privateLinkScopeErrors": null
},
"https://centralus-gas.guestconfiguration.azure.com": {
"hostname": "centralus-gas.guestconfiguration.azure.com",
"ipAddresses": [
"172.202.65.10",
"172.202.64.10",
"2603:1030:13:200::10",
"2603:1030:13:201::10"
],
"private": "false",
"reachable": true,
"proxyStatus": "not used",
"tls": "TLS 1.3",
"legacy": false,
"useCase": "core",
"error": "",
"requiredForPrivateLinkScope": true,
"privateLinkScopeWarnings": null,
"privateLinkScopeErrors": null
}
}
Discovery Rule
Name: Discover Endpoints
Type: Dependent Item
Key: azcmagent.check.connectivity
Master Item: [Template] Azure Arc Check (JSON/Master)
LLD Macro: {#ENDPOINT} -> $.[*]
Item Prototype (I've tried variations on the JSON path here)
Name: {#ENDPOINT}: TLS Version
Type: Dependent Item
key: azcmagent.check.connectivity.tlsversion[{#ENDPOINT}]
Type of Info: Text
Master Item: [Template] Azure Arc Check (JSON/Master)
Processing: JSONPath -> $.[{#ENDPOINT}].tls
If I manually set the macro value in the prototype to "https://agentserviceapi.guestconfiguration.azure.com" for example, I get the correct value of "TLS 1.3". However, if I just leave the item prototype as is, it doesn't process anything. Which makes me think something is wrong with the LLD macro
I've been writing the JSON parsers in JQ and then fiddling with it once I get to Zabbix. What I'm using the capture the "LLD" part in JQ is:
- jq 'keys[]' response.json
- jq keys | .[]' response.json
It doesn't work in Zabbix. I also tried $.[*] as the LLD macro, which also didn't work. Any ideas what I'm doing wrong?
Edit: Bad OpSec...
getting discoveries working, thats my issue..
Comment