Skip to main content
Glama
mpeirone

zabbix-mcp-server

maintenance_create

Schedule maintenance periods in Zabbix by specifying start and end times, host or group IDs, and time periods. Streamline system updates and downtime management with JSON-formatted results.

Instructions

Create a new maintenance period in Zabbix.

Args:
    name: Maintenance name
    active_since: Start time (Unix timestamp)
    active_till: End time (Unix timestamp)
    groupids: List of host group IDs
    hostids: List of host IDs
    timeperiods: List of time periods
    description: Maintenance description
    
Returns:
    str: JSON formatted creation result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
active_sinceYes
active_tillYes
descriptionNo
groupidsNo
hostidsNo
nameYes
timeperiodsNo

Implementation Reference

  • The handler function for the 'maintenance_create' tool, decorated with @mcp.tool() for registration. It creates a new maintenance period using the Zabbix API, validates read-only mode, prepares parameters, calls client.maintenance.create, and formats the response.
    @mcp.tool()
    def maintenance_create(name: str, active_since: int, active_till: int,
                           groupids: Optional[List[str]] = None,
                           hostids: Optional[List[str]] = None,
                           timeperiods: Optional[List[Dict[str, Any]]] = None,
                           description: Optional[str] = None) -> str:
        """Create a new maintenance period in Zabbix.
        
        Args:
            name: Maintenance name
            active_since: Start time (Unix timestamp)
            active_till: End time (Unix timestamp)
            groupids: List of host group IDs
            hostids: List of host IDs
            timeperiods: List of time periods
            description: Maintenance description
            
        Returns:
            str: JSON formatted creation result
        """
        validate_read_only()
        
        client = get_zabbix_client()
        params = {
            "name": name,
            "active_since": active_since,
            "active_till": active_till
        }
        
        if groupids:
            params["groupids"] = groupids
        if hostids:
            params["hostids"] = hostids
        if timeperiods:
            params["timeperiods"] = timeperiods
        if description:
            params["description"] = description
        
        result = client.maintenance.create(**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