xxsokolov / Zabbix-Notification-Telegram

Sending notification from Zabbix server to the Telegram
MIT License
83 stars 28 forks source link

get_send_id() - zbxTelegram.py:392 - ERROR: Exception occurred: 'NoneType' object has no attribute 'type' #37

Closed Woart closed 1 year ago

Woart commented 2 years ago

Настройка сделана по-инструкции. при тестовой проверке выходит ошибка

/usr/lib/zabbix/alertscripts # ./zbxTelegram.py @server_admins test test [2021-10-12 19:59:06,487] - PID:3705967 - main() - zbxTelegram.py:498 - INFO: Send to Admin action: АХТУНГ [2021-10-12 19:59:06,487] - PID:3705967 - main() - zbxTelegram.py:499 - DEBUG: sys.argv: ['Admin', 'АХТУНГ', 'Это тестовое сообщение от Zabbix'] [2021-10-12 19:59:06,487] - PID:3705967 - main() - zbxTelegram.py:500 - DEBUG: Send to Admin action: АХТУНГ xml: Это тестовое сообщение от Zabbix [2021-10-12 19:59:06,488] - PID:3705967 - _new_conn() - connectionpool.py:227 - DEBUG: Starting new HTTP connection (1): 127.0.0.1:80 [2021-10-12 19:59:06,547] - PID:3705967 - _make_request() - connectionpool.py:452 - DEBUG: http://127.0.0.1:80 "POST /zabbix/ HTTP/1.1" 302 None [2021-10-12 19:59:06,569] - PID:3705967 - _make_request() - connectionpool.py:452 - DEBUG: http://127.0.0.1:80 "GET /zabbix/zabbix.php?action=dashboard.view HTTP/1.1" 200 None [2021-10-12 19:59:06,570] - PID:3705967 - main() - zbxTelegram.py:505 - INFO: Connection check passed (http://127.0.0.1/zabbix/) [2021-10-12 19:59:06,570] - PID:3705967 - get_send_id() - zbxTelegram.py:350 - INFO: Telegram API: method getUpdate: started [2021-10-12 19:59:06,571] - PID:3705967 - _new_conn() - connectionpool.py:971 - DEBUG: Starting new HTTPS connection (1): api.telegram.org:443 [2021-10-12 19:59:06,671] - PID:3705967 - _make_request() - connectionpool.py:452 - DEBUG: https://api.telegram.org:443 "GET /bot/getUpdates?timeout=20 HTTP/1.1" 200 1500 [2021-10-12 19:59:06,672] - PID:3705967 - get_send_id() - zbxTelegram.py:392 - ERROR: Exception occurred: 'NoneType' object has no attribute 'type' Traceback (most recent call last): File "/usr/lib/zabbix/alertscripts/zbxTelegram.py", line 369, in get_send_id if chat.type in ["group", "supergroup"] and chat.title and chat.title == send_to: AttributeError: 'NoneType' object has no attribute 'type'

xxsokolov commented 1 year ago

https://t.me/ZbxNTg