Skip to content

Commit

Permalink
System metrics error with no static hosts configured
Browse files Browse the repository at this point in the history
  • Loading branch information
vkatsuba committed Aug 19, 2021
1 parent 6d68ad1 commit e5609db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/system_metrics/mongoose_system_metrics_collector.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ 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}].

Expand Down

0 comments on commit e5609db

Please sign in to comment.