Rocketchat notification plugin: "Some GUI extensions could not be loaded"

Hi

I downloaded and installed the MKP file for RocketChat notifications from Checkmk Exchange in my 1.60p12 CEE site.

But then the following error message is displayed in “WATO >> Extension packages” with red background:

Some GUI extensions could not be loaded. This may be caused by some incompatible extension packages.

Loading “/omd/sites/integracion/local/share/check_mk/web/plugins/wato/rocketchat-notification.py” failed: name ‘defaults’ is not defined

I also have read the python code (local/share/check_mk/notifications/rocketchat) and found

from rocketchat_API.rocketchat import RocketChat

I guess that is a requirement, but that is not mentioned at all in your Exchange web. In fact, no MKP file has a requeriment section.

Then I wonder whether this RocketChat notification extension has even tested.

Best regards

As the RocketChat plugin is fairly old (build on 1.2.8) it is normal that the WATO extensions will cause problems with actual 1.6.

As @andreas-doehler said. To fix the WATO plugin, go to ~/local/share/check_mk/web/plugins/wato and edit the file rocketchat-notification.py. Locate the following statement near the bottom of the file:

default_value = "http://" + socket.gethostname() + "/" + (
   defaults.omd_site and defaults.omd_site + "/" or "") + "check_mk/",

Replace defaults.omd_site with config.omd_site() so that it reads

default_value = "http://" + socket.gethostname() + "/" + (
   config.omd_site() and config.omd_site() + "/" or "") + "check_mk/",

You may also try

default_value = local_site_url,

local_site_url is a function defined in ~/lib/python/cmk/gui/plugins/wato/notifications.py. I’m not sure if it is available from within the local plugins.

I cannot tell about

though.

This should be possible at the head of the file there is then an import statement needed.
from cmk.gui.plugins.wato.notifications import local_site_url

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.