Overview

    Alert scripts are executed on Zabbix server. These scripts are located in the directory defined in the server configuration file AlertScriptsPath variable.

    Here is an example alert script:

    Starting from version 3.4 Zabbix checks for the exit code of the executed commands and scripts. Any exit code which is different from 0 is considered as a error. In such case Zabbix will try to repeat failed execution.

    Environment variables are not preserved or created for the script, so they should be handled explicitly.

    Configuration

    • Click on Create media type

    The Media type tab contains general media type attributes:

    The following parameters are specific for the script media type:

    See common media type parameters for details on how to configure default messages and alert processing options.

    Even if an alertscript doesn’t use default messages, message templates for operation types used by this media type must still be defined, otherwise a notification will not be sent.

    As parallel processing of media types is implemented since Zabbix 3.4.0, it is important to note that with more than one script media type configured, these scripts may be processed in parallel by alerter processes. The total number of alerter processes is limited by the StartAlerters .

    User media

    Note, that when defining a user media, a Send to field cannot be empty. If this field will not be used in an alertscript, enter any combination of supported characters to bypass validation requirements.