Hi

Did you figure this one out?

I would look at the ". The line below Is from a script that I use, notice the 
difference between " and "

Set oAPI = CreateObject("MOM.ScriptAPI")

//Fredrik
_________________
Fredrik Sköld
Systemtekniker
Länsstyrelsernas IT-Enhet

Från: [email protected] [mailto:[email protected]] 
För Brandy Reid
Skickat: den 15 augusti 2013 18:58
Till: [email protected]
Ämne: [msmom] File Size monitoring

Hi IT Forum,

Does anyone have a SCOM 2012 script they can share for monitoring file sizes on 
Windows Servers?

The one I'm using isn't generating an alert in the console..

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = 
objFSO.GetFile("C:\Users\whoami\AppData\Local\Microsoft\Microsoft.EnterpriseManagement.Monitoring.Console\momcache.mdb")
varSize = objFile.Size

Dim oAPI, oBag
If varSize > 1024 Then
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Call oBag.AddValue("Status","Bad")
Call oBag.AddValue("Size", varSize)
Call oAPI.Return(oBag)
Else
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Call oBag.AddValue("Status","Ok")
Call oAPI.Return(oBag)
End If

Thanks,
Brandy

Brandy Reid<mailto:[email protected]>

MCSE / MCDBA

Systems Administrator

IT-Automation and Monitoring

Phone 901-227-3061  Fax 901-227-1001

http://www.linkedin.com/in/brandyreid



[Description: Description: M:\Graphics\100 years.jpg]
Baptist Memorial Health Care<http://www.baptistonline.org/>

Smart Medicine. Inspired Care. And the awards
to prove it.  Recognized as a Top 50 Healthcare Network.

Opinions expressed above are not necessarily those of BMHCC


This message and any files transmitted with it may contain legally privileged, 
confidential, or proprietary information. If you are not the intended recipient 
of this message, you are not permitted to use, copy, or forward it, in whole or 
in part without the express consent of the sender. Please notify the sender of 
the error by reply email, disregard the foregoing messages, and delete it 
immediately.


P Please consider the environment before printing this email...





<<inline: image001.jpg>>

Reply via email to