[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] BBWin - Monitoring size of Exchange database files
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] BBWin - Monitoring size of Exchange database files
- From: Thomas Leavitt <thomleavitt (at) gmail.com>
- Date: Fri, 28 Aug 2009 19:41:01 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=3epyqxBl4ZuETGhB/RPlsLMpEBucdYmojZB/FxF5MBY=; b=IXmSHXMgOTEeTtJM762HM5lmSW/sw1dz0pA4tDbWg7DV8QF9LAroCivJJxXJoSCKeL O4TN+N8zihOcqGTbnPSC9UtSt7UL0yYR5no1ZX/nJ0/XiPogE+9DPXSbZeadLdNUzm5P tyKwlZq0COaIpULSHA2uW0TdVPFHx3d8ye4YQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Oj+rdrN3poEIeFHu5gUfThk9WEQneXmZEIc5a4EV7iMCorO970OVrMASiK9y0tnj6u VA15FmKW5Ve4iesMw3rMrvWVe7XT3pwMnrVVb031NBDQzcIZdm+H9gh5m6AAyYd4Y9gv CbWve8V/FW/YgauJGKN60/oPhrCAdhcyZOxm8=
- References: <5db4a99a0908211417i55528c78v60d8293f464a8e12 (at) mail.gmail.com> <EBDBC7B4393B6C4F9DDADE295309C9F2039B93 (at) EX1.nibco.com> <5db4a99a0908211726j59c94759t44494ba8672bd8c2 (at) mail.gmail.com> <EBDBC7B4393B6C4F9DDADE295309C9F2039BA0 (at) EX1.nibco.com>
Note (half an hour of frustration later):
First, I forget that you need to specify the script in the <externals>
</externals> section of BBWin.cfg. Doh. Suggest that Ray put a note to
that effect in the comments section of his script to help remind folks
who haven't done this in a while (me) or are first timers.
Then, it seems that simply calling cscript fsize.vbs (filename I gave
it) does not work. The full path to the program appears to need to be
specified, i.e. "cscript C:\Program Files\BBWin\ext\fsize.vbs". I
suspect that this is because simply invoking "cscript filename.vbs"
causes cscript to be executed in a working directory other than the
"ext" directory. Is this a bug? Saw someone else say that full pathing
a call to the cluster.exe script fixed their problem.
Trying cscript on the command line, it appears to gack on there being
a space in "Program Files" unless you enclose the supplied path in
quotes... which I'm not sure how to do inside the BBWin.cfg file.
So I had to create a "C:\BBWin\ext" directory and drop the script in
there, and it works. ... any way to get around this?
Thomas
On Mon, Aug 24, 2009 at 7:23 AM, Storer, Raymond<storerr (at) nibco.com> wrote:
> Thomas, you can try the code someone else pointed to at deadcat and you can also try this:
>
> Ray
>
> 'Author: Ray Storer
> 'Date: 2009-08-24
> 'Purpose: Check file size and existence
>
> Option Explicit
>
> 'If you want to use the registry to find this, feel free to change this.
> Const BBWIN_TMP_DIR = "C:\Program Files\BBWin\tmp\" 'change to meet your environment, but leave the trailing backslash
> Const BBWIN_TEST_NAME = "fsize" 'change to meet your requirements
>
> 'If you want to use the environment variables feel free to change this.
> Const HOST_NAME = "YOUR_MACHINE_NAME" 'change to meet your environment
>
> '16 gigabytes
> Const MAX_TOTAL_FILE_SIZE = 17179869184 'change to meet your requirements
> Dim RED_FILE_SIZE
> RED_FILE_SIZE = MAX_TOTAL_FILE_SIZE * 0.85 'change to meet your requirements
> Dim YELLOW_FILE_SIZE
> YELLOW_FILE_SIZE = MAX_TOTAL_FILE_SIZE * 0.70 'change to meet your requirements
>
> 'change the arrFiles(1) to the number of elements (files) you need minus 1.
> Dim oFso, arrFiles(1), strStatus, oFile, iSumFileSize, strRedGreen, strFileInfo
> iSumFileSize = 0
> strRedGreen = "GREEN"
> Set oFso = CreateObject("Scripting.FileSystemObject")
>
> 'change to meet your environment
> arrFiles(0) = "C:\Program Files\BBWin\bin\cpu.dll"
> arrFiles(1) = "C:\Program Files\BBWin\bin\disk.dll"
> 'keep adding arrFiles(...) here if you need more
> strStatus = ""
> strFileInfo = ""
>
> 'get the file sizes and set red if they do not exist
> Dim sFile
> for each sFile in arrFiles
> if (oFso.FileExists(sFile)) then
> Set oFile = oFso.GetFile(sFile)
> strFileInfo = strFileInfo & vbcrlf & sFile & vbtab & CStr(oFile.Size)
> iSumFileSize = iSumFileSize + oFile.Size
> else
> strRedGreen = "RED"
> if (len(strStatus) = 0) then
> strStatus = strRedGreen & " " & HOST_NAME & " " & CStr(Now())
> strStatus = strStatus & VbCrLf
> strStatus = strStatus & " " & sFile & " file does not exist."
> else
> strStatus = strStatus & " " & sFile & " file does not exist."
> end if 'check len of strStatus
> end if 'check for file existence
> next 'iterate over the files
>
> 'set red,yellow,green based on file sizes
> if (iSumFileSize >= RED_FILE_SIZE) then
> strRedGreen = "RED"
> else
> if (iSumFileSize >= YELLOW_FILE_SIZE) then
> if (strRedGreen <> "RED") then
> strRedGreen = "YELLOW"
> end if
> else
> if (strRedGreen <> "RED") then
> strRedGreen = "GREEN"
> end if
> end if
> end if
>
> if (len(strStatus) = 0) then
> strStatus = strRedGreen & " " & HOST_NAME & " " & CStr(Now())
> strStatus = strStatus & vbcrlf
> strStatus = strStatus & strFileInfo
> strStatus = strStatus & vbcrlf
> strStatus = strStatus & "Total File Size: " & CStr(iSumFileSize)
> else
> strStatus = strStatus & vbcrlf
> strStatus = strStatus & strFileInfo
> strStatus = strStatus & vbcrlf
> strStatus = strStatus & "Total File Size: " & CStr(iSumFileSize)
> end if
>
> Set oFile = ofso.CreateTextFile(BBWIN_TMP_DIR & BBWIN_TEST_NAME, true)
> oFile.WriteLine(strStatus)
> oFile.Close
>
> Set oFile = Nothing
> Set oFso = Nothing
>
> CONFIDENTIALITY NOTICE: This email and any attachments are for the
> exclusive and confidential use of the intended recipient. If you are not
> the intended recipient, please do not read, distribute or take action in
> reliance upon this message. If you have received this in error, please
> notify us immediately by return email and promptly delete this message
> and its attachments from your computer system. We do not waive
> attorney-client or work product privilege by the transmission of this
> message.
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe (at) hswn.dk
>
>
>