Hello,
I have a check_mk instance (2.0) deployed in Docker. In there, I have a custom notification sripts that’s supposed to open SNOW tickets. Unfortunately it fails with below error:
2021-07-28 10:29:57,777 [20] [cmk.base.notify] Output: Traceback (most recent call last):
2021-07-28 10:29:57,777 [20] [cmk.base.notify] Output: File "/omd/sites/cmk/local/share/check_mk/notifications/sr_servicenow_plugin", line 293, in <module>
2021-07-28 10:29:57,778 [20] [cmk.base.notify] Output: Plugin().notify()
2021-07-28 10:29:57,778 [20] [cmk.base.notify] Output: File "/omd/sites/cmk/local/share/check_mk/notifications/sr_servicenow_plugin", line 290, in notify
2021-07-28 10:29:57,778 [20] [cmk.base.notify] Output: self.adapter.notify()
2021-07-28 10:29:57,778 [20] [cmk.base.notify] Output: File "/omd/sites/cmk/local/share/check_mk/notifications/sr_servicenow_plugin", line 186, in notify
2021-07-28 10:29:57,778 [20] [cmk.base.notify] Output: import requests
2021-07-28 10:29:57,778 [20] [cmk.base.notify] Output: ImportError: No module named requests
I had installed pip to install the requests module but according to it, it was already installed. I changed the header of the script to #!/usr/bin/python3 and then when I forced notification logs showed something different:
2021-07-27 15:37:11,696 [20] [cmk.base.notify] * notifying cmkadmin via sr_servicenow_plugin, parameters: --debug, bulk: no
2021-07-27 15:37:11,696 [20] [cmk.base.notify] executing /omd/sites/cmk/local/share/check_mk/notifications/sr_servicenow_plugin
2021-07-27 15:37:11,703 [40] [cmk.base.notify] ERROR:
Traceback (most recent call last):
File "/omd/sites/cmk/lib/python3/cmk/base/notify.py", line 633, in _process_notifications
call_notification_script(plugin_name, context)
File "/omd/sites/cmk/lib/python3/cmk/base/notify.py", line 1490, in call_notification_script
p = subprocess.Popen([path],
File "/omd/sites/cmk/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/omd/sites/cmk/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/omd/sites/cmk/local/share/check_mk/notifications/sr_servicenow_plugin'
But the mentioned file is under the path of the error? Under the OMD I see 3 folders with python:
OMD[cmk]:~/lib$ ls -l |grep pyth
lrwxrwxrwx 1 root root 11 May 26 07:06 check_mk -> python3/cmk/
lrwxrwxrwx 1 root root 19 May 26 07:06 libpython3.8.so -> libpython3.8.so.1.0
-rw-r--r-- 1 root root 3424224 May 26 07:06 libpython3.8.so.1.0
-rw-r--r-- 1 root root 14112 May 26 07:06 libpython3.so
drwxr-xr-x 2 root root 4096 May 26 07:06 python/
drwxr-xr-x 192 root root 12288 May 26 15:48 python3/
drwxr-xr-x 34 root root 4096 May 26 15:48 python3.8/
OMD[cmk]:~/lib$ pwd
/omd/sites/cmk/lib
python3.8 contains the requests module. How should I proceed with this?