Zabbix Documentation 2.0

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

manual:web_interface:frontend_sections:administration:scripts

6 Scripts

Overview

In the Administration → Scripts section user-defined scripts can be configured and maintained.

These scripts, depending on the set user permissions, then become available for execution by clicking on the host in various frontend locations (Dashboard, Latest data, Status of triggers, Events, Maps) and can also be run as an action operation. The scripts are executed on the Zabbix server or agent.

A listing of existing scripts with their details is displayed.

Displayed data:

ColumnDescription
Name Name of the script. Clicking on the script name opens the script configuration form.
Type Script type is displayed - Script or IPMI command.
Execute on It is displayed whether the script will be executed on Zabbix server or agent.
Commands All commands to be executed within the script are displayed.
User group The user group that the script is available to is displayed (or All for all user groups).
Host group The host group that the script is available for is displayed (or All for all host groups).
Host access The permission level for the host group is displayed - Read or Write. Only users with the required permission level will have access to executing the script.

To configure a new script, click on the Create script button in the top right-hand corner.

Mass editing options

A dropdown below the list offers one mass-editing option:

  • Delete selected - delete the scripts

To use this option, mark the check-boxes before the respective scripts and click on “Go”.

Configuring a script

Script attributes:

ParameterDescription
Name Unique name of the script.
Type Select script type - Script or IPMI command.
A special dropdown selection for scripts containing IPMI commands is available since Zabbix 2.0 version (previously a special syntax of IPMI <command> had to be used in the command field).
Execute on Select the radio button whether to execute the script on Zabbix server or agent.
The option to execute scripts on Zabbix agent is available since Zabbix 2.0 version (providing remote commands are enabled in the EnableRemoteCommands parameter in Zabbix agent configuration file).
Commands Enter full path to the commands to be executed within the script.
The following macros are supported in the commands: {HOST.CONN}, {HOST.IP}, {HOST.DNS}, {HOST.HOST}, {HOST.NAME}. If a macro may resolve to a value with spaces (for example, host name), don't forget to quote as needed.
Description Enter a description for the script.
User groups Select the user group that the script will be available to (or All for all user groups).
Host groups Select the host group that the script will be available for (or All for all host groups).
Required host permissions Select the permission level for the host group - Read or Write. Only users with the required permission level will have access to executing the script.
Enable confirmation Mark the checkbox to display a confirmation message before executing the script. This feature might be especially useful with potentially dangerous operations (like a reboot script) or ones that might take a long time.
Confirmation text Enter a custom confirmation text for the confirmation popup enabled with the checkbox above (for example, Remote system will be rebooted. Are you sure?). To see how the text will look like, click on Test confirmation next to the field.