Usermacro Create
usermacro_createCreate a host macro in Zabbix to define host-specific variables for use in items and triggers via {$MACRO_NAME}, enabling configuration changes without editing each item.
Instructions
Create a new host macro in Zabbix.
Host macros define custom variables for specific hosts. They can be referenced in items and triggers using {$MACRO_NAME} syntax, allowing dynamic configuration without editing items.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"hostid": "<hostid>",
"macro": "<macro>",
"value": "<value>"
},
"name": "usermacro_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| macro | Yes | Macro name (e.g., {$MYMACRO}). | |
| type_ | No | 0=text, 1=secret, 2=vault. | |
| value | Yes | Macro value. | |
| hostid | Yes | Host ID for the macro. | |
| description | No | Optional description explaining the macro's purpose. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||