[Check_mk (english)] Question regarding embedded URL in the plugin output

Dear All,

I have written a plugin that outputs a URL in the plugin output. On the GUI, the URL in the service check output appears as an image. When I click on the image, I get the message “refused to connect” .but when I open the image in a different tab the URL works fine.

Can you advise if this is expected behavior? If not, how to fix this?

It will probably be because the browser is trying to open your URL in the same frame within the Check_MK GUI. This will fall afoul of the SAMEORIGIN (or similar) security policy of the remote site – i.e. these days, by default, sites don’t permit themselves to be loaded in other sites’ iframes. You should be able to see the exact reason if you click the URL whilst you have the developer console open in your browser.

If you have control of the server of the URL you’re linking to, you may be able to get around it in that server’s configuration.

Otherwise, you may be better off instead creating a “Custom icons or actions for services in status GUI” rule for that service check. This puts an icon in the service check’s menu for the url which will by default open the URL in a new tab.

Cheers,

Rich

···

From: checkmk-en checkmk-en-bounces@lists.mathias-kettner.de On Behalf Of marco checl-mk
Sent: 13 November 2019 13:49
To: checkmk-en@lists.mathias-kettner.de checkmk-en@lists.mathias-kettner.de
Subject: [Check_mk (english)] Question regarding embedded URL in the plugin output

Dear All,

I have written a plugin that outputs a URL in the plugin output. On the GUI, the URL in the service check output appears as an image. When I click on the image, I get the message “refused to connect” .but when I open the image in a different tab the URL works fine.

Can you advise if this is expected behavior? If not, how to fix this?