diff --git a/module/helper.py b/module/helper.py index 4bb56f4d..716ee6ee 100644 --- a/module/helper.py +++ b/module/helper.py @@ -806,6 +806,35 @@ def get_timeperiod_html(self, timeperiod): return content + def get_check_command_html(self, item): + if not item or not item.check_command: + return '' + + c_line = getattr(item.check_command, "command_line", + getattr(item.check_command, "command_name", "None")) + + checks_data = [item, item.host] if item.my_type == 'service' else [item] + if ALIGNAK: + expanded = MacroResolver().resolve_simple_macros_in_string(c_line, checks_data, [], []) + else: + expanded = MacroResolver().resolve_simple_macros_in_string(c_line, checks_data) + + html_content = 'Command line:' \ + '
' \ + '
%s
' \ + % c_line + html_content += '
' \ + 'Command line with macro expansion:' \ + '
' \ + '
%s
' \ + % expanded + html_content += '
' \ + 'Arguments:' \ + '
%s' % ("
  ".join(item.check_command.args) + if item.check_command.args else "None") + + return html_content, expanded + def get_contact_avatar(self, contact, size=24, with_name=True, with_link=True): name = contact title = name diff --git a/module/plugins/eltdetail/views/_eltdetail_information.tpl b/module/plugins/eltdetail/views/_eltdetail_information.tpl index 43a9ba85..6bb8a2ab 100644 --- a/module/plugins/eltdetail/views/_eltdetail_information.tpl +++ b/module/plugins/eltdetail/views/_eltdetail_information.tpl @@ -143,15 +143,20 @@ %end Check command: - - %if elt.check_command: - {{elt.get_check_command()}} - %else: - No check command - %end - - + %if elt.check_command: + %html_content, expanded = helper.get_check_command_html(elt) + + + + {{ getattr(elt.check_command, "command_name", "None") }} + +
{{ expanded }} + %else: + No check command + %end %enabled = app.datamgr.get_configuration_parameter('execute_host_checks' if elt_type == 'host' else 'execute_service_checks') diff --git a/module/views/header_element.tpl b/module/views/header_element.tpl index b779927a..d329b53e 100644 --- a/module/views/header_element.tpl +++ b/module/views/header_element.tpl @@ -243,6 +243,10 @@ %if app.logs_module.is_available():
  •  Logs
  • + %if alignak: +
  • +  Alignak alerts
  • + %end
  •  Alerts
  • %end