Pages: [1]   Go Down
Author Topic: Check folder size [SOLVED]  (Read 317 times)
0 Members and 2 Guests are viewing this topic.
Morphius143
Newbie
*

Karma: 1
Offline Offline

Posts: 8


View Profile
« on: June 16, 2011, 12:05:02 PM »

Hello

I have been using Pandora for a while now and it is going a great job of replacing our GFI software.

I do however have on check that GFI can perform which Pandora doesnt seem able to unless someone can point me in the right direction?

We currently monior for dead emails by checking either the size of a folder, if it grows in size above 0kb we get an alert. Is there anyway for Pandora to monitor a folder size like this?

Thanks in advance

« Last Edit: June 30, 2011, 04:23:14 PM by tpalacios » Logged

daniels
Smart member
*****

Karma: 19
Offline Offline

Posts: 205



View Profile
« Reply #1 on: June 30, 2011, 03:12:32 PM »

Hi Morphius143,

  I'm not sure if I understand your question... But is quite simple for pandora to monitor the size of a folder.

  Just place a module inside the pandora_agent.conf of the monitored server:

module_begin
module_name folder_size
module_type generic_data
module_exec du -h -b -s /var/spool/mail/ | cut -f 1
module_description Folder size
module_end

  The module will give you the size of the folder /var/spool/mail (change this for your specific folder). It would not be zero, because the directory itself allocate some space to exist. Just configure the alert to rise when the folder size grows bigger than the directory size.


Regards.
Logged

Morphius143
Newbie
*

Karma: 1
Offline Offline

Posts: 8


View Profile
« Reply #2 on: June 30, 2011, 03:26:40 PM »

Hello

Thanks for that suggestion, it is good to know that it should be possible. You definately get the idea of what we need to do, if our email system goes wrong it logs the failed messages in a usually empty folder, so if the folder grows then we have a problem...

Do you happen to know of a way to do this on a windows host as du is a native Linux command?

I have found that you can download du from the sysinternals website but the options dont support the -h -b or -s switches

The output is naturally as shown below which doesnt lend itself to a check based only on the number.
Files:        1
Directories:  44
Size:         1,116 bytes
Size on disk: 1,116 bytes


Thanks again

Dominic
Logged

Morphius143
Newbie
*

Karma: 1
Offline Offline

Posts: 8


View Profile
« Reply #3 on: June 30, 2011, 03:54:06 PM »

Hello
Many thanks for your help, I have discovered that you can download ported versions of the Unix utilities. I have downloaded them from here:

http://sourceforge.net/projects/unxutils/

I have copied those files to C:\Windows\System32 and then using the command just as you wrote it:

module_begin
module_name folder_size
module_type generic_data
module_exec du -h -b -s "C:\Program Files\" | cut -f 1
module_description Folder size
module_end

Enables us to monitor the size of that folder.

Thanks massivly for huge point in the right direction, i think Pandora is now doing everything that we need it to!
Logged

daniels
Smart member
*****

Karma: 19
Offline Offline

Posts: 205



View Profile
« Reply #4 on: July 01, 2011, 02:28:39 PM »

Hi.

 I'm glad that you solved the problem. Good monitoring :-)

Regards.
Logged

Pages: [1]   Go Up
Print
 
Jump to:  


SourceForge.net Logo  This site is monitored by Pandora FMS   ArticaST