Closed WEBudoGT closed 1 year ago
Hi, thanks for your suggestions. Check out if the latest version i just uploaded works for you :)
BR
Thanks @joni1993 ! I pulled from git and restarted the service, but now when I try to acknowledge I get: The bot encountered an error. Please inform the administrator to check.
Thats odd - can you provide me some logs from the daemon?
How can I pull more logs than just the service status?
I got this:
● icinga-telegram-bot.service - Icinga Telegram Bot Loaded: loaded (/etc/systemd/system/icinga-telegram-bot.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-01-11 19:03:57 UTC; 1h 7min ago Main PID: 63454 (python) Tasks: 8 (limit: 2339) Memory: 27.6M CPU: 1.611s CGroup: /system.slice/icinga-telegram-bot.service └─63454 /opt/icinga-telegram-bot/venv/bin/python -m icingatelegrambot.app --config_file=icinga-telegram-bot.config
Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: File "/opt/icinga-telegram-bot/venv/lib/python3.9/site-packages/requests/sessions.py", line 581, in post Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: return self.request('POST', url, data=data, json=json, kwargs) Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: File "/opt/icinga-telegram-bot/venv/lib/python3.9/site-packages/requests/sessions.py", line 533, in request Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: resp = self.send(prep, send_kwargs) Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: File "/opt/icinga-telegram-bot/venv/lib/python3.9/site-packages/requests/sessions.py", line 646, in send Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: r = adapter.send(request, **kwargs) Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: File "/opt/icinga-telegram-bot/venv/lib/python3.9/site-packages/requests/adapters.py", line 416, in send Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: self.cert_verify(conn, request.url, verify, cert) Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: File "/opt/icinga-telegram-bot/venv/lib/python3.9/site-packages/requests/adapters.py", line 227, in cert_verify Jan 11 19:04:03 monitoris icinga-telegram-bot[63454]: raise IOError("Could not find a suitable TLS CA certificate bundle, "
Nevermind... I got how to run it and see stdout errors and got this:
caused error "Could not find a suitable TLS CA certificate bundle, invalid path: "/var/lib/icinga2/ca/ca.crt"" File "/opt/icinga-telegram-bot/venv/lib/python3.9/site-packages/telegram/ext/dispatcher.py", line 390, in process_update handler.handle_update(update, self, check, context)
So I guess it's something unrelated to the api cert :(
Does the var/lib/icinga2/ca/ca.crt File exist and contains a valid certificate? If yes can the Daemon access it?
Personally I copied the file over to the bot - maybe the docs should cover that a little better..
Thanks for the quick replies @joni1993 ;) The file existed, but I didn't have a cert for the telegram api client, so I followed this guide:
https://icinga.com/blog/2022/11/16/authenticating-icinga-2-api-users-with-tls-client-certificates/
Now it's working perfectly! I wanted to thank you because of this great work you did making this software. I've always wanted to be able to quickly aknowledge problems and keep track of who did, and this solves that need. It's awesome!!!
Great the hear!
Thank you ☺️
When acknowledging alerts, it would be nice to have the Telegram User's name that issued the acknowledge to be able to track who's in charge of handling the situation.