express42 / zabbixapi

Ruby wrapper to Zabbix API
MIT License
131 stars 128 forks source link

usergroup.massadd is deprecated in 4.x and should be replaced by usergroup.update #94

Closed testaccountje closed 3 years ago

testaccountje commented 5 years ago

After updating our Zabbix servers to version 4.0.5 I'm experiencing this error:

/usr/local/rvm/gems/ruby-2.3.1/gems/zabbixapi-4.1.0/lib/zabbixapi/client.rb:127:in `_request': Server answer API error (ZabbixApi::ApiError)
 {
  "code": -32602,
  "message": "Invalid params.",
  "data": "Incorrect method \"usergroup.massAdd\"."
}
 on request:
 {
  "method": "usergroup.massAdd",
  "params": {
    "usrgrpids": [
      54
    ],
    "rights": [
      {
        "permission": 2,
        "id": "1"
      },
   ..
      {
        "permission": 2,
        "id": "197"
      }
    ]
  },
  "id": 10757,
  "jsonrpc": "2.0",
  "auth": “xxx”
}
from /usr/local/rvm/gems/ruby-2.3.1/gems/zabbixapi-4.1.0/lib/zabbixapi/client.rb:145:in `api_request'
from /usr/local/rvm/gems/ruby-2.3.1/gems/zabbixapi-4.1.0/lib/zabbixapi/classes/usergroups.rb:32:in `set_perms'

which is a result of the deprecation of 'usergroup.massadd, usergroup.massupdate' among others. see:

Splyth commented 5 years ago

I think the solution in this case is to bump our supported versions, remove these functions and run our tests to make sure everything is kosher.

Any objections?

@snehitgajjar

anapsix commented 3 years ago

afaik, the issue is no longer relevant