0

In the _block.tt its possible to add href when custom_vars_host is present.

[% IF custom_vars_host.size > 0 %]
[% FOREACH cust = custom_vars_host %]
[% IF cust.key == "ilo" || cust.key == "drac") %]
<td><a href='https://[% cust.value %]/'>...</a></td>
[% END %]
[% END %]
[% END %]

Is there a way to add link when host is member of a hostgroup?

gsamaras
  • 71,951
  • 46
  • 188
  • 305

2 Answers2

0

Same way as the macro

[% IF host.groups.size > 0 %]

[% FOREACH group IN host.groups.sort %]

[% IF group == "metrics-win" %]

[% END %]

[% END %]

[% END %]

Community
  • 1
  • 1
0

extending the _block.tt template could lead to maintainance issues because you have to double check your changes after each update. You could use the new rest api together with the js action menus like in this example: https://thruk.org/documentation/action-menu.html#sending-commands

sni
  • 125
  • 6