Hello,
I am creating a Zabbix template to monitor a commercial software package.
I am using a lot of Low-Level Discovery (LLD) and it works.
However, some of the preprocessing rules seem redundant, so I am wondering if I am perhaps not using the most effective/efficient way of monitoring.
The application is connected to cameras. For each camera, I would like to monitor the processing lag, and also run some checks on the camera itself. This seems to me to mean a discovery rule with an item prototype and a host prototype.
On the system with the zabbix-agent, I've created a script that produces the output for Zabbix to consume, /usr/local/bin/zabbixscripts/cameras.sh. It produces output like this:
This is how I configure this in Zabbix:
Questions:
I am creating a Zabbix template to monitor a commercial software package.
I am using a lot of Low-Level Discovery (LLD) and it works.
However, some of the preprocessing rules seem redundant, so I am wondering if I am perhaps not using the most effective/efficient way of monitoring.
The application is connected to cameras. For each camera, I would like to monitor the processing lag, and also run some checks on the camera itself. This seems to me to mean a discovery rule with an item prototype and a host prototype.
On the system with the zabbix-agent, I've created a script that produces the output for Zabbix to consume, /usr/local/bin/zabbixscripts/cameras.sh. It produces output like this:
Code:
[
{
"id": "camera001",
"version": 1,
"ip": "10.3.0.7",
"lag": 83
},
{
"id": "camera002",
"version": 2,
"ip": "10.3.0.8",
"lag": 116
},
{
"id": "camera003",
"version": 2,
"ip": "10.3.0.9",
"lag": 97
}
]
- In the Zabbix agent configuration, add Code:
UserParameter=cameras.get,/usr/local/bin/zabbixscripts/cameras.sh
- In Zabbix server, in the template, create a new item and in Tab Item:
- Name: cameras information
- Type Zabbix agent (active)
- Key "cameras.get"
- Type of information: Text
- Update interval 10m
- Click the three dots next to the new item and choose "Create dependent discovery rule"
- Tab Discovery rule:
- Name: Discovery rule for cameras
- Type: Dependent item
- Key: cameras.discovery
- Master item: template: cameras.get
- Tab LLD macros
- {#ID}: $.id
- {#VERSION}: $.version
- {#IP}: $.ip
- {#LAG}: $.lag
- Tab Discovery rule:
- In the discovery rule list, click item prototypes and Create item prototype
- Tab Item prototype
- Name: Camera {#ID} lag
- Type: Dependent item
- Key: camera.lag[{#ID}]
- Type: Numeric (unsigned)
- Master item: template: cameras.get
- Tab Preprocessing
- JSONPath: $.[?(@.id=='{#ID}')].lag.first()
- Tab Item prototype
- In the discovery rule list, click host prototypes and Create host prototype
- Host tab:
- Host name: camera {#ID}
- Templates: camera_test_template
- Groups: cameras
- Interfaces: SNMP, {#IP}
- Host tab:
Questions:
- Is the item prototype preprocessing required? It seems it already knows which item of the array it is working with (#ID is already set to one specific camera), but at the same time it needs a JSONPath to select the specific camera from the array? For the host prototype, the preprocessing doesn't seem to be required?
- Can I skip the creation of the item (step 2 above) and just create a discovery rule of type Zabbix agent (active) and key "cameras.get"? I have tried, but can't get it to work.
- Would this impact performance?
- The LLD macros seem superfluous: can I skip these macros if I change the output of the script from toCode:
{"id": "x", "ip": "127.0.0.1", ...}?Code:{"{#ID}": "x", "{#IP}": "127.0.0.1", ...}