Open-Future-Belgium / zabbix-Rocket.Chat

Integration between zabbix & Rocket.Chat
29 stars 19 forks source link

Can't get Zabbix to send the alert. #3

Closed tiredofit closed 5 years ago

tiredofit commented 6 years ago

Zabbix 3.4.5 - File sitting in /usr/lib/zabbix/alertscripts/rocketchat.sh Has appropriate permissions for executing. Can execute from bash, sends a semi colon to my Rocketchat Instance.

Have setup the Media Type and script rocketchat.sh Have setup a user with notification set to use rocketchat.sh Have created the Default Message as per shown example. Nothing. I get email notifications, but even looking at the Reports of Notifications shows that the Rocketchat script isn't fired. Log's aren't saying much. Any advice?

Trikke76 commented 6 years ago

Hi,

i just upgraded my zabbix from 3.2 to 3.4 and the script still works try to send something from command line with the script if this works it is maybe due to a formatting error in your action / conditions

i noticed that someone made a PR for an issue with the log thats why you see nothing in it you can remove the 1 in front and just keep

${LOGFILE} 2>&1

then you will get a log of all messages and errors in the log file

hubars commented 5 years ago

Hi, this configuration works fine for me:

  1. Script path /usr/lib/zabbix/alertscripts/rocket-chat/rocket.sh/rocket.sh

  2. Make a file executable chmod +x rocket.sh && chown zabbix.zabbix rocket.sh

  3. Add new Media Type rocket_zabbix_01

  4. Add Action rocket_zabbix_02 rocket_zabbix_03

  5. Add new Medua Type in setting User (sebbix) rocket_zabbix_04

  6. Add new incoming WebHook in Rocket.Chat and copy Webhook URL to script rocket.sh

  7. Add new user in Rocket.Chat (sebbix) and add the same username in script rocket.sh

wit12345 commented 5 years ago

Hi,

I have to create an user on zabbix server? In your case the sebbix?

Thank you

hubars commented 5 years ago

Hi, yes - in my case i have the same name of user in zabbix and rocket.chat.

wit12345 commented 5 years ago

Hi,

When I execute from bash, sends a notification to my Rocketchat Instance with success but with the Web configuration I can't get my notifications on Rocket Chat.

I've looked in my Reports of Notifications and shows that the Rocketchat script is fired with success but I can't understand what I've missed.

Can you help me ?

Trikke76 commented 5 years ago

probably the information that you send has an issue try to send a simple short text string probably it will work

wit12345 commented 5 years ago

Hi, Yes , with simple text works fine for the Problem but for OK or ACK I didin't get any notifications

Trikke76 commented 5 years ago

maybe check the header can be an issue in the header name as it should work the same way for all notifications

wit12345 commented 5 years ago

It's working now. It's seems the messages have to be simple, for example in OK to work I have changed the default message to:

`Default subject OK: {HOST.HOST}

Default message {TRIGGER.NAME} ` and now it's working fine.

Thank you all

Trikke76 commented 5 years ago

ok gr8

feel free to improve the script if you want i will close this for now and try to improve it when i have some free time