Check size of large directory

Daniel Wittenberg daniel.wittenberg.r0ko at statefarm.com
Fri Dec 3 16:32:58 CET 2010


Not sure how those other scripts are doing it, if using an ls maybe?  As
a test, can you do:

time find <path> -type f |wc -l

See how long it takes for that?

Dan

-----Original Message-----
From: Andreas Ericsson [mailto:ae at op5.se] 
Sent: Friday, December 03, 2010 5:26 AM
To: Nagios Users List
Subject: Re: [Nagios-users] Check size of large directory

On 12/03/2010 07:29 AM, Sebastian Ries wrote:
> Hi
> 
>> The check_folder_size.sh script will probably suit your needs well.
> 
> Yes, I found scripts for this.
> The Problem is that a du within this folder takes about 2 minutes.
> That's why I told that it is a very large directory with many files)
> 

In that case there's not much a plugin can do about it. The process is
bound by IO and no amount of hacking will make it go noticeably faster.

> The other side is that the content within this directory is generated
> once a day so I wanted to run the "du" after generating the content of
> the file and let nagios just check the result that was written in a
> file.
> 

Then I'd suggest you write a plugin yourself that does just that. Any
old language should work for such a simple task, really.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------
------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for
grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list