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

API "action.update" does not work properly

    XMLWordPrintable

Details

    • Incident report
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.8.8rc3, 1.9.7 (beta)
    • 1.8.9, 1.9.7 (beta)
    • API (A)
    • latest trunk r21920,
      latest 1.8 branch r21863

    Description

      Suppose we need to enable/disable an action by API.
      And we want to use ONLY "actionid": parameter to select corresponding action.

      Official documentation even has an examples with this operation, but it is partially wrong (actually disabled status is 1) and it does not work at all.
      http://www.zabbix.com/documentation/1.8/api/action/update
      http://www.zabbix.com/documentation/2.0/manual/appendix/api/action/update

      Current trunk and 1.8 branch have different behavior.
      In the trunk it works if we specify an action name (redundant data in our case)
      1.8 branch does not work AT ALL.

      See results of my tests:

                                                                • Zabbix 1.9 latest (trunk) ******************************

      >>>>>>>>>>>>>>>>>>> OK <<<<<<<<<<<<<<<<<:
      request:
      {
      "jsonrpc":"2.0",
      "method":"action.update",
      "params":

      { "actionid":"17", "name":"test19", "status":"1" }

      ,
      "auth":"ebe9ea3b39b7b7f00b39a04b50b3fdc8",
      "id":2
      }
      response:
      {
      "jsonrpc":"2.0",
      "result":

      { "actionids":[ "17" ] }

      ,
      "id":2
      }

      >>>>>>>>>>>>>>> BAD <<<<<<<<<<<<<<<<
      request:
      {
      "jsonrpc":"2.0",
      "method":"action.update",
      "params":

      { "actionid":"17", "status":"1" }

      ,
      "auth":"356d584f180937a9eeab315ba2935056",
      "id":2
      }
      response:
      {
      "jsonrpc":"2.0",
      "error":

      { "code":-32602, "message":"Invalid params.", "data":"Action \"\" already exists." }

      ,
      "id":2
      }

                                                                • Zabbix 1.8 ******************************

      >>>>>>>>>>>>>>>>> BAD <<<<<<<<<<<<<<<<<<<<<<<
      request:
      {
      "jsonrpc":"2.0",
      "method":"action.update",
      "params":

      { "actionid":"3", "name":"18test", "status":"1" }

      ,
      "auth":"bfcbc8dc41438a20652f4e0a672df8e5",
      "id":2
      }
      response:
      {
      "jsonrpc":"2.0",
      "error":

      { "code":-32602, "message":"Invalid params.", "data":"[ CAction::update ] Incorrect parameter used for Action [ 18test ]" }

      ,
      "id":2
      }

      >>>>>>>>>>>>>>>>>>>>> still BAD <<<<<<<<<<<<<<<<<<<<<<
      request:
      {
      "jsonrpc":"2.0",
      "method":"action.update",
      "params":

      { "actionid":"3", "status":"1" }

      ,
      "auth":"1e9508bf3a409223cf9f0e0dae39a866",
      "id":2
      }
      response:
      {
      "jsonrpc":"2.0",
      "error":

      { "code":-32602, "message":"Invalid params.", "data":"[ CAction::update ] Action [ ] already exists" }

      ,
      "id":2
      }

      >>>>>>>>>>>>>>> still BAD #2 <<<<<<<<<<<<<<<<<
      request:
      {
      "jsonrpc":"2.0",
      "method":"action.update",
      "params":

      { "actionid":"3", "name":"18test" }

      ,
      "auth":"7c6bd9ad0bf753a520e4f1c9a2258c15",
      "id":2
      }
      response:
      {
      "jsonrpc":"2.0",
      "error":

      { "code":-32602, "message":"Invalid params.", "data":"[ CAction::update ] Incorrect parameter used for Action [ 18test ]" }

      ,
      "id":2
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            zalex_ua Oleksii Zagorskyi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: