zabbix-review-export-import icon indicating copy to clipboard operation
zabbix-review-export-import copied to clipboard

Add zabbix 5.4 support

Open jurim76 opened this issue 3 years ago • 6 comments

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.

jurim76 avatar Jul 18 '21 19:07 jurim76

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?

gjaekel avatar Aug 17 '21 13:08 gjaekel

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.

evgkrsk avatar Aug 17 '21 16:08 evgkrsk

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 https://github.com/southbridgeio/zabbix-review-export-import/blob/ddbad3c2aadcf74c693fdc86761cb5ac22fecf7e/zabbix-import.py#L1064-L1094

gjaekel avatar Aug 17 '21 17:08 gjaekel

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

fauust avatar Nov 11 '21 11:11 fauust

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.

jurim76 avatar Nov 16 '21 15:11 jurim76

zabbix api 5.4.10

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

roysbike avatar Feb 09 '22 05:02 roysbike