The following script can be used to track the CPU averages of your Zee.
It uses the linux uptime command which returns 3 load averages at 1m, 5m and 15m. Since it is an average, it provides a pretty decent mechanism for tracking the CPU performance.
Save the following script as ZeeCPU.vb
Setup a recurring event to run from the top of the hour, every 15 mins.
I'd be curious to see your results.
You can open the file and view the log file using WinSCP or PuTTY.
It uses the linux uptime command which returns 3 load averages at 1m, 5m and 15m. Since it is an average, it provides a pretty decent mechanism for tracking the CPU performance.
Save the following script as ZeeCPU.vb
Setup a recurring event to run from the top of the hour, every 15 mins.
I'd be curious to see your results.
PHP Code:
Sub Main(parm as object)
dim proc as System.Diagnostics.Process
dim resp,s as String
dim ary() as String
dim i as Integer
dim sw as System.IO.StreamWriter
Try
proc = new System.Diagnostics.Process()
proc.StartInfo.FileName="/usr/bin/uptime"
proc.StartInfo.UseShellExecute=False
proc.StartInfo.RedirectStandardOutput = True
proc.Start()
resp=proc.StandardOutput.ReadToEnd()
ary = resp.Split(New Char() {","c})
If(UBound(ary)>=4) then
sw = new System.IO.StreamWriter("/usr/local/HomeSeer/Data/ZeeCPUPerformance.txt",True)
sw.Write(Now() & "," & ary(4))
End If
Catch ex as Exception
hs.writeLog("Exception",ex.message)
Finally
If(not sw Is Nothing) then
sw.Close()
End If
End Try
End Sub
Comment