Hey guys, I am trying to write a script and event to email me if free memory gets low on my system. I am using Jon00's performance monitoring script and it is recording System Physical Memory Available in device Z31. The value will usually read something like this: 2060.99 MB
I am trying to write a little script based event to look at that value and shoot me an email in the event that the value goes below 1000 MB.
What I put together is below, but does not seem to be working.
Sub Main()
Dim Mem_Usage
Mem_Usage = hs.DeviceValue("Z31")
If Mem_Usage < 1000 Then hs.SetDeviceValue "v4","On"
If Mem_Usage < 1000 Then hs.SetDeviceString "V4","High"
If Mem_Usage > 1000 Then hs.SetDeviceValue "v4","Off"
If Mem_Usage > 1000 Then hs.SetDeviceString "V4","Normal"
hs.SetDeviceLastChange "V4", now
End Sub
I then setup an event that watches V4 to see if it switches to On or High.
Any thoughts?
I am trying to write a little script based event to look at that value and shoot me an email in the event that the value goes below 1000 MB.
What I put together is below, but does not seem to be working.
Sub Main()
Dim Mem_Usage
Mem_Usage = hs.DeviceValue("Z31")
If Mem_Usage < 1000 Then hs.SetDeviceValue "v4","On"
If Mem_Usage < 1000 Then hs.SetDeviceString "V4","High"
If Mem_Usage > 1000 Then hs.SetDeviceValue "v4","Off"
If Mem_Usage > 1000 Then hs.SetDeviceString "V4","Normal"
hs.SetDeviceLastChange "V4", now
End Sub
I then setup an event that watches V4 to see if it switches to On or High.
Any thoughts?
Comment