Custom script SMS using API in v2.4

CMK version: 2.4.0p20.cre
OS version: RHEL 9.7

I tried to customize the sms_api.py how described in Notification basics from ~/lib/python3/cmk/notification_plugins/ and copied to ~/local/share/check_mk/notifications/ sms_api_prefix.py .

But this seems not to work. What else i have to do, get it working?

well, i renamed the script to sms_api.py under ~/local/share/check_mk/notifications/ , because i read somewhere, that usage of plugins priority is ~/local/… first. I changed

message = quote_message(get_sms_message_from_context(raw_context), max_length=160) 

to

prefix= "[<Custom Prefix>]"
raw_msg = get_sms_message_from_context(raw_context)
message = quote_message(prefix + raw_msg, max_length=160) 

but it still using the original sms_api.py from ~/lib/python3/cmk/notification_plugins/

I also tried to copy and rename ~/share/check_mk/notifications/sms_api , so i am able to have a different notification method in the GUI, but then i had no parameters for Teltonika modem.

~/lib/check_mk/gui/wato/_notification_parameter/_sms_api.py i also tried to copy and rename this to _sms_api_prefix.py , but where to copy under ~/local ? Anyway i guess it is not recommended way :smiley:

btw if you use quote_message the text in the SMS is sent inside ’ ’ , which is not a valid character for the SMS recipient, in our case. Just for those who are using this too, wondering why the quoted SMS cause no Alarm at your recipient. For me it was not obvious, as none software developer :-p