Skip to main content
Glama

history_get

Retrieve historical data from Zabbix by specifying item IDs, time range, history type, and sorting preferences. Outputs JSON-formatted results for analysis or integration.

Instructions

Get history data from Zabbix.

Args: itemids: List of item IDs to get history for history: History type (0=float, 1=character, 2=log, 3=unsigned, 4=text) time_from: Start time (Unix timestamp) time_till: End time (Unix timestamp) limit: Maximum number of results sortfield: Field to sort by sortorder: Sort order (ASC or DESC) Returns: str: JSON formatted history data

Input Schema

NameRequiredDescriptionDefault
historyNo
itemidsYes
limitNo
sortfieldNoclock
sortorderNoDESC
time_fromNo
time_tillNo

Input Schema (JSON Schema)

{ "properties": { "history": { "default": 0, "title": "History", "type": "integer" }, "itemids": { "items": { "type": "string" }, "title": "Itemids", "type": "array" }, "limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Limit" }, "sortfield": { "default": "clock", "title": "Sortfield", "type": "string" }, "sortorder": { "default": "DESC", "title": "Sortorder", "type": "string" }, "time_from": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Time From" }, "time_till": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Time Till" } }, "required": [ "itemids" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'history_get' tool. It retrieves history data from the Zabbix API using the provided itemids and parameters, formats the parameters into a dict, calls client.history.get(**params), and returns the JSON-formatted result.
    @mcp.tool() def history_get(itemids: List[str], history: int = 0, time_from: Optional[int] = None, time_till: Optional[int] = None, limit: Optional[int] = None, sortfield: str = "clock", sortorder: str = "DESC") -> str: """Get history data from Zabbix. Args: itemids: List of item IDs to get history for history: History type (0=float, 1=character, 2=log, 3=unsigned, 4=text) time_from: Start time (Unix timestamp) time_till: End time (Unix timestamp) limit: Maximum number of results sortfield: Field to sort by sortorder: Sort order (ASC or DESC) Returns: str: JSON formatted history data """ client = get_zabbix_client() params = { "itemids": itemids, "history": history, "sortfield": sortfield, "sortorder": sortorder } if time_from: params["time_from"] = time_from if time_till: params["time_till"] = time_till if limit: params["limit"] = limit result = client.history.get(**params) return format_response(result)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mpeirone/zabbix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server