Hello,
I would like your opinion.
Problem 1 : I have configured a notification Notification Method (HTML Email) but I do not have the link to my Service note URL in my notification email.
My solution 1 : I modified the check_mk_templates.cfg file and added
define command {
command_name check-mk-notify
command_line \
NOTIFY_SERVICENOTESURL='$SERVICENOTESURL$' \
Question 1 : Is this the right method?
Problem 2 : Now the link appears but is not clickable
My Solution 2 : I modified the /opt/omd/versions/2.2.0p20.cre/lib/python3/cmk/notification_plugins/mail.py file and I edited this section
(
“notesurl”,
“service”,
False,
“all”,
“Custom Service Notes URL”,
“$SERVICENOTESURL$”,
“$SERVICENOTESURL$”,
),
by
(
"notesurl",
"service",
False,
"all",
"Custom Service Notes URL",
"$SERVICENOTESURL$",
"<a href=$SERVICENOTESURL$>$SERVICENOTESURL$</a>",
),
now the link is clickable
Question 2 : Is this the right method?
Problem 3 : in my link I have a # and he is transformed into %23
Question 3 : can I change the encoding?
I think whatever I did is not the right method because if I do an update of checkmk I lose everything. I tried to follow Andrea’s solution : Change resolution of graphs in mail notifications - #4 by kaiserchrss
I do it on my systems the following way.
copy ~/lib/python/cmk/notifications/mail.py to ~/local/lib/python
copy ~/share/check_mk/notifications/mail to ~/local/share/check_mk/notifications
modify line 2 of ~/local/share/check_mk/notifications/mail - append a “modified” or something else
also change the import line to import mail
modify the ~/local/lib/python/mail to your needs
my solution that doesn’t work :
1 - I created a file/opt/omd/sites/mysite/local/share/check_mk/notifications/mail
HTML Email 2
from cmk.notification_plugins import mail
if name == “main”:
mail.main()
2 - I also have to copy /opt/omd/versions/2.2.0p20.cre/lib/python3/cmk/notification_plugins/mail.py but where?
I have to put it in the same tree?
cd /opt/omd/sites/mysite/local/lib/
ll
python/
python3/
cd python or python3?
In python3/cmk/ i create notification_plugins folder and copy mail.py and modify it?
thank you in advance
Stan