Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16713

API agent auto registration (action.create) sample is missing

XMLWordPrintable

    • Icon: Documentation task Documentation task
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 5.0 (plan)
    • 4.0.12
    • Documentation (D)
    • None
    • Team D
    • Sprint 57 (Oct 2019), Sprint 58 (Nov 2019)

      Please give our documentation page a sample on how to create an agent autoregistration rule (eventsource:2) through API.

      Here is one sample I found working:
      Add the device to host group 'Linux servers' when the hostname contains 'SRV' OR Metadata contains 'Linux'.

      API call:

      {
          "jsonrpc": "2.0",
          "method": "action.create",
          "params": {
              "name": "register linux",
              "eventsource": "2",
              "status": "0",
              "def_shortdata": "custom subject",
              "def_longdata": "custom message",
               "filter": {
                      "evaltype": "2",
                      "formula": "A or B",
                      "conditions": [
                          {
                              "conditiontype": "22",
                              "operator": "2",
                              "value": "SRV",
                              "value2": "",
                              "formulaid": "B"
                          },
                          {
                              "conditiontype": "24",
                              "operator": "2",
                              "value": "CentOS",
                              "value2": "",
                              "formulaid": "A"
                          }
                      ]
                  },
              "operations": [
                      {
                          "actionid": "9",
                          "operationtype": "4",
                          "esc_period": "0",
                          "esc_step_from": "1",
                          "esc_step_to": "1",
                          "evaltype": "0",
                          "opgroup": [
                              {
                                  "operationid": "16",
                                  "groupid": "2"
                              }
                          ]
                      }
                  ]
          },
          "auth": "7ecc86b762f63fa19e5bfd71b83415fd",
          "id": 1
      } 

            agriscenko Andrejs Griščenko
            aigars.kadikis Aigars Kadikis
            Team D
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: