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

Hostgroup not assigned correctly, Agent autoregistration via API

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 5.0.4
    • API (A)
    • None

      It appears that the host group is not assigned correctly by API call.

      Request:

      {
      	"jsonrpc": "2.0",
      	"method": "action.create",
      	"params": {
      		"name": "Auto registration - windows",
      		"eventsource": 2,
      		"status": 0,
      		"filter": {
      			"evaltype": 0,
      			"conditions": [{
      					"conditiontype": 24,
      					"operator": 2,
      					"value": "Windows"
      				}
      
      			]
      		},
      		"operations": [
      			{
                      "operationtype": 4,
      				"opgroup": {
      					"groupid": "30"
      				}
      			}
      		]
      
      	},
      	"auth": "{{auth}}",
      	"id": 1
      }
       

      Response:

      {
          "jsonrpc": "2.0",
          "error": {
              "code": -32500,
              "message": "Application error.",
              "data": "SQL statement execution has failed \"INSERT INTO opgroup (operationid,groupid,opgroupid) VALUES ('68','3','25')\"."
          },
          "id": 1
      }

      By performing a few tests it looks like the app is taking only the first digit from group ID.
      For example, if the group "Custom name" with ID:27 are instructed, then it will try to add a group with ID:2

      If "Another group" with ID:17, then it will assign ID:1

            Unassigned Unassigned
            aigars.kadikis Aigars Kadikis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: