zabbix-metrics-history

Retrieve historical metric data from Zabbix items with correct history-versus-trends routing.

650|182|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/automateyournetwork/netclaw --skill zabbix-metrics-history
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zabbix-metrics-history
Source: https://github.com/automateyournetwork/netclaw/tree/main/workspace/skills/zabbix-metrics-history
Command: npx skills add https://github.com/automateyournetwork/netclaw --skill zabbix-metrics-history

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Answering "what was this interface doing last Tuesday" from Zabbix is error-prone: the API silently returns empty arrays when you query with the wrong value type, mix value types in one call, or request a window beyond raw retention. This Skill enforces the correct procedure so historical answers from the NMS are accurate instead of confidently wrong.

Core Features & Use Cases

  • Correct history retrieval: Always runs item.get first to learn each item's value_type, retention windows, and units before calling history.get with the matching type.
  • History vs trends routing: Routes queries between raw polled values and hourly min/avg/max aggregates based on the requested time window, and discloses which source was used.
  • Empty-result diagnosis: Distinguishes the five causes of an empty response (wrong value type, aged-out data, disabled retention, never-collected items, genuinely idle metrics) so "no data" is never misreported.
  • Use Case: An engineer asks whether a WAN link was saturated overnight. The Skill queries the interface items with their real value types, merges raw history with hourly trends across the retention boundary, and reports peak utilization with units, timezone, and source clearly stated.

Quick Start

Ask the agent to show what the traffic on a specific switch interface looked like over the past week using Zabbix history.

Frequently Asked Questions about zabbix-metrics-history

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get historical interface utilization from Zabbix?

Call item.get first to learn the item's value_type, history, and trends retention, then call history.get with that exact value_type and your time window. For windows beyond raw retention, use trend.get for hourly min/avg/max aggregates instead.

Why does Zabbix history.get return an empty array?

Empty results come from five causes: wrong value_type (the API defaults to unsigned while most items are float), data aged past retention, retention disabled on the item, the item never collecting values, or genuinely zero traffic. Only the last one means nothing happened.

What is the difference between Zabbix history and trends?

History stores raw polled values for a short retention window, while trends store hourly min, avg, and max aggregates for much longer. Queries beyond raw retention must use trend.get, and answers should disclose that values are hourly aggregates, not instantaneous readings.

Can I query multiple Zabbix items with different value types in one call?

No. A single history.get call serves only one value type, and items of other types silently vanish from the response. Group items by value_type, make one call per group, and merge the results.

When should I use Zabbix history instead of Prometheus or live device checks?

Use Zabbix history for past behavior of gear monitored by the enterprise NMS, including devices currently unreachable. Use Prometheus or Grafana for infrastructure you instrumented yourself, and pyATS or CLI skills for current device state.