大网数据广告活动
服务器运维问答

Monit ignores memory usage threshold config

· 52CE 我爱测

I installed Monit 5.6 from Ubuntu repositories to alert me about unusually high memory and CPU usages on my VPS. It turned out that 75% memory usage is rather usual for my setup, so I changed the line where the limit is set in fi…

问题原文

原帖链接 · Hnatt · CC BY-SA 3.0

I installed Monit 5.6 from Ubuntu repositories to alert me about unusually high memory and CPU usages on my VPS. It turned out that 75% memory usage is rather usual for my setup, so I changed the line where the limit is set in file /etc/monit/conf.d/system.conf:

check system localhost
  ...
  if memory usage > 90% then alert

But now it alerts me both on 75% threshold and on 90%. I searched where else can it be set: grep 75% -r /etc/monit/, but got no matches. Is there any other places Monit stores its config files on default setup? Or is the 75% limit is somehow hard-coded in it? How can I disable it?

UPD: I tried both reloading and restarting monit after changes (didn't try to reboot the server though). My Monit version is:

# monit -V
This is Monit version 5.6
Copyright (C) 2001-2013 Tildeslash Ltd. All Rights Reserved.

And the config file:

check system localhost
  if loadavg (1min) > 4 then alert
  if loadavg (5min) > 3 then alert
  if memory usage > 90% then alert
  if cpu usage (user) > 70% for 5 cycles then alert
  if cpu usage (system) > 30% for 5 cycles then alert
  if cpu usage (wait) > 20% for 5 cycles then aler

社区高分解答

原帖链接 · ewwhite · CC BY-SA 3.0

There's always a chance there's a bug... Can you show your Monit version level?

# monit -V
This is Monit version 5.5
Copyright (C) 2001-2012 Tildeslash Ltd. All Rights Reserved.
  • Could you also post your Monit configuration file?
  • Did you restart the Monit service after making your configuration change?

You can do this with:

service monit restart or just monit reload

If in doubt about the readings, you can run monit status from the command line:

[root@PMS ~]# monit status
The Monit daemon 5.5 uptime: 6d 14h 26m

    System 'PMS.pmscollects.com'
      status                            Running
      monitoring status                 Monitored
      load average                      [0.00] [0.11] [0.38]
      cpu                               0.0%us 0.2%sy 0.0%wa
      memory usage                      3562600 kB [44.2%]
      swap usage                        5280 kB [0.0%]
      data collected                    Sun, 23 Nov 2014 23:59:04

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-11-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。