[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does monit check disk usage technically?

From: Martin Pala
Subject: Re: How does monit check disk usage technically?
Date: Wed, 3 Oct 2007 00:11:13 +0200

It seems that you are probably using the device path in the monit check (/dev/...) and monit count the space usage of the devfs pseudo filesystem instead of the device (the devfs really reports 100% disk usage normally). If you'll use the mountpoint instead of the device, it should work.

My monit configuration (excerpt):

check device rootfs with path /
  if space usage > 50% then alert

powerhauk$ monit -V
This is monit version 4.10-beta2
Copyright (C) 2000-2007 by the monit project group. All Rights Reserved.

powerhauk$ uname -a
Darwin powerhauk.local 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh powerpc

powerhauk$ df -k /
Filesystem              1K-blocks     Used    Avail Capacity  Mounted on
/dev/disk0s3             78019632 28806588 48957044    37%    /

Monit running with -vI options and reporting the space usage each cycle ... it matches the df output:

  'rootfs' space usage check passed [current space usage=37.2%]

Can you provide your monit configuration?


On Sep 1, 2007, at 12:03 PM, Sergio Trejo wrote:

On 8/31/07, Martin Pala <address@hidden> wrote: Monit uses the system's statfs API.

The filesystem usually have some part reserved for superuser (ca. 5% on
other unixes).

What's your supposed disk usage (difference between monit and other
tools report?)


Hello Martin,

On Mac OS X I have used the command-line too, df with the -k option which option then uses 1024-byte (1-Kbyte) blocks rather than the default (according to the man page):

According to df -k, I'm getting disc usage such as (sorry the format of the text below might not be tabbed correctly in the copy- and-paste):

Filesystem              1K-blocks     Used     Avail Capacity

/dev/disk1s1             79707352 13020876  66430476    16%
/dev/disk2              243138528  1617544 241520984     1%
/dev/disk5s1             53346304  5160580  48185724    10%
/dev/disk5s3             12451840  9073000   3378840    73%
/dev/disk5s5             12451840  9057320   3394520    73%
/dev/disk5s7            209584128 55447560 154136568    26%
/dev/disk5s9            187109360    65124 187044236     0%

So from df -k, none of my discs are exceeding the 75% threshold that I have used in the monit configuration file. Yet monit is saying that all of my discs (listed above) are at 100%. Such as this report (note: I have multiple thresholds in my monit configuration file starting at 75%, 85%, 90% and 99% which are all set to send me alerts by monit):

[ Aug 31 17:30:35] error : 'SomeDiscName' space usage 100.0% matches resource limit [space usage>75.0%]

I wonder if there is something that could be added in the monit source code for a new version that could check to see if the file system is Apple's HFS+ and if so, maybe a different approach needs to be taken for obtaining the disc usage information?

By the way, I also have similar thresholds for inode usage for all of my discs (75%, 80%, etc.) and monit did not alert me about inodes exceeding the thresholds so maybe the method used for inode counting (used v.s . total) works just fine for HFS+ disc devices?

Please let me know if I can do any further testing / feedback.



Sergio Trejo wrote:
> Hello again,
> I just edited a monit configuration file which monitors devices (disc > volumes) on my Mac server running Mac OS X 10.4.10. The discs attached
> are the HFS+ file system types (standard for Apple).
> My device entry in the monit configuration file looks like this:
> check device SomeDiscName with path /dev/disk1
>      if space usage > 90% then alert
> What's interesting is that I'm getting alerts for my device checks even > though I know for sure (using some of the BSD tools that Apple bundles
> with Mac OS X) that my disc space is much much less than 90% usage.
> Monit is sending me alerts in email that look like this:
> SomeDiscName Resource limit matched at Fri, 31 Aug 2007 17:30:35 +0000
> And the corresponding log entry looks like this:
>     [ Aug 31 17:30:35] error    : 'SomeDiscName' space usage 100.0%
>     matches resource limit [space usage>90.0%]
> Should I not be using monit for monitoring disc device space use and/or
> inode use on Mac systems with HFS+ file system types?
> Thanks again,
> Serg
> ---------------------------------------------------------------------- --
> --
> To unsubscribe:

To unsubscribe:

To unsubscribe:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]