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

Zabbix API addmedia server answer fine but media not added

    Details

    • Type: Incident report
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 2.2.10
    • Fix Version/s: None
    • Component/s: API (A)
    • Labels:
    • Environment:
      Zabbix 2.2.10
      ruby 1.9.3p484
      zabbixapi (2.2.0)

      Description

      Hallo,

      I am writing a ruby script with https://github.com/express42/zabbixapi (2.2.0) for automated synchronisation of zabbix users and our directory service.

      When trying to add media to an user, the request and the answer of the zabbix server looks ok but the media actually was not added.

      Code snippet to add media

       $zbxCon.users.add_medias(
              :userids => [$zbxCon.users.get_id(:alias => key)],
              :media => user_media
            )
       user_media << {"mediatypeid" => media_attr["id"], "sendto" => value[media_attr["media_name"]], "active" => 0, "severity" => media_attr["severity"],
            "period" => "1-5,08:00-18:00" }
      
      [DEBUG] Send request: {"method":"user.addmedia","params":{"users":[{"userid":"200200000000012"}],"medias":[{"mediatypeid":"200200000000001","sendto":"xxxx@xx.de","active":0,"severity":48,"period":"1-5,08:00-18:00"},{"mediatypeid":"200200000000002","sendto":"xxxx@xx.de","active":0,"severity":48,"period":"1-5,08:00-18:00"}]},"auth":"2a899fsd4994fga52041a0df5sfac8","id":65214,"jsonrpc":"2.0"}
      [DEBUG] Timeout for request set to 60 seconds
      [DEBUG] Get answer: {"jsonrpc":"2.0","result":{"mediaids":["200200000000240","200200000000241"]},"id":65214}
      

      Updating media is working correctly

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pemi1337 Michael Peter
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: