zabbix-cachet icon indicating copy to clipboard operation
zabbix-cachet copied to clipboard

Add support of Zabbix 6+

Open atulsharma3 opened this issue 2 years ago • 10 comments

We are trying to integrate zabbix-cachet with zabbix 6,

getting below error in logs

2022-08-02 12:33:10 INFO: (MainThread) Zabbix ver: 6.0.6. Cachet ver: 2.4.0-dev 2022-08-02 12:33:10 ERROR: (MainThread) Zabbix Error: ('Error -32602: Invalid params., Invalid parameter "/": unexpected parameter "selectDependencies".', -32602) 2022-08-02 12:33:10 ERROR: (MainThread) Sorry, can not create Zabbix <> Cachet mapping for you. Please check above errors

atulsharma3 avatar Aug 02 '22 12:08 atulsharma3

Same problem here, would be great if @qk4l could make it work with zabbix 6+.

kelsen avatar Aug 16 '22 14:08 kelsen

Same problem with version 6.0.9... Hope it's gonna be fixed, but I saw the last edit was 16 months ago...

quentinbrw avatar Oct 14 '22 08:10 quentinbrw

I ended up creating a bash script, mapping components manually through zabbix' tags and media.

kelsen avatar Oct 14 '22 11:10 kelsen

can you share your script @kelsen ? it may help us :)

quentinbrw avatar Oct 14 '22 13:10 quentinbrw

Basically you have to put this script on Zabbix AlertScript directory (/usr/lib/zabbix/alertscripts/). Configure Zabbix triggers' tags scope and service. Create Zabbix' media with content below as message body, both incident and recovery message type.

host: {HOST.NAME}
severity: {EVENT.NSEVERITY}
scope: {EVENT.TAGS.scope}
service: {EVENT.TAGS.service}
status: {TRIGGER.VALUE}

Customize script to mapp zabbix service or hostname to cachet component.

cachet.zip

kelsen avatar Oct 14 '22 17:10 kelsen

Hi, I am working to get Zabbix-Cachet compatible with Zabbix 6.0. Although I've not finished, I can say it works (with some limitations). I've forked this repository into my account, you can check it here.

The "service" definition of Zabbix has changed. I've updated from Zabbix 4 to Zabbix 6, so I don't know how Zabbix services 5 were. With Zabbix 6, triggers are not linked to services anymore. As with Zabbix 6 API it's not possible to get the triggers from the service, there are some issues:

  • My version does not support automatic trigger problem acknowledgments. You must acknowledge them from Cachet.
  • Trigger names, URL and descriptions cannot be gotten.

There might be some bugs on the code, I'm currently working on it as we need it on our organization. You're welcome to try it and create issues on my repository. When I consider the work finished, I'll make a pull request here.

oscarsanchezdm avatar Oct 26 '22 17:10 oscarsanchezdm

Hello,

Thank you guys, for reporting and forks and tries to fix it. I will deploy Zabbix 6.0 on this weekends and will try to find properly solution.

qk4l avatar Oct 28 '22 09:10 qk4l

Hello, I've finished my work. These are the changes I've made:

  • Change trigger references to service references
  • New template for customizing incident description, as with Zabbix6 it's not possible to get trigger problems. You'll have to delete all the component and component groups to make sure zabbix-cachet correctly maps component/groups with services.

oscarsanchezdm avatar Oct 28 '22 09:10 oscarsanchezdm

The issue which is described changes with Services in Zabbix 6.0 https://support.zabbix.com/browse/ZBXNEXT-6674

qk4l avatar Oct 30 '22 18:10 qk4l

Thank you for the link. I'll take a look. We migrated from Zbx4 to Zbx6, upgrading the database, and the this is how our services look now. The trigger IDs are inside Service value field (in this case 101011) and the name field is ServiceLink. Captura de pantalla 2022-10-30 a les 19 32 09

oscarsanchezdm avatar Oct 30 '22 18:10 oscarsanchezdm

As far as I remember, I solved the problem here - https://github.com/pavelnemirovsky/zabbix-cachet, created PR as well - https://github.com/qk4l/zabbix-cachet/pull/71

pavelnemirovsky avatar Apr 15 '24 11:04 pavelnemirovsky

I'm working here https://github.com/qk4l/zabbix-cachet/tree/zabbix6 Hope to finished this weekend

qk4l avatar Apr 29 '24 14:04 qk4l

@qk4l, pay attention to the PR above, it works with Zabbix 6.0 - 6.4

pavelnemirovsky avatar Apr 30 '24 12:04 pavelnemirovsky

@qk4l, pay attention to the PR above, it works with Zabbix 6.0 - 6.4

2024-05-03 08:27:32 INFO: (MainThread) Zabbix ver: 6.0.13. Cachet ver: 2.4.1 2024-05-03 08:27:32 ERROR: (MainThread) Zabbix Error: ('Error -32602: Invalid params., Invalid parameter "/": unexpected parameter "selectDependencies".', -32602) 2024-05-03 08:27:32 ERROR: (MainThread) Sorry, can not create Zabbix <> Cachet mapping for you. Please check above errors

I tried it on your version, the result is the same(

Solbadguy avatar May 03 '24 08:05 Solbadguy

@pavelnemirovsky Thank you for your PR!

I've incorporated parts of it into the codebase. The refactorization and separation into multiple files greatly enhances maintainability, albeit adding some complexity to the deployment process. To streamline this, I'll be deploying a PyPI package shortly.

For not the easiest way would be to use docker image

docker run --name zabbix-cachet -v $PATH_TO_CONFIG_FILE:/config.yml qk4l/zabbix-cachet:2.0.0

I've conducted testing on Zabbix versions 5.0, 6.0, and 6.4, and haven't encountered any issues except for the unimplemented escalation priority feature. Please verify that everything you require functions as expected, and do let me know if there are any discrepancies.

Big thanks to everyone for your collaboration and waiting. Your contributions are immensely valued and appreciated.

qk4l avatar May 05 '24 01:05 qk4l

Implemented since zabbix-cachet 2.0.0

Thanks again everyone for help and pushing me. =)

qk4l avatar May 26 '24 20:05 qk4l