[ZBX-9797] Zabbix API addmedia server answer fine but media not added Created: 2015 Aug 20  Updated: 2017 May 30

Status: Open
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 2.2.10
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Michael Peter Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: dm
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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":"[email protected]","active":0,"severity":48,"period":"1-5,08:00-18:00"},{"mediatypeid":"200200000000002","sendto":"[email protected]","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



 Comments   
Comment by richlv [ 2015 Aug 20 ]

mediaids 200200000000240, 200200000000241 - do they exist in the database, do they look like the data in the request ?

Comment by Michael Peter [ 2015 Aug 20 ]

no they don't exist in the database

Comment by Oleksii Zagorskyi [ 2015 Aug 21 ]

IDs look like from a child node, supposedly.

Take into account that nodes support still was in 2.2 ... but currently has been removed.

There were many issues related to nodes which currently closed as won't fix ...
It's easily possible that there is a bug, reproducible on node-based setup only, which will not be fixed ...

Comment by Daniel Poßmann [ 2015 Sep 09 ]

It was converted to a node based setup with 1.8.x. But now only the IDs look like in a node based setup. Only proxies are used.
ID 2 is only since it was the second node which had been converted. It was the master in the time we connected our two zabbix instances (with 2.0 for a few months).

I couldn't find a way to revert the IDs and didn't bother looking for too long since they are only IDs, i hope. If you have a way to revert it to standalone IDs, we could give it a try.

EDIT: The NodeID setting is still active, so perhaps it's not really in standalone mode (though it's practically standalone). Will try to get rid of the node ID (seems that it has to stay enabled since it you would have to revert the distributed monitoring changes, what's not supported)

Comment by richlv [ 2015 Sep 10 ]

could you please clarify where the NodeID setting is specified ?

Comment by Daniel Poßmann [ 2015 Sep 10 ]

In the Server config:

/etc/zabbix/zabbix_server.conf:NodeID=2
Comment by richlv [ 2015 Sep 10 ]

hmm, and that's with which version of zabbix server ? is server really using that file ?

Comment by Daniel Poßmann [ 2015 Sep 10 ]

It's the version Michael mentioned (Zabbix 2.2.10) since it's the same server we are talking about (we are colleagues).

Comment by richlv [ 2015 Sep 15 ]

ok, so you are indeed running in a dm mode, which ended up being removed in 2.4. as zalex noted, it is quite unlikely this issue would be looked into.

Comment by Daniel Poßmann [ 2015 Sep 15 ]

Is there a way to disable dm mode or should we wait until we upgrade to 2.4 and let the upgrade handle this?

Comment by richlv [ 2015 Sep 15 ]

there is no way to disable dm mode. note that it is not clear whether it's dm related or not at this point

Generated at Thu Apr 25 08:31:53 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.