What is the right way to customise built-in notification plugins

We have a requirement to use the ServiceNow notification plugin, but also need to forward additional information that is not covered by the built-in code.

What would be the right way to add extensions to the base plugin (and the GUI) so that it does not need to be re-implemented each time we upgrade?

Copy the original plugin from ~/share/check_mk/notifications/servicenow to ~/local/share/check_mk/notifications/servicenow (notice the local) and then change the script below the local path.

You may want to change the second line in the script from

#!/usr/bin/env python
# Servicenow (Enterprise only)
# Bulk: no
...

to

#!/usr/bin/env python
# My custom Servicenow
# Bulk: no
...

The second line is the text that is displayed in the GUI in the selection box with the available notification methods. It might be neccessary to restart the site because sometimes it doesn’t pickup new notification plugins while running.
If you now update to a new checkmk version, only the files below ~/share/... get updated; the files below ~/local/share/... remain untouched.

4 Likes

OK, that is simple enough (CEE redirect notwithstanding), but the WATO Rules GUI side is trickier, as it is part of the generic ~/lib/python/cmk/gui/plugins/wato/notifications.py definitions.

Any clues?

I guess you would need to copy the relevent part(s) from ~/lib/python/cmk/gui/plugins/wato/notifications.py to a new file below ~/local/share/check_mk/web/plugins/wato/my_service_now.py and modify it there. Maybe you need to rename the class NotificationParameterServiceNow and make sure the new one is used for the notification plugin instead of the old one. But I haven’t tried that yet. Maybe it doesn’t work at all.

1 Like

Yep, that seems to work! The new class has to match the pluginname, as you expected, but otherwise appears to work. Doing more testing now!

1 Like

Hey rdm,

can you explain your further testing results.
We have the same requirement to add extensions (SLA-Values and so stuff). I have tried yours and dirk’s hints, but this didn’t work out.

I’m thankful for everything :smiley:

Regards
Andreas

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.