opsgenie / oec-scripts

Opsgenie Edge Connector Custom Scripts
Apache License 2.0
23 stars 38 forks source link

Latest OEC-scripts 1.1.6 throws error on older OS releases / python versions #97

Open laugmanuel opened 1 year ago

laugmanuel commented 1 year ago

We are running Icinga2 on RHEL7. A few days ago, I've updated to the latest release of these scripts (which was a bit painful, because the version inside the package is still 1.1.5).

Just now, I've noticed that opened alerts using the new scripts do show an error in OpsGenie alert activity log:

Executed [Create] action via OEC[integrationId: <id> integrationType: Icinga2] with errors. Reason: Err: exit status 1, Stderr: 
Traceback (most recent call last): File "/home/opsgenie/oec/scripts/actionExecutor.py", line 388, in <module> main()
File "/home/opsgenie/oec/scripts/actionExecutor.py", line 371, in main send_create_request(is_service_alert)
File "/home/opsgenie/oec/scripts/actionExecutor.py", line 46, in send_create_request attach(is_service_alert) 
File "/home/opsgenie/oec/scripts/actionExecutor.py", line 122, in attach with tempfile.TemporaryDirectory() as tempdir:
 AttributeError: 'module' object has no attribute 'TemporaryDirectory'
ozlemmcokuk commented 6 months ago

Hi @laugmanuel Could you please check it with Icinga2-1.1.8_oec-1.1.4? Please let us know if the problem still exists