Skip to main content
Glama
mpeirone

zabbix-mcp-server

trend_get

Extract Zabbix trend data for specified item IDs within a defined time range. Provides JSON-formatted results for monitoring and analysis.

Instructions

Get trend data from Zabbix.

Args:
    itemids: List of item IDs to get trends for
    time_from: Start time (Unix timestamp)
    time_till: End time (Unix timestamp)
    limit: Maximum number of results
    
Returns:
    str: JSON formatted trend data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemidsYes
limitNo
time_fromNo
time_tillNo

Implementation Reference

  • The main handler function for the 'trend_get' tool, decorated with @mcp.tool() for automatic registration in FastMCP. It retrieves trend data from Zabbix API using the provided itemids and optional time filters, formats the response as JSON.
    @mcp.tool()
    def trend_get(itemids: List[str], time_from: Optional[int] = None,
                  time_till: Optional[int] = None,
                  limit: Optional[int] = None) -> str:
        """Get trend data from Zabbix.
        
        Args:
            itemids: List of item IDs to get trends for
            time_from: Start time (Unix timestamp)
            time_till: End time (Unix timestamp)
            limit: Maximum number of results
            
        Returns:
            str: JSON formatted trend data
        """
        client = get_zabbix_client()
        params = {"itemids": itemids}
        
        if time_from:
            params["time_from"] = time_from
        if time_till:
            params["time_till"] = time_till
        if limit:
            params["limit"] = limit
        
        result = client.trend.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