diff --git a/src/mod_smart_markers.erl b/src/mod_smart_markers.erl index 6088088bea..96cabdccb2 100644 --- a/src/mod_smart_markers.erl +++ b/src/mod_smart_markers.erl @@ -228,7 +228,7 @@ get_host(groupchat, SubHost, From, To) -> can_access_room(HostType, From, To) andalso {true, HostType} end; get_host(one2one, Host, _, _) -> - Hosts = ejabberd_config:get_global_option(hosts), + Hosts = ejabberd_config:get_global_option_or_default(hosts, []), case lists:member(Host, Hosts) of false -> false; _ -> {true, Host} diff --git a/src/system_metrics/mongoose_system_metrics_collector.erl b/src/system_metrics/mongoose_system_metrics_collector.erl index b827121dfd..2879195a3c 100644 --- a/src/system_metrics/mongoose_system_metrics_collector.erl +++ b/src/system_metrics/mongoose_system_metrics_collector.erl @@ -38,12 +38,14 @@ report_getters() -> ]. get_hosts_count() -> - Hosts = ejabberd_config:get_global_option(hosts), + HostTypes = ejabberd_config:get_global_option_or_default(host_types, []), + Domains = lists:flatten([mongoose_domain_core:get_domains_by_host_type(HT) || HT <- HostTypes]), + Hosts = ejabberd_config:get_global_option_or_default(hosts, []) ++ Domains, NumberOfHosts = length(Hosts), [#{report_name => hosts, key => count, value => NumberOfHosts}]. get_modules() -> - Hosts = ejabberd_config:get_global_option(hosts), + Hosts = ejabberd_config:get_global_option_or_default(host_types, []), AllModules = lists:flatten([gen_mod:loaded_modules(H) || H <- Hosts]), ModulesToReport = filter_behaviour_implementations(lists:usort(AllModules), mongoose_module_metrics), @@ -78,7 +80,7 @@ report_module_with_opts(Module, Opts) -> end,Opts). get_number_of_custom_modules() -> - Hosts = ejabberd_config:get_global_option(hosts), + Hosts = ejabberd_config:get_global_option_or_default(host_types, []), AllModules = lists:flatten( lists:map(fun gen_mod:loaded_modules/1, Hosts)), GenMods = filter_behaviour_implementations(AllModules, gen_mod),