Skip to content

Zabbix Command

safecall integrations zabbix provides setup and validation commands for SafeCall monitoring in Zabbix.

What it configures

The command provisions:

  1. template group (SafeCall)
  2. host group (SafeCall Devices)
  3. templates (SafeCall Gateway, SafeCall SOS Button, SafeCall Watch)
  4. trapper items on each template
  5. triggers on each template
  6. low-level discovery rules on the Zabbix server host
  7. host prototypes for discovered devices
  8. final verification of discovery-rule presence

Usage

bash
sudo ./util.sh integrations zabbix setup
sudo ./util.sh integrations zabbix setup --url http://zabbix.local/api_jsonrpc.php --user Admin --password secret
sudo ./util.sh integrations zabbix setup --zabbix-host "Zabbix server"
sudo ./util.sh integrations zabbix setup --dry-run
sudo ./util.sh integrations zabbix doctor
sudo ./util.sh integrations zabbix verify --url http://zabbix.local/api_jsonrpc.php --user Admin

Options

OptionMeaning
--url <url>Zabbix API URL
--user <user>Zabbix API username
--password <password>Zabbix API password
--zabbix-host <name>Zabbix host name where LLD rules are attached (default "Zabbix server")
--dry-runPrint planned actions only; do not execute API calls

Actions:

  • setup (default): idempotent creation/reconciliation of monitoring objects
  • doctor: SafeCall-side checks (LLD endpoints, bridge config, trapper TCP reachability)
  • verify: read-only Zabbix API checks (no object creation/changes)

Zabbix 7.4+ compatibility

The CLI supports modern Zabbix authentication transport and legacy fallback automatically:

  • tries Authorization: Bearer <token> first
  • falls back to legacy JSON-RPC auth field when required by older servers

This avoids errors like unexpected parameter "auth" on newer Zabbix versions.

Host pre-check assistance

If --zabbix-host is missing or does not match an existing host, setup and verify now print host candidates from host.get so you can retry with the exact host name.

Dry-run mode (documented hidden feature)

--dry-run computes and prints the full provisioning plan and exits immediately.

It includes:

  • templates, items, and trigger definitions
  • LLD rule names and target URLs
  • host prototype strategy
  • final disclaimer: no changes were made

This is useful for:

  • auditing what will be created
  • validating bridge endpoint URLs
  • CI/VM testing without a running Zabbix server

LLD endpoint source

The command resolves LLD URLs from SafeCall config keys:

  • server_bridge_server_url
  • server_bridge_endpoint_gateway
  • server_bridge_endpoint_beacon

Defaults are used when config is missing.

When to use

  • Initial Zabbix integration bootstrap.
  • Re-running idempotent setup after partial/manual changes.
  • Dry-run review before applying monitoring configuration.

Deep Documentation

For complete architecture, migration notes, troubleshooting, and full bridge/Zabbix reference, see: