Giter VIP home page Giter VIP logo

zabbix-google-chat's People

Contributors

thiagomdiniz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zabbix-google-chat's Issues

Widget notificação

Olá Thiago, primeiramente parabéns pelo script, implementei em nosso servidor Zabbix e esta funcionando com perfeição.

Gostava apenas de tirar uma duvida, e talvez solucionar um probleminha que temos.
Quanto chega da notificação, não sabemos exatamente qual serviço/host gerou aquela notificação,
no corpo da notificação aparece apenas as informações que mostro na imagem abaixo.

Zabbix-GoogleChat

Sei que "ZS Zabbix" é o nome que defini no webhook do Google Chat, mas "(App)" e "(Zabbix)" não encontro onde são definidos e se há possibilidade de capturar o host que gerou o evento, para assim, exibir logo na notificação.

Desde já, obrigado e mais uma vez parabéns

URL defaults to HTTPS

Our server is internal only and we want to pass http thru the URL. It's set in the .ini but the 'view in zabbix' button forces https.

Mobile Notification Attachment

Hello,

Thanks for your work Thiago ! Do you have any tips for the mobile notification, currently i've this message
"Monitoring Zabbix : sent you an attachment "

With my rocketchat connector i can send object directly in the notification, but i didn't find with Google Chat, do you have any idea ?

Dependencies error

Quando simulo um erro pra testar o envio, recebo esse alerta:

Traceback (most recent call last):
File "/usr/lib/zabbix/alertscripts/google_chat.py", line 3, in <module>
from httplib2 import Http
ImportError: No module named httplib2

Mas eu instalei as dependências.
Não consegui rastrear o motivo. Alguém tem alguma idéia?

Grato

Edit:
Ao instalar as dependências deveria ter instalado com o usuário que executa o processo do Zabbix (no meu caso sudo) e não o usuário Zabbix.

Mesmo assim deu erro.
No meu caso foi uma série de fatores:

  • Espaços nas mensagens padrão (tirei todos os espaços)
  • Erro de digitação no Media Type

Sugestão pra quem tiver problemas:

Pra mim ainda ficou um problema que não sei se é erro ou funcionalidade:
Ao enviar uma notificação, no Chats as mensagens ficam agrupadas por tipo (erro, recuperação, reconhecimento). Acho que seria mais lógico ficar agrupado por Incidente.

Issue with sending messages

Ei, não tenho certeza se você ainda está lidando com problemas de suporte, mas estou tendo um problema ao enviar mensagens. Ao atingir a etapa de validação de saúde da sua publicação no medium.com, recebo o seguinte erro:

Traceback (most recent call last):
File "./google_chat.py", line 244, in
cs.sendMessage(event)
File "./google_chat.py", line 74, in sendMessage
time = event[1]
IndexError: list index out of range

Até agora, verifiquei todas as minhas configurações, mas ainda não encontrei o problema, qualquer ajuda seria apreciada.


Hey, not sure if you're still handling any support issues, but I'm having an issue with sending messages. When reaching the validating Health step of your medium.com post, I get the following error:

Traceback (most recent call last):
File "./google_chat.py", line 244, in
cs.sendMessage(event)
File "./google_chat.py", line 74, in sendMessage
time = event[1]
IndexError: list index out of range

I've double checked all my settings thus far but I have yet to find the issue, any help would be appreciated.

Failure with TRIGGER.ID in event[0]

After setting this up step by step i am able to send test nofitications manually, however when triggered with real data it appears to fail with the following.

Traceback (most recent call last):
File "/etc/zabbix/alertscripts/google_chat.py", line 244, in
cs.sendMessage(event)
File "/etc/zabbix/alertscripts/google_chat.py", line 197, in sendMessage
if self.trigger_id in self.evt_thread:
AttributeError: ChatSender instance has no attribute 'trigger_id'

Using zabbix 4.2.1

Problemas no CentOS com Python e Dependências

Apenas para colaborar, com quem for implantar a solução no CentOS, use Python3:

Para instalar, siga esses comandos em sequência:
sudo yum install epel-release
sudo yum update
sudo yum install python3-pip

Para instalar as dependências, utilize pip3:
pip3 install httplib2
pip3 install configparser

O Comando para teste ficará assim:
/usr/bin/python3 ./google_chat.py TestRoom 1#{EVENT.RECOVERY.TIME}#{EVENT.RECOVERY.DATE}#{TRIGGER.NAME}#{HOST.NAME}#{TRIGGER.SEVERITY}#{EVENT.ID}#{TRIGGER.URL}#{TRIGGER.ID}#- {HOST.DESCRIPTION}

Altere a primeira linha do arquivo google_chat.py para:
#!/usr/bin/python3

[Zabbix issue]

Hi @thiagomdiniz

Did you face this issue when you try to send the message? I have this warning:
Traceback (most recent call last):
File “/usr/lib/zabbix/alertscripts/google_chat.py”, line 245, in
cs.sendMessage(event)
File “/usr/lib/zabbix/alertscripts/google_chat.py”, line 198, in sendMessage
if self.trigger_id in self.evt_thread:
AttributeError: ChatSender instance has no attribute ‘trigger_id’
Can you help me please?

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.