Skip to main content
Glama

maintenance_get

Retrieve maintenance periods from Zabbix by specifying maintenance IDs, host group IDs, or host IDs. Returns JSON-formatted data in the desired output format for monitoring and analysis.

Instructions

Get maintenance periods from Zabbix.

Args: maintenanceids: List of maintenance IDs to retrieve groupids: List of host group IDs to filter by hostids: List of host IDs to filter by output: Output format Returns: str: JSON formatted list of maintenance periods

Input Schema

NameRequiredDescriptionDefault
groupidsNo
hostidsNo
maintenanceidsNo
outputNoextend

Input Schema (JSON Schema)

{ "properties": { "groupids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Groupids" }, "hostids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Hostids" }, "maintenanceids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Maintenanceids" }, "output": { "default": "extend", "title": "Output", "type": "string" } }, "type": "object" }

Implementation Reference

  • The handler function for the 'maintenance_get' MCP tool. It is registered via the @mcp.tool() decorator and implements the logic to retrieve maintenance periods from the Zabbix API using the zabbix_utils client, formatting the response as JSON.
    @mcp.tool() def maintenance_get(maintenanceids: Optional[List[str]] = None, groupids: Optional[List[str]] = None, hostids: Optional[List[str]] = None, output: Union[str, List[str]] = "extend") -> str: """Get maintenance periods from Zabbix. Args: maintenanceids: List of maintenance IDs to retrieve groupids: List of host group IDs to filter by hostids: List of host IDs to filter by output: Output format (extend or list of specific fields) Returns: str: JSON formatted list of maintenance periods """ client = get_zabbix_client() params = {"output": output} if maintenanceids: params["maintenanceids"] = maintenanceids if groupids: params["groupids"] = groupids if hostids: params["hostids"] = hostids result = client.maintenance.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