Dostupná řešení
Claude API by HTTP
Overview
This template is designed for the effortless deployment of Claude API monitoring by Zabbix via HTTP and doesn't require any external scripts.
Please consult the Claude API documentation for more details.
Requirements
Zabbix version: 8.0 and higher.
Tested versions
This template has been tested on:
- Claude API
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
- Create an admin token on the
Claude Consolepage. - Enter the admin token into the
API tokenfield.
Macros used
| Name | Description | Default |
|---|---|---|
| {$CLAUDE.API.URL} | Claude API URL. |
https://api.anthropic.com/v1 |
| {$CLAUDE.API.TOKEN} | Claude API token. |
|
| {$CLAUDE.API.TIMEOUT} | Response timeout for an API. |
15s |
| {$CLAUDE.API.INTERVAL} | Update interval for raw items. |
1h |
| {$CLAUDE.API.HTTP_PROXY} | HTTP proxy for API requests. You can specify it using the format [protocol://][username[:password]@]proxy.example.com[:port]. See the documentation at https://www.zabbix.com/documentation/8.0/manual/config/items/itemtypes/http |
|
| {$HTTP.TLS.VERIFY} | TLS certificate verification for script items: "none" - disabled, "peer" - verify the certificate chain and expiration, "full" - full verification. Any other value enables full verification. To override the setting for this template only, define the macro with the context "Claude API", e.g. {$HTTP.TLS.VERIFY:"Claude API"}. |
full |
| {$CLAUDE.API.MSG.USAGE.BUCKET} | Time period and gathering interval for Claude API message usage report data. |
1m |
| {$CLAUDE.API.CODE.COST.WARN} | Warning threshold for estimated Claude Code usage cost. |
10 |
| {$CLAUDE.API.MODEL.COST.WARN} | Warning threshold for previous day expenses. Supports macro context for per-workspace threshold tuning. |
10 |
| {$CLAUDE.API.WORKSPACE.COST.WARN} | Warning threshold for previous day expenses. Supports macro context for per-workspace threshold tuning. |
10 |
| {$CLAUDE.API.INVITE.EXPIRE.WARN} | Number of hours before invite expiration. |
24 |
| {$CLAUDE.API.INVITE.STATUS.MATCHES} | Filter to include invites by regex. |
.* |
| {$CLAUDE.API.INVITE.STATUS.NOT_MATCHES} | Filter to exclude invites by regex. |
accepted|deleted |
| {$CLAUDE.API.KEY.STATUS.MATCHES} | Filter to include API keys by regex. |
.* |
| {$CLAUDE.API.KEY.STATUS.NOT_MATCHES} | Filter to exclude API keys by regex. |
archived |
| {$CLAUDE.API.WORKSPACE.MATCHES} | Filter to include workspaces by regex. |
.* |
| {$CLAUDE.API.WORKSPACE.NOT_MATCHES} | Filter to exclude workspaces by regex. |
CHANGE_IF_NEEDED |
| {$CLAUDE.API.MODEL.MATCHES} | Filter to include model by regex. |
.* |
| {$CLAUDE.API.MODEL.NOT_MATCHES} | Filter to exclude model by regex. |
CHANGE_IF_NEEDED |
Items
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| API key: Get data | Item for gathering Claude API data about API keys. |
Script | claude.keys.get |
| API key: Get data errors | Item for gathering errors from |
Dependent item | claude.keys.errors Preprocessing
|
| Users: Get data | Item for gathering Claude API data about users. |
Script | claude.users.get |
| Users: Get data errors | Item for gathering errors from |
Dependent item | claude.users.errors Preprocessing
|
| Workspace: Get data | Item for gathering Claude API data about workspaces. |
Script | claude.workspaces.get |
| Workspace: Get data errors | Item for gathering errors from |
Dependent item | claude.workspaces.errors Preprocessing
|
| Invite: Get data | Item for gathering Claude API data about invites. |
Script | claude.invites.get |
| Invite: Get data errors | Item for gathering errors from |
Dependent item | claude.invites.errors Preprocessing
|
| Usage [messages]: Get data | Item for gathering Claude API message usage report. |
Script | claude.usage.messages.get |
| Usage [messages]: Get data errors | Item for gathering errors from |
Dependent item | claude.usage.messages.errors Preprocessing
|
| Usage [code]: Get data | Item retrieves previous day aggregated usage metrics for Claude Code users. |
Script | claude.usage.code.get |
| Usage [code]: Get data errors | Item for gathering errors from |
Dependent item | claude.usage.code.errors Preprocessing
|
| Costs: Get data | Item retrieves previous day aggregated cost report. |
Script | claude.costs.get |
| Costs: Get data errors | Item for gathering errors from |
Dependent item | claude.costs.errors Preprocessing
|
| Workspace: Total count | Total number of workspaces in your organization. |
Dependent item | claude.workspaces.count Preprocessing
|
| Limits: Get data | Item retrieves organization limits. |
Script | claude.limits.get |
| Limits: Get data errors | Item for gathering errors from |
Dependent item | claude.limits.errors Preprocessing
|
| Users: Total count | Total number of users in your organization. |
Dependent item | claude.users.total Preprocessing
|
| Users: Role [user], count | Number of users with "user" role in your organization. |
Dependent item | claude.users.user Preprocessing
|
| Users: Role [developer], count | Number of users with "developer" role in your organization. |
Dependent item | claude.users.developer Preprocessing
|
| Users: Role [billing], count | Number of users with "billing" role in your organization. |
Dependent item | claude.users.billing Preprocessing
|
| Users: Role [admin], count | Number of users with "admin" role in your organization. |
Dependent item | claude.users.admin Preprocessing
|
| Users: Role [claude_code_user], count | Number of users with "claude_code_user" role in your organization. |
Dependent item | claude.users.claude_code_user Preprocessing
|
Triggers
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
Claude API: There are errors in the API key: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.keys.errors))>0 |
Warning | |
Claude API: There are errors in the Users: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.users.errors))>0 |
Warning | |
Claude API: There are errors in the Workspace: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.workspaces.errors))>0 |
Warning | |
Claude API: There are errors in the Invite: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.invites.errors))>0 |
Warning | |
Claude API: There are errors in the Usage [messages]: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.usage.messages.errors))>0 |
Warning | |
Claude API: There are errors in the Usage [code]: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.usage.code.errors))>0 |
Warning | |
Claude API: There are errors in the Costs: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.costs.errors))>0 |
Warning | |
Claude API: There are errors in the Limits: Get data item |
An error occurred while attempting to retrieve values for the |
length(last(/Claude API by HTTP/claude.limits.errors))>0 |
Warning |
LLD rule Workspace discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace discovery | Workspace discovery. |
Dependent item | claude.workspaces.discovery Preprocessing
|
Item prototypes for Workspace discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Member, count | Number of members in the workspace. |
Dependent item | claude.workspaces.members[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Messages: Output tokens | The number of output tokens generated. |
Dependent item | claude.workspaces.msg.tokens.out[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Messages: Input tokens, uncached | The number of uncached input tokens processed. |
Dependent item | claude.workspaces.msg.tokens.in.uncached[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Messages: Input tokens, cached | The number of input tokens read from the cache. |
Dependent item | claude.workspaces.msg.tokens.in.cached[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: API key count | Number of API keys. |
Dependent item | claude.workspaces.keys.count[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Spent, total | Total expenses for the previous day. |
Dependent item | claude.workspaces.costs.total[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Uptime | Workspace uptime - how long ago it was created. |
Dependent item | claude.workspaces.uptime[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Limit: Batch requests | Batch requests limit for |
Dependent item | claude.workspaces.limit.requests[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Limit: Web search | Web search limit for |
Dependent item | claude.workspaces.limit.web_search[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Users, count | Number of user role members in the workspace. |
Dependent item | claude.workspaces.member_role.user[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Developers, count | Number of developer role members in the workspace. |
Dependent item | claude.workspaces.member_role.developer[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Restricted developers, count | Number of restricted developer role members in the workspace. |
Dependent item | claude.workspaces.member_role.developer.restricted[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Admins, count | Number of admin role members in the workspace. |
Dependent item | claude.workspaces.member_role.admin[{#WORKSPACE.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Billing, count | Number of billing role members in the workspace. |
Dependent item | claude.workspaces.member_role.billing[{#WORKSPACE.ID}] Preprocessing
|
Trigger prototypes for Workspace discovery
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| Claude API: Workspace [{#WORKSPACE.NAME}] expenses exceeded the threshold | Total workspace expenses exceeded the threshold in the previous day. |
last(/Claude API by HTTP/claude.workspaces.costs.total[{#WORKSPACE.ID}])>({$CLAUDE.API.WORKSPACE.COST.WARN:"{#WORKSPACE.NAME}"}) |
Warning |
LLD rule Workspace [{#WORKSPACE.NAME}]: Cost model discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Cost model discovery | Claude costs model discovery. |
Dependent item | claude.costs.model.discovery[{#WORKSPACE.ID}] Preprocessing
|
Item prototypes for Workspace [{#WORKSPACE.NAME}]: Cost model discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Model [{#MODEL.NAME}]: Total costs | Total |
Dependent item | claude.costs.model.total[{#WORKSPACE.NAME}, {#MODEL.NAME}] Preprocessing
|
Trigger prototypes for Workspace [{#WORKSPACE.NAME}]: Cost model discovery
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| Claude API: Model {#MODEL.NAME} expenses exceeded the threshold | Model expenses exceeded the threshold in the previous day. |
last(/Claude API by HTTP/claude.costs.model.total[{#WORKSPACE.NAME}, {#MODEL.NAME}])>({$CLAUDE.API.MODEL.COST.WARN:"{#WORKSPACE.NAME}"}) |
Warning |
LLD rule Workspace [{#WORKSPACE.NAME}]: Limits discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Limits discovery | Limits discovery. |
Dependent item | claude.limits.discovery[{#WORKSPACE.ID}] Preprocessing
|
Item prototypes for Workspace [{#WORKSPACE.NAME}]: Limits discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Model group [{#GROUP.NAME}]: Limit: Output tokens |
|
Dependent item | claude.workspaces.model.limit.token.output[{#WORKSPACE.ID}, {#GROUP.NAME}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Model group [{#GROUP.NAME}]: Limit: Input tokens |
|
Dependent item | claude.workspaces.model.limit.token.input[{#WORKSPACE.ID}, {#GROUP.NAME}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Model group [{#GROUP.NAME}]: Limit: Requests per minute |
|
Dependent item | claude.workspaces.model.limit.requests[{#WORKSPACE.ID}, {#GROUP.NAME}] Preprocessing
|
LLD rule Workspace [{#WORKSPACE.NAME}]: API key discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: API key discovery | API keys discovery. |
Dependent item | claude.keys.discovery[{#WORKSPACE.ID}] Preprocessing
|
Item prototypes for Workspace [{#WORKSPACE.NAME}]: API key discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Status | API key status. Possible values: "active", "inactive", "archived" and "expired". |
Dependent item | claude.keys.status[{#WORKSPACE.ID}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Uptime | API key uptime - how long ago it was created. |
Dependent item | claude.keys.uptime[{#WORKSPACE.ID}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Commits | Number of git commits created yesterday through Claude Code's commit functionality. |
Dependent item | claude.code.commits[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Lines added | Total number of lines of code added yesterday across all files by Claude Code. |
Dependent item | claude.code.lines.added[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Lines removed | Total number of lines of code removed yesterday across all files by Claude Code. |
Dependent item | claude.code.lines.removed[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Sessions | Number of distinct Claude Code sessions initiated yesterday by this API key. |
Dependent item | claude.code.sessions[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Pull requests | Number of pull requests created yesterday through Claude Code's PR functionality. |
Dependent item | claude.code.pull_requests[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Estimated cost, total | Estimated cost amount for previous day for all models. |
Dependent item | claude.code.cost.total[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Output tokens | Total number of output tokens generated by all models for previous day. |
Dependent item | claude.code.token.output.total[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code: Input tokens | Total number of input tokens consumed by all models for previous day. |
Dependent item | claude.code.token.input.total[{#WORKSPACE.NAME}, {#KEY.ID}] Preprocessing
|
Trigger prototypes for Workspace [{#WORKSPACE.NAME}]: API key discovery
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| Claude API: API key [{#KEY.NAME}] expired | API key expired. |
last(/Claude API by HTTP/claude.keys.status[{#WORKSPACE.ID}, {#KEY.ID}])=4 |
Warning | Manual close: Yes |
| Claude API: API key [{#KEY.NAME}] became inactive | API key became inactive. |
last(/Claude API by HTTP/claude.keys.status[{#WORKSPACE.ID}, {#KEY.ID}])=2 |
Warning | Manual close: Yes |
| Claude API: Code usage estimated costs by {#KEY.NAME} key exceeded the threshold | Code usage estimated costs exceeded the threshold in the previous day. |
last(/Claude API by HTTP/claude.code.cost.total[{#WORKSPACE.NAME}, {#KEY.ID}])>({$CLAUDE.API.CODE.COST.WARN:"{#WORKSPACE.NAME}"}) |
Warning |
LLD rule Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Messages model discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Messages model discovery | Claude messages model discovery. |
Dependent item | claude.messages.model.discovery[{#WORKSPACE.ID}, {#KEY.ID}] Preprocessing
|
Item prototypes for Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Messages model discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Model [{#MODEL.NAME}]: Messages: Uncached input tokens | The number of uncached input tokens processed for {#MODEL.NAME} model. |
Dependent item | claude.messages.model.token.input.uncached[{#WORKSPACE.NAME}, {#KEY.NAME}, {#MODEL.NAME}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Model [{#MODEL.NAME}]: Messages: Cached input tokens | The number of input tokens read from the cache for {#MODEL.NAME} model. |
Dependent item | claude.messages.model.token.input.cached[{#WORKSPACE.NAME}, {#KEY.NAME}, {#MODEL.NAME}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Model [{#MODEL.NAME}]: Messages: Output tokens | The number of output tokens generated for {#MODEL.NAME} model. |
Dependent item | claude.messages.model.token.output[{#WORKSPACE.NAME}, {#KEY.NAME}, {#MODEL.NAME}] Preprocessing
|
LLD rule Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code model discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code model discovery | Claude code model discovery. |
Dependent item | claude.code.model.discovery[{#WORKSPACE.ID}, {#KEY.ID}] Preprocessing
|
Item prototypes for Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Code model discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Model [{#MODEL.NAME}]: Code: Input tokens | Total number of input tokens consumed by {#MODEL.NAME} model for previous day. |
Dependent item | claude.code.token.input[{#WORKSPACE.NAME}, {#KEY.ID}, {#MODEL.NAME}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Model [{#MODEL.NAME}]: Code: Output tokens | Total number of output tokens generated by {#MODEL.NAME} model for previous day. |
Dependent item | claude.code.token.output[{#WORKSPACE.NAME}, {#KEY.ID}, {#MODEL.NAME}] Preprocessing
|
| Workspace [{#WORKSPACE.NAME}]: Key [{#KEY.NAME}]: Model [{#MODEL.NAME}]: Code: Estimated cost | Estimated cost amount for {#MODEL.NAME} model for previous day. |
Dependent item | claude.code.costs[{#WORKSPACE.NAME}, {#KEY.ID}, {#MODEL.NAME}] Preprocessing
|
LLD rule Invite discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Invite discovery | Invite discovery. |
Dependent item | claude.invites.discovery Preprocessing
|
Item prototypes for Invite discovery
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Invite [{#INVITE.EMAIL}]: Status | Invite status. Possible values: "accepted", "expired", "deleted", "pending" and "unknown". |
Dependent item | claude.invites.status[{#INVITE.ID}] Preprocessing
|
| Invite [{#INVITE.EMAIL}]: Time left | Time left before the invite will expire. |
Dependent item | claude.invites.expires[{#INVITE.ID}] Preprocessing
|
Trigger prototypes for Invite discovery
| Name | Description | Expression | Severity | Dependencies and additional info |
|---|---|---|---|---|
| Claude API: Invite [{#INVITE.EMAIL}] expired | Invite has expired. |
last(/Claude API by HTTP/claude.invites.status[{#INVITE.ID}])=2 |
Warning | Manual close: Yes |
| Claude API: Invite [{#INVITE.EMAIL}] was accepted | Invite was accepted. |
last(/Claude API by HTTP/claude.invites.status[{#INVITE.ID}])=1 |
Info | Manual close: Yes |
| Claude API: Invite [{#INVITE.EMAIL}] will expire soon | Invite will expire. |
last(/Claude API by HTTP/claude.invites.expires[{#INVITE.ID}])<({$CLAUDE.API.INVITE.EXPIRE.WARN}*3600) |
Warning | Manual close: Yes Depends on:
|
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums