[Xymon] Folder Size

Neil Simmonds Neil.Simmonds at express-gifts.co.uk
Tue May 14 16:48:03 CEST 2013


Hi Ray,

That’s exactly how you’d use it. Just change foldername to the folder required, change strFilePath if you’re on a 64 bit system (so it would be “C:\Program Files (x86)\BBWin\tmp”) and change the 300 to the value in Mb that you want to use. Then just change your externals section of BBWin.cfg to add a line like <load value="C:\Windows\System32\cscript.exe C:\Program Files\BBWin\ext\Folder.vbs" /> or the x86 program files directory if on 64 bit.

I’ve found it better to use the full path of cscript.exe and the actual script as I’ve had issues without them.

If you download VBSEdit (http://www.vbsedit.com/) you can actually create an executable from the script which means no one can change it. Then you would just use
<load value="C:\Program Files\BBWin\ext\Folder.exe" />

Hope that helps,
Neil.

From: Ray Reuter [mailto:ray.reuter at gmail.com]
Sent: 14 May 2013 14:56
To: Neil Simmonds
Cc: Xymon at xymon.com
Subject: Re: [Xymon] Folder Size

Thank you Neil

So this would be an external script for me to put in the ext folder and then call it using the bbwin.cfg file correct. I am trying to understand the external scripts more and I have been doing a lot of reading. I wish I were more of a programmer.

On Tue, May 14, 2013 at 8:33 AM, Neil Simmonds <Neil.Simmonds at express-gifts.co.uk><mailto:Neil.Simmonds at express-gifts.co.uk>> wrote:
Here’s a vbScript you could use, the example would flag red if C:\Data was > 300Mb in size

testName = "Folder"
outputfilename = Replace(testName,".","")
strFilePath="C:\Program Files\BBWin\tmp"
strProcessColour = "green"
Set fso= CreateObject("Scripting.FileSystemObject")

Set f = fso.OpenTextFile(strFilePath & "\" & outputfilename , 8 , True)

dim FSO, objFolder,datafolder, foldername

foldername = "c:\Data"

If fso.FolderExists(foldername ) Then
Set objFolder= FSO.GetFolder(foldername )  'getting folder size objFolder.Size\par
ShowFolderDetails objFolder
    
Sub ShowFolderDetails(oF)
datafolder  = oF.Size / 1048576
    If (datafolder > 300) Then
        strProcessColour = "red"
        f.Write strProcessColour & " " & Date & " " & Time & vbCrLf & vbCrLf
        f.Write "Folder Name       : " & foldername & vbCrLf
        f.Write "Folder Size (Mb)  : " & datafolder & vbCrLf
        f.Write "Folder size exceeeds 300Mb"
    Else
        strProcessColour = "green"
        f.Write strProcessColour & " " & Date & " " & Time & vbCrLf & vbCrLf
        f.Write "Folder Name       : " & foldername & vbCrLf
        f.Write "Folder Size (Mb)  : " & datafolder & vbCrLf
        f.Write "Folder Size OK" 
    End If
End Sub    
End If

f.Close


From: Xymon [mailto:xymon-bounces at xymon.com<mailto:xymon-bounces at xymon.com>] On Behalf Of Ray Reuter
Sent: 14 May 2013 12:26
To: Martin Flemming
Cc: xymon at xymon.com<mailto:xymon at xymon.com>
Subject: Re: [Xymon] Folder Size

The host in question is a windows server. I should have mentioned that in the initial thread, I did read previously where it could be done with ease in the non-windows world but have found nothing for windows. It has a cifs share presented to it and we are trying to avoid having that particular folder grow beyond 3GB.

On Mon, May 13, 2013 at 2:42 PM, Martin Flemming <martin.flemming at desy.de><mailto:martin.flemming at desy.de>> wrote:
On Mon, 13 May 2013, Ray Reuter wrote:
Does anyone know of a way to monitor the size of a folder? I am not a programmer so I figured I would reach out to you and see who might have done this already or knows of
someone who has been successful.

Hi !


Something like in

analysis.cfg

HOST=server1
DIR %^/var/log/.* size<2000000 TRACK

and in client-local.cfg

[server1]
dir:`find /var/log -maxdepth 1 -type d`

cheers,
        martin

_______________________________________________
Xymon mailing list
Xymon at xymon.com<mailto:Xymon at xymon.com>
http://lists.xymon.com/mailman/listinfo/xymon

Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.
Express Gifts Limited is authorised and regulated by the Financial Services Authority
________________________________
NOTE: This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records. Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments. No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT helpdesk on +44(0) 1254 303030<tel:%2B44%280%29%201254%20303030>

Name & Registered Office: EXPRESS GIFTS LIMITED, 2 GREGORY ST, HYDE, CHESHIRE, ENGLAND, SK14 4TH, Company No. 00718151.
Express Gifts Limited is authorised and regulated by the Financial Services Authority
--------------
NOTE:  This email and any information contained within or attached in a separate file is confidential and intended solely for the 
Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any 
information or data included with this e-mail remains the property of Findel PLC and the recipient will refrain from utilising the 
information for any purpose other than that indicated and upon request will destroy the information and remove it from their records.  
Any views or opinions presented are solely those of the author and do not necessarily represent those of Findel PLC. If you are not 
the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, 
or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this 
e-mail and any attachments.  No liability is accepted for any consequences arising from it. Findel Plc reserves the right to monitor 
all e-mail communications through its internal and external networks. If you have received this email in error please notify our IT 
helpdesk on +44(0) 1254 303030
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20130514/e7e122e1/attachment.html>


More information about the Xymon mailing list