diff --git a/etc/modules/webui2.cfg b/etc/modules/webui2.cfg index 34fef03f..18cc6792 100644 --- a/etc/modules/webui2.cfg +++ b/etc/modules/webui2.cfg @@ -70,6 +70,7 @@ define module { # Database name where to fetch the logs/availability collections #database shinken + # User authentication for database access #username #password diff --git a/module/helper.py b/module/helper.py index 4bb56f4d..70954157 100644 --- a/module/helper.py +++ b/module/helper.py @@ -806,6 +806,42 @@ def get_timeperiod_html(self, timeperiod): return content + def get_check_command_html(self, item, command_line): + 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] + mr = MacroResolver() + if ALIGNAK: + expanded = mr.resolve_simple_macros_in_string(command_line, checks_data, [], [], + item.check_command.args) + expanded2 = mr.resolve_simple_macros_in_string(c_line, checks_data, [], [], + item.check_command.args) + else: + expanded = mr.resolve_simple_macros_in_string(command_line, checks_data, + item.check_command.args) + expanded2 = mr.resolve_simple_macros_in_string(c_line, checks_data, + item.check_command.args) + + 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, expanded2 + 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..a1388d02 100644 --- a/module/plugins/eltdetail/views/_eltdetail_information.tpl +++ b/module/plugins/eltdetail/views/_eltdetail_information.tpl @@ -143,15 +143,21 @@ %end Check command: - - %if elt.check_command: - {{elt.get_check_command()}} - %else: - No check command - %end - - + %if elt.check_command: + %cmd = app.datamgr.get_command(elt.get_check_command()) + %html_content, expanded, expanded2 = helper.get_check_command_html(elt, cmd.command_line) + + + + {{ getattr(elt.check_command, "command_name", "None") }} + +
{{ expanded2 }} + %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