Skip to main content
Glama
mpeirone

zabbix-mcp-server

trigger_create

Define and configure custom triggers in Zabbix monitoring to detect specific conditions. Set description, expression, severity, status, and comments to automate issue alerts.

Instructions

Create a new trigger in Zabbix.

Args:
    description: Trigger description
    expression: Trigger expression
    priority: Severity (0=not classified, 1=info, 2=warning, 3=average, 4=high, 5=disaster)
    status: Status (0=enabled, 1=disabled)
    comments: Additional comments
    
Returns:
    str: JSON formatted creation result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commentsNo
descriptionYes
expressionYes
priorityNo
statusNo

Implementation Reference

  • The main handler function for the 'trigger_create' MCP tool. It is decorated with @mcp.tool() which handles both implementation and registration in FastMCP. The function creates a new trigger in Zabbix by calling the ZabbixAPI client's trigger.create method after validating permissions and formatting parameters.
    @mcp.tool()
    def trigger_create(description: str, expression: str,
                       priority: int = 0, status: int = 0,
                       comments: Optional[str] = None) -> str:
        """Create a new trigger in Zabbix.
        
        Args:
            description: Trigger description
            expression: Trigger expression
            priority: Severity (0=not classified, 1=info, 2=warning, 3=average, 4=high, 5=disaster)
            status: Status (0=enabled, 1=disabled)
            comments: Additional comments
            
        Returns:
            str: JSON formatted creation result
        """
        validate_read_only()
        
        client = get_zabbix_client()
        params = {
            "description": description,
            "expression": expression,
            "priority": priority,
            "status": status
        }
        
        if comments:
            params["comments"] = comments
        
        result = client.trigger.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