How to connect Zabbix to Toolspoke
Give your Toolspoke agents read access to Zabbix hosts, problems and metric history, and optionally let them acknowledge problems and schedule maintenance. A dedicated user, a scoped API token, and an agent that watches it for you.
Checked against Zabbix's documentation on 2026-11-25.
Toolspoke's Zabbix toolkit calls your Zabbix server's own JSON-RPC API (/api_jsonrpc.php) with an API token you create. Once it's installed, any agent in the project can use it. This guide sets that up with the least access that still answers the questions people ask: what's broken, since when, and what the graphs looked like before it broke. Then it builds an agent that posts the morning's problems to your ops channel.
It takes about ten minutes if you're a Zabbix Super admin. The Zabbix steps follow the 7.0 manual. Newer versions keep the same menus.
What an agent can do once it's connected
The toolkit has 14 named actions. Nine of them only read:
- What's broken now:
get_problemsreturns what the Problems page shows: current problems, severity, whether someone has acknowledged them, and tags. - What happened before:
get_eventscovers trigger events over a time window, including recoveries. Use it for "how often did db-02 go down last week". - Hosts and groups:
get_hostsandget_host_groupsreturn the IDs every other read filters on. - Metrics:
get_itemsfinds the metric,get_historyreads raw values, andget_trendsreads hourly min, average and max for periods older than your history retention. - Triggers and maintenance:
get_triggersandget_maintenances.
The other five change things in Zabbix:
| Action | What it changes | Kind |
|---|---|---|
acknowledge_events | Acknowledges problems and leaves a message on them | Write |
create_maintenance | Schedules a one-time maintenance window | Write |
set_host_status | Enables or disables monitoring of one host | Write |
update_events | Any event update: close, change severity, suppress | Destructive |
delete_maintenance | Deletes maintenance periods permanently | Destructive |
You decide which of these your agents may call (step 4).
What you need
- Zabbix with API tokens, served over HTTPS at an address Toolspoke can reach from the internet. Toolspoke refuses private-network addresses, so a Zabbix server only reachable on your LAN or VPN won't work.
- A Zabbix Super admin account, to create the user, role and token below.
- A Toolspoke workspace, and a project to install the toolkit in.
Step 1: Create a role and a user for Toolspoke
Don't hand Toolspoke your own token. A token acts as the user it belongs to, so an agent would see and change everything you can. Give it a user of its own instead.
- In Zabbix, open Users → User roles and create a role, for example
ai-readonly. Set the user type to User. - Under Access to API, tick Enabled. Then choose Allow list and add the methods the toolkit uses for reading:
host.get,hostgroup.get,problem.get,event.get,trigger.get,item.get,history.get,trend.getandmaintenance.get. - If agents should acknowledge problems, also allow
event.acknowledge, and keep Add problem comments ticked under the role's actions. Zabbix ties that action toevent.acknowledge, and unticking it switches the method off. - Open Users → User groups and create a group, for example
ai-agents. Under Host permissions, give it Read on the host groups agents may see. In Zabbix, host access is only granted to user groups, never to individual users. - Open Users → Users and create the user, for example
toolspoke, with the role from step 1 and the group from step 4.
- Users
- User roles
- Create user role
- Users
- User groups
- Create user group
A User-type role can't call maintenance.create, because Zabbix only allows that for Admin and Super admin types. If you want agents to schedule maintenance, use the Admin type for the role, give the group Read-write on the host groups it may put into maintenance, and add the maintenance.* methods to the allow list. set_host_status uses host.update, which also needs read-write on that host's group.
Step 2: Create an API token
- Open Users → API tokens and choose Create API token.
- Pick the user from step 1 and give the token a name, for example
toolspoke. - Tick Set expiration date and time if you want the token to expire. A year is a reasonable rotation. When it expires, the toolkit's calls fail until you paste a new token.
- Choose Add and copy the token. Zabbix shows it once.
- Users
- API tokens
- Create API token
Step 3: Install the Zabbix toolkit in Toolspoke
- In Toolspoke, open the project your agents work in. Find Zabbix in the marketplace and add it.
- Paste the API token from step 2.
- Enter the Zabbix frontend URL: the address you open Zabbix at in a browser, without
/api_jsonrpc.php, for examplehttps://zabbix.example.com. A package install often serves it under/zabbix, as inhttps://monitor.example.com/zabbix.
get_hosts answered. The credential works.
Toolspoke checks the connection by listing one host. If that fails, see Troubleshooting.
The token is encrypted at rest and attached to each request by the gateway. The agent never sees it, and it never appears in the arguments an agent sends or in the audit log.
Step 4: Decide what agents may change
In the project's toolkit settings, Zabbix's actions are grouped as read, write and destructive. Each one can be switched on or off for everyone in the project.
A sensible start: leave the nine reads on and acknowledge_events on, and switch off update_events, delete_maintenance and set_host_status until you've seen how the team uses it. Turn create_maintenance off too while the role is a User type, since Zabbix would refuse it anyway. An action that's switched off can't be called, whatever the prompt says.
Zabbix actions in your project
Agents can call 10 of 14, and 1 of those can change something.
get_hostsList monitored hosts with their status, maintenance state, interfaces and host groups.get_host_groupsList host groups with how many hosts each holds.get_problemsList current problems, newest first, with severity, acknowledgement state and tags.get_eventsList trigger events over a time window, newest first, including recoveries.get_triggersList triggers — the conditions that raise problems — with their expanded description, priority and current state, most recently changed first.get_itemsList items — the individual metrics Zabbix collects — with their key, units, value type and last value.get_historyRead raw collected values for one or more items over a time window, newest first.get_trendsRead hourly min, average and max for numeric items over a time window.get_maintenancesList maintenance periods with their hosts, host groups and time periods.
acknowledge_eventsAcknowledge problem events and leave a message on them — what an on-call engineer does to say "I am on this".create_maintenanceSchedule a one-time maintenance window for hosts or host groups, so planned work does not page anyone.set_host_statusEnable (status 0) or disable (status 1) monitoring of one host.
update_eventsApply any event update by bitmask: 1 close problem, 2 acknowledge, 4 add message, 8 change severity, 16 unacknowledge, 32 suppress, 64 unsuppress, 128 rank as cause, 256 rank as symptom.delete_maintenanceDelete maintenance periods permanently.
Every call is recorded with the agent and person behind it, the request, the response and the duration. You can always see what an agent looked at and what it changed.
Step 5: Build an agent that uses it
In Toolspoke, create an agent and describe its job in one sentence. The builder proposes the instructions, the toolkits it needs, a schedule and where it should answer. You add or skip each one, then create the agent. Every piece stays editable afterwards.
The same agent answers when someone asks it in Slack, emails it or mentions it on a pull request, and it replies in the thread it was asked in. If someone emails it, each write, such as acknowledging a problem, waits for a person's go-ahead unless you've allowed that action in advance.
Try it
Ask the agent the way you'd ask a colleague on call:
- What problems are open in Zabbix right now, worst first? Which are unacknowledged?
- How many times did the db host group raise a problem in the last 7 days, and which triggers fired most?
- Show CPU load on web-01 for the last 24 hours. Was there a spike before the 14:00 alert?
- Which hosts are in maintenance, and when does each window end?
- Acknowledge the disk-space problem on backup-02 with the message "Cleaning old snapshots, back by 18:00".
For metrics, the agent first finds the item with get_items, then reads get_history with the item's value type. For anything older than your history retention, it switches to get_trends. The Zabbix toolkit page lists every action.
Troubleshooting
"Not authorized" or "Session terminated" on every call.
Usually the Authorization header never reaches Zabbix. Zabbix's own known-issues page describes this for Apache:
- Apache in front of PHP as a reverse proxy: add
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1. - Apache running PHP directly (mod_cgi): add
CGIPassAuth On.
Then restart Apache. Nginx passes the header by default.
"No permissions to call…".
The method isn't on the role's allow list, or Access to API is off for the role. Add the method named in the error under Users → User roles.
The call works, but hosts or problems are missing.
The user group has no Read permission on those host groups. Zabbix filters silently rather than raising an error.
The connection check fails with an address error.
The frontend URL must be public HTTPS, and Toolspoke refuses private and internal IPs. Also check you didn't include /api_jsonrpc.php.
Everything stopped working on a particular day.
The token expired. Create a new one (step 2) and paste it into the toolkit's credentials.
Questions
Does the agent see my Zabbix passwords or the token?
No. The token is attached to the request by Toolspoke's gateway, never shown to the agent, and masked in the audit log.
Can an agent run Zabbix scripts or change triggers and templates?
No. The toolkit only has the 14 actions listed above. Anything else in the Zabbix API, such as script.execute, trigger.update or template.*, isn't reachable through it.
Does it work with Zabbix Cloud?
Yes, if your Zabbix Cloud instance has a public frontend URL and you can create API tokens there. The steps are the same.