如何设置monit来监控磁盘空间

rub*_*o77 13 monitoring debian disk-space-utilization monit

我在我的服务器上使用 monit 来监控 apache 和 mysql 的运行。

现在我想在磁盘太满时添加警报。我添加了这个用于测试/etc/monit/monitrc

check device rootfs with path /dev/md0
    if space usage > 10% then alert
Run Code Online (Sandbox Code Playgroud)

我有两个要检查的分区://var

mount
/dev/md0 on / type ext3 (rw)
/dev/md2 on /var type ext3 (rw)
Run Code Online (Sandbox Code Playgroud)

除了磁盘空间之外,此配置中还有哪些有用的检查?

eww*_*ite 25

这里没什么可做的。您当前的检查在语法上是正确的,但可能不实用。为什么要关心空间利用率是否大于 10%????

典型的磁盘检查节如下所示:

check device var with path /var
    if SPACE usage > 80% then alert
Run Code Online (Sandbox Code Playgroud)

如果驱动器已满 80% 以上,这基本上会发送一封电子邮件。一旦数据使用量低于该水平,Monit 也会通知您。另请查看Monit 文档

键入monit status的命令行。以下是 Monit 看到的有关您的文件系统的信息:

Filesystem 'var'
  status                            Accessible
  monitoring status                 Monitored
  permission                        755
  uid                               0
  gid                               0
  filesystem flags                  0x400
  block size                        4096 B
  blocks total                      1523090 [5949.6 MB]
  blocks free for non superuser     979860 [3827.6 MB] [64.3%]
  blocks free total                 1058477 [4134.7 MB] [69.5%]
  inodes total                      1572864
  inodes free                       1563392 [99.4%]
  data collected                    Sat, 03 Aug 2013 22:07:28
Run Code Online (Sandbox Code Playgroud)

  • 我认为 `check device` 一定是一些旧语法,因为手册不再提及它。我认为“检查文件系统”是一种新的方法。 (4认同)