Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zabbix 5.4 support #10

Open
jurim76 opened this issue Jul 18, 2021 · 6 comments
Open

Add zabbix 5.4 support #10

jurim76 opened this issue Jul 18, 2021 · 6 comments

Comments

@jurim76
Copy link

jurim76 commented Jul 18, 2021

Export throws an errors, while dumping screens, dashboards, users and valuemaps from Zabbix 5.4.2.
Also templates have yaml format by default and user's alias changed to username.

@gjaekel
Copy link

gjaekel commented Aug 17, 2021

We also about to switch to 5.4.2. While there is an on-the-fly migration of screens to dashboards, there's still no ex-/import for dashboards.

Formerly, we use a screen generator tool. This is cut-off, because after migration, there's seems no possibility to "import-and-convert" screens, anymore.

We might rewrite our tool to create dashboards. But at the moment, there seems also no possibility to import dashboards, right?

@evgkrsk
Copy link
Contributor

evgkrsk commented Aug 17, 2021

PR-s are welcome. Unfortunately, we don't have zabbix-5.4 stand right now.

There is support for dashboard import, but it is poorly tested on 5.x branches.

@gjaekel
Copy link

gjaekel commented Aug 17, 2021

We used ex- and import on our 4.4.2 and I works for us, i.e. for the Zabbix features we use.

We'll try to investigate the code and develop patches.

I found that zabbix_import seems to fail on retreiving users even if I use something without like a dashboard YAML as input. On https://www.zabbix.com/documentation/current/manual/api/changes_5.2_-_5.4 I found the "first big change":

user

Changes:
ZBXNEXT-6474 user.login: Renamed parameter user → username.
ZBXNEXT-6474 Renamed field alias → username in user object.

How you would handle this? In a way that's up- and downward compatible, i.e. get the API version and switch exported tags, but try to convert at import? Well, probably like

# 3->4 import:
if (
condition["conditiontype"] == 16
and condition["operator"] == 7
and api_version >= parse_version("4.0")
): # not in maintenance/suppression
condition[
"operator"
] = 11 # new in 4.x: see https://www.zabbix.com/documentation/4.2/manual/api/reference/action/object#action_filter_condition
if (
condition["conditiontype"] == 16
and condition["operator"] == 4
and api_version >= parse_version("4.0")
): # in maintenance/suppression
condition[
"operator"
] = 10 # new in 4.x: see https://www.zabbix.com/documentation/4.2/manual/api/reference/action/object#action_filter_condition
# 4->3 import:
if (
condition["conditiontype"] == 16
and condition["operator"] == 11
and api_version < parse_version("4.0")
): # not in maintenance/suppression
condition["operator"] = 7
if (
condition["conditiontype"] == 16
and condition["operator"] == 10
and api_version < parse_version("4.0")
): # in maintenance/suppression
condition["operator"] = 4

@fauust
Copy link

fauust commented Nov 11, 2021

Hi, I have only tested on yaml export, the following works on Zabbix 5.4.7:

sed 's/alias/username/g' -i zabbix-export.py

Off course this renders the script incompatible with previous Zabbix versions.

I am only exporting the following:

  • hosts
  • groups
  • templates
  • mediatypes
  • usergroups
  • users
  • proxy
  • globalmacro
  • maintenances
  • actions
  • usermacro

@jurim76
Copy link
Author

jurim76 commented Nov 16, 2021

Hi, I have only tested on yaml export, the following works on Zabbix 5.4.7:

sed 's/alias/username/g' -i zabbix-export.py

Off course this renders the script incompatible with previous Zabbix versions.

Mostly screens and dashboards are affected.

@roysbike
Copy link

roysbike commented Feb 9, 2022

zabbix api 5.4.10

2022-02-09 05:20:29,486 ERROR ('Error -32602: Invalid params., Invalid parameter "/options": unexpected parameter "valueMaps".', -32602)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants