Problem with the creation of a notification script

Good day,

I have a rather interesting problem. When I create a notification script in the folder /omd/sites//local/share/check_mk/notifications/ with nano or vi it works. However, if I move the script to a folder with cp or cat then it does not work, and I get the following error message in the notification logs:

FileNotFoundError: [Errno 2] No such file or directory: ‘/omd/sites//local/share/check_mk/notifications/’.

I have now tried it with different users, with different RWX rights, I have tried everything, but it only works when I create it with nano or vi.

I have also tried it with different check_mk versions and on different servers but everywhere occurs the same problem…

It also has nothing to do with the script itself, when I start a script that only outputs a text, the same issue occurs…

I also don’t understand how the file for linux should be different by creating it with nano/vi than with all other methods, I guess it has to do with how check_mk reads the scripts or idk.

Also, for information, it doesn’t work if you open the file with nano after copying it, then saving it and closing it again, so it must have something to do with the creation.

Can anyone perhaps help me?

Thank you!

Do your other methods involve a Windows text editor?

1 Like

Did you create the first script that works?
Did you make it executable?

This path looks weird. Did you forget to enter the sitename between “sites/” and “/local”?

1 Like

Vscode for Windows so somehow yes.

Yes I have done both.

Sorry but I only removed the site name from the message. As far as I can remember I also wrote omd_site_name in <> brackets but it seems that the forum removes them.

You need to convert the line endings from CR+LF to oinly LF.

Seems to be the solution. Thank you!

1 Like