Ad Widget

Collapse

Need help with trigger prototypes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aigo15108
    Junior Member
    • Oct 2019
    • 17

    #1

    Need help with trigger prototypes

    To create trigger prototype by this description,


    { "jsonrpc": "2.0", "method": "triggerprototype.create", "params": { "description": "Free disk space is less than 20% on volume {#FSNAME}", "expression": "{Zabbix server:vfs.fs.size[{#FSNAME},pfree].last()}<20", "tags": [ { "tag": "volume", "value": "{#FSNAME}" }, { "tag": "type", "value": "{#FSTYPE}" } ] }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 } How does it get attached to the item prototype or the discovery rule? Or does it?
  • aigo15108
    Junior Member
    • Oct 2019
    • 17

    #2
    Well, it gets even better,
    The trigger prototype object has these properties, according to the documentation,
    https://www.zabbix.com/documentation/4.2/manual/api/reference/triggerprototype/object

    yet when I pass it in as a parameter,

    data = {
    "jsonrpc": "2.0",
    "method": "triggerprototype.create",
    "params": {
    "templateid": self.hostid,
    "description": description,
    "expression": expression,
    "tags": []
    },
    "auth": self.auth,
    "id": 1
    }


    I get error as {'code': -32602, 'message': 'Invalid params.', 'data': 'Cannot set "templateid" for trigger prototype "Free disk space is less than 20% on volume {#FSNAME}".'}

    Or wait a sec, it is readonly, so how does the trigger prototype get attached to the template, or whatever it should belong to?

    Any bright minds on this forum?

    Comment

    • draetze
      Junior Member
      • Sep 2025
      • 1

      #3
      Hello together,

      i face a similar problem currently, i try to automate the creation of our templates and now i want to create triggerprototypes, that are connected to lld discovery rules. Unfortunately i dont see any working way of doing it in the api object.

      I use zabbix version 7.0.16.

      Thanks.

      Regards
      Dean

      Comment

      Working...