fix(alarm): watermark replace >= =< with > <
This commit is contained in:
parent
4cdd529b5a
commit
e2dec09b0d
|
@ -78,14 +78,14 @@ add_default_user(Type, Key, Password) ->
|
||||||
username -> user
|
username -> user
|
||||||
end,
|
end,
|
||||||
?LOG(warning,
|
?LOG(warning,
|
||||||
"[Auth Mnesia] auth.client.x.~p=~s's password in the emqx_auth_mnesia.conf\n"
|
"[Auth Mnesia] auth.client.x.~p=~s password in the emqx_auth_mnesia.conf\n"
|
||||||
"does not match the password in the database(mnesia).\n"
|
"does not match the password in the database(mnesia).\n"
|
||||||
"1. If you have already changed the password via the HTTP API, this warning has no effect.\n"
|
"1. If you have already changed the password via the HTTP API, this warning has no effect.\n"
|
||||||
"You can remove the warning from emqx_auth_mnesia.conf to resolve the warning.\n"
|
"You can remove the `auth.client.x.~p=~s` from emqx_auth_mnesia.conf to resolve this warning.\n"
|
||||||
"2. If you just want to update the password by manually changing the configuration file,\n"
|
"2. If you just want to update the password by manually changing the configuration file,\n"
|
||||||
"you need to delete the old user and password using `emqx_ctl ~p delete ~s` first\n"
|
"you need to delete the old user and password using `emqx_ctl ~p delete ~s` first\n"
|
||||||
"the new password in emqx_auth_mnesia.conf can take effect after reboot.",
|
"the new password in emqx_auth_mnesia.conf can take effect after reboot.",
|
||||||
[Type, Key, TypeCtl, Key]),
|
[Type, Key, Type, Key, TypeCtl, Key]),
|
||||||
ok
|
ok
|
||||||
end;
|
end;
|
||||||
Error -> Error
|
Error -> Error
|
||||||
|
|
|
@ -147,12 +147,12 @@ handle_info({timeout, Timer, check}, State = #{timer := Timer,
|
||||||
case emqx_vm:cpu_util() of %% TODO: should be improved?
|
case emqx_vm:cpu_util() of %% TODO: should be improved?
|
||||||
0 ->
|
0 ->
|
||||||
State#{timer := undefined};
|
State#{timer := undefined};
|
||||||
Busy when Busy >= CPUHighWatermark ->
|
Busy when Busy > CPUHighWatermark ->
|
||||||
emqx_alarm:activate(high_cpu_usage, #{usage => Busy,
|
emqx_alarm:activate(high_cpu_usage, #{usage => Busy,
|
||||||
high_watermark => CPUHighWatermark,
|
high_watermark => CPUHighWatermark,
|
||||||
low_watermark => CPULowWatermark}),
|
low_watermark => CPULowWatermark}),
|
||||||
ensure_check_timer(State);
|
ensure_check_timer(State);
|
||||||
Busy when Busy =< CPULowWatermark ->
|
Busy when Busy < CPULowWatermark ->
|
||||||
emqx_alarm:deactivate(high_cpu_usage),
|
emqx_alarm:deactivate(high_cpu_usage),
|
||||||
ensure_check_timer(State);
|
ensure_check_timer(State);
|
||||||
_Busy ->
|
_Busy ->
|
||||||
|
@ -191,7 +191,7 @@ ensure_system_memory_alarm(HW) ->
|
||||||
undefined -> ok;
|
undefined -> ok;
|
||||||
_Pid ->
|
_Pid ->
|
||||||
{Allocated, Total, _Worst} = memsup:get_memory_data(),
|
{Allocated, Total, _Worst} = memsup:get_memory_data(),
|
||||||
case Total =/= 0 andalso Allocated/Total * 100 >= HW of
|
case Total =/= 0 andalso Allocated/Total * 100 > HW of
|
||||||
true -> emqx_alarm:activate(high_system_memory_usage, #{high_watermark => HW});
|
true -> emqx_alarm:activate(high_system_memory_usage, #{high_watermark => HW});
|
||||||
false -> ok
|
false -> ok
|
||||||
end
|
end
|
||||||
|
|
|
@ -112,7 +112,7 @@ handle_info({timeout, Timer, check},
|
||||||
process_low_watermark := ProcLowWatermark}) ->
|
process_low_watermark := ProcLowWatermark}) ->
|
||||||
ProcessCount = erlang:system_info(process_count),
|
ProcessCount = erlang:system_info(process_count),
|
||||||
case ProcessCount / erlang:system_info(process_limit) * 100 of
|
case ProcessCount / erlang:system_info(process_limit) * 100 of
|
||||||
Percent when Percent >= ProcHighWatermark ->
|
Percent when Percent > ProcHighWatermark ->
|
||||||
emqx_alarm:activate(too_many_processes, #{usage => Percent,
|
emqx_alarm:activate(too_many_processes, #{usage => Percent,
|
||||||
high_watermark => ProcHighWatermark,
|
high_watermark => ProcHighWatermark,
|
||||||
low_watermark => ProcLowWatermark});
|
low_watermark => ProcLowWatermark});
|
||||||
|
|
Loading…
Reference in New Issue