Zabbix operations
Pull and Push build Zabbix JSON-RPC calls from templates you write. Both run only on rows that are selected and visible in the active sheet.
Template syntax
Request bodies are JavaScript template literals. Use ${…} to inject values from the current row:
| Expression | Meaning | Example |
|---|---|---|
${flds.fieldname} |
Cell by column name | ${flds.hostid} |
${cols[N]} |
Cell by 0-based index | ${cols[2]} |
${$N} |
Legacy alias for cols[N] |
${$0} |
${_ColumnName} |
Legacy alias for flds.ColumnName |
${_IP} |
Prefer flds / cols in new templates; legacy forms still work.
The preview panel evaluates the template against the first selected row so you can verify output before executing.
Quoting rules
{
"hostid": "${flds.hostid}",
"tags": ${cols[3]}
}
- Wrap string fields in quotes in the template:
"${flds.hostid}" - Insert JSON already stored in a cell without extra quotes:
${cols[3]}so a JSON array in the cell becomes a real array in the request
Connection & query mode
Configure via the Zabbix logo (top right):
| Setting | On Zabbix frontend | Remote / local |
|---|---|---|
| API URL | api_jsonrpc.php |
Full URL, e.g. https://host/zabbix/api_jsonrpc.php |
| Token | Bearer token from Zabbix UI | Same |
| API query mode | How Pull/Push fire many row requests | See below |
Credentials and mode are stored in localStorage. The connection test runs host.get with {limit:1}.
Bulk query modes
| Mode | Behaviour | When to use |
|---|---|---|
Parallel (parallel) |
Many requests at once (browser-pooled) | Fast reads; riskier for heavy creates/updates |
Sequential (seq) |
One request after another | Safest for writes and large selections |
Hybrid (batch) |
Sequential batches of 10 parallel requests | Compromise between speed and load |
Start with Sequential when testing Push templates on production. The connection pill shows Connected after a successful host.get test.
Pull — enrich rows from Zabbix
Zabbix → Pull
For each selected + visible row, ZbxWizz calls {resource}.get with your template and attaches the result to the row.
| Field | Description |
|---|---|
| Resource | e.g. host, item, trigger, hostinterface |
| Data label | Key under row.data (default: zbx) |
| Request editor | JSON params template for .get |
Example — items for each host
-
Import hosts with a
hostidcolumn -
Select rows
-
Resource:
item· Label:items -
Template:
{ "hostids": ["${flds.hostid}"], "output": ["itemid", "name", "key_"], "limit": 500 } -
Execute Pull
Each row gets data.items. Use it in transforms:
data.items ? String(data.items.length) : "0"
json(data.items)
Empty results surface as errors (“Not found”); failed rows log to the console and keep lastError / lastResponse for inspection (row number button).
Push — write to Zabbix
Zabbix → Push
For each selected + visible row, ZbxWizz calls {resource}.{operation}.
| Field | Description |
|---|---|
| Resource | host, hostgroup, template, trigger, … |
| Operation | create, update, or delete |
| Request editor | JSON params template |
| Operation | API method | Typical use |
|---|---|---|
update |
{resource}.update |
Modify existing objects |
create |
{resource}.create |
Bulk create |
delete |
{resource}.delete |
Bulk removal |
Confirmation
Push always asks for confirmation. Delete shows an extra warning. There is no undo.
Successful rows are highlighted; errors use a different row colour. Inspect lastError / lastResponse via the row number button.
Example — update host tags
{
"hostid": "${flds.hostid}",
"tags": ${cols[4]}
}
Example — create host groups from a name column
{
"name": "${flds.name}"
}
Resource: hostgroup · Operation: create
Example — delete triggers
Resource: trigger · Operation: delete
{
"triggerid": "${flds.triggerid}"
}
Error handling
- Template syntax errors show in the preview before you run
- Preview colour: green ≈ compiled OK, red ≈ invalid — still double-check content before Push
- Per-row API outcomes are stored on the row (
lastResponse,lastError) - An overlay spinner indicates batch operations in progress
Safety checklist
Before pushing to production:
- Test on one or two rows first
- Read the preview after every template change
- Use filters to narrow visible rows before Select All
- Prefer Sequential query mode for large writes
- File → Save and/or Export → CSV / Excel as backup
- Avoid delete until update templates are proven
- Check token permissions — the API enforces Zabbix role limits
- Remember the import default limit of 5 so you do not push incomplete selections by mistake
See Getting started for a complete first push walkthrough.