nisabek / icinga2-slack-notifications

Icinga2 notification integration with slack
Apache License 2.0
71 stars 36 forks source link

slack-notifications icinga2 director #33

Closed oldenstam closed 1 year ago

oldenstam commented 3 years ago

Hi everyone!

Love the project, and have seen there isn't too much work put on it anymore. Hope it changes :)

I have a problem I hope someone have some input to.

Running 2 icinga2 servers and replication between the two databases. Putting the .conf files from /src from the repo in /etc/icinga2/zones.d/slack-notifications and created a datafield and field for the "Default host template" but still no vars.slack_notifications = "enabled" when I deploy my changes.

If I however put the *.conf files in /etc/icinga2/zones.d/master/slack-notifications Icinga2 won't even come up again after a restart:

Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: The above exception was the direct cause of the following exception: Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: Traceback (most recent call last): Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/quart/app.py", line 1451, in handle_request Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: return await self.full_dispatch_request(request_context) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/quart/app.py", line 1473, in full_dispatch_request Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: result = await self.handle_user_exception(error) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/quart/app.py", line 892, in handle_user_exception Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: raise error Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/quart/app.py", line 1471, in full_dispatch_request Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: result = await self.dispatch_request(request_context) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/quart/app.py", line 1519, in dispatch_request Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: return await handler(**request_.view_args) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/icinga2_exporter/proxy.py", line 49, in get_ametrics Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: await asyncio.get_event_loop().create_task(monitor_data.get_perfdata()) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/icinga2_exporter/perfdata.py", line 51, in get_per fdata Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: data_json = await self.monitor.async_get_perfdata(self.query_hostname) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/icinga2_exporter/monitorconnection.py", line 154, in async_get_perfdata Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: data_json = await self.async_post(self.url_query_service_perfdata, body) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/icinga2_exporter/monitorconnection.py", line 170, in async_post Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: data=json.dumps(body)) as response: Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/aiohttp/client.py", line 1012, in __aenter__ Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: self._resp = await self._coro Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/aiohttp/client.py", line 483, in _request Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: timeout=real_timeout Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/aiohttp/connector.py", line 523, in connect Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: proto = await self._create_connection(req, traces, timeout) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/aiohttp/connector.py", line 859, in _create_connection Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: req, traces, timeout) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: raise last_exc Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/aiohttp/connector.py", line 986, in _create_direct_connection Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: req=req, client_error=client_error) Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: File "/opt/icinga2-exporter/venv/lib64/python3.6/site-packages/aiohttp/connector.py", line 943, in _wrap_create_connection Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: raise client_error(req.connection_key, exc) from exc Feb 23 11:31:30 bn-p-monitor302 gunicorn[236440]: aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 127.0.0.1:5665 ssl:False [Connection refused]

I am sure I have missed something, but maybe someone can point me in the right direction :)

Darkentik commented 2 years ago

@oldenstam is this still broken? If yes, please be so kind and share more information about your setup and how your configs look like.

oldenstam commented 1 year ago

@Darkentik I'm not sure - doesn't work in that company anymore :) I think it is still broken however.✌️