Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'message_id' #188

Open
rmalenko opened this issue Dec 24, 2019 · 2 comments
Open

KeyError: 'message_id' #188

rmalenko opened this issue Dec 24, 2019 · 2 comments

Comments

@rmalenko
Copy link

Helo,

I have got this error

zbxtg.py: {'ok': True, 'result': {'id': 1054514541, 'is_bot': True, 'first_name': '***_alert', 'username': '****_bot'}}
zbxtg.py: Cache file with uids: /var/tmp/zbxtg/uids.txt
zbxtg.py: Telegram uid of group '9******68': 9******68
zbxtg.py: http://zabbix-***.com/chart3.php?from=now-10800&to=now&name=ah-s**.com%20-%20zabbix-agent%20service%20not%20running&width=900&height=200&graphtype=0&legend=1&items[0][itemid]=29689&items[0][sortorder]=0&items[0][drawtype]=5&items[0][color]=00CC00
{'ok': True, 'result': {'id': 1054514541, 'is_bot': True, 'first_name': '***_alert', 'username': '***_father_bot'}}
Traceback (most recent call last):
File "/etc/zabbix/alertscripts/zbxtg.py", line 939, in <module>
main()
File "/etc/zabbix/alertscripts/zbxtg.py", line 899, in main
message_id = tg.result["result"]["message_id"]
KeyError: 'message_id'
@jtprogru
Copy link

I commented out the line with checking this key - this solved the problem

@ableev
Copy link
Owner

ableev commented Dec 25, 2019

I don't know the input and don't know what's inside the telegram's answer.
Do as it said: https://github.com/ableev/Zabbix-in-Telegram/wiki/How-to-test-script-in-command-line
Use actual data from zabbix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants