rauhmaru / rocketchat-zabbix

Sends Zabbix notifications to Rocket.Chat, an Open Source Slack Alternative
14 stars 5 forks source link

Error performing action #1

Closed leandromoreirati closed 5 years ago

leandromoreirati commented 5 years ago

Dear good afternoon I followed his documentation to integrate zabbix with the rocket chat, but at the time he performs the action he is returning the error below:

image

Can you please give me a hint how to solve.

Att.

rauhmaru commented 5 years ago

Leandro, qual a versão do seu Zabbix?

leandromoreirati commented 5 years ago

Boa noite Raul, como vai

Estou usando a versao 4.0.7.

Att.

rauhmaru commented 5 years ago

Leandro, vou subir um lab pra simular com essa versão, e darei um retorno. Como estou em um ambiente legado, uso a versão 2.4.5, mas atualizarei para mais recentes. Creio que o erro pode estar na ordem dos argumentos do script python.

leandromoreirati commented 5 years ago

Raul,

Muito obrigado pela atenção, fico no aguardo.

Att.

Em seg, 20 de mai de 2019 15:41, Raul Libório notifications@github.com escreveu:

Leandro, vou subir um lab pra simular com essa versão, e darei um retorno

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rauhmaru/rocketchat-zabbix/issues/1?email_source=notifications&email_token=AHK3WLLNZVHGISOYALNPZKLPWLWFNA5CNFSM4HNP4X22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZW6SQ#issuecomment-494104394, or mute the thread https://github.com/notifications/unsubscribe-auth/AHK3WLM6EOTQ47BY6A7SVETPWLWFNANCNFSM4HNP4X2Q .

AlKosmos commented 5 years ago

I can confirm. Unfortunately, I am getting the same issue without media script parameters in Zabbix 4.0.7.

Traceback (most recent call last):
File "/usr/lib/zabbix/alertscripts/rocketchat.py", line 7, in <module>
url = sys.argv[1]
IndexError: list index out of range

If i add the script parameters for Media type manually:

{ALERT.SENDTO}
{ALERT.SUBJECT}
{ALERT.MESSAGE} 

Action has the status "Sent", but I am not getting anything in RocketChat.

leandromoreirati commented 5 years ago

Hi, AlKosmos!

I make same test, inclur the variables:

{ALERT.SENDTO} {ALERT.SUBJECT} {ALERT.MESSAGE}

In the media configuration, it return "Send Menssage", but not sending.

At.

petqa commented 5 years ago

good day, same issue on 4.2.3, any fixes?

rauhmaru commented 5 years ago

Hi, sorry for delay.

  1. The python script was missing a line at the end:
#!/usr/bin/python

import sys
import requests
import json

url     = sys.argv[1]
subject = sys.argv[2]
body    = sys.argv[3]

r = requests.post(url, body)
  1. Config with this parameters:

Image of Config

And will works.

I apologize to everyone for their inattention.

petqa commented 5 years ago

thank you, alerts working now, but now i'm not getting images from alerts

No permissions to referred object or it does not exist

rauhmaru commented 5 years ago

As images are brought from zabbix via the link, then, in order to have access, you must be logged in.

Another point is that the rocketchat should be able to reach zabbix so that the images can be viewed.

petqa commented 5 years ago

Can you please describe in more detail how I should make an entry in zabbix, by editing the source python script?

rauhmaru commented 5 years ago

@petqa, I do not understand what you want. You refer a the alertscript in the zabbix? Only the last line in the script was missing, sending the information to the chat.