Page 2 of 2

Re: diagnostic settings

Posted: Sun 26 Apr 2015 2:47 pm
by mcrossley
Here is the version I have put on my server - I have only been caught once, but it was a pain. I save the below in the CumulusMX folder as testMXrunningT.bat, have Cumulus process it at my update interval (5 minutes) to file name testMXrunning.bat, then have that as my external program.

Code: Select all

Setlocal EnableDelayedExpansion
if '<#DataStopped>'=='1' (
	if not exist stopping.flag (
		echo Cumulus stopping @ %time% > stopping.flag
		taskkill /im CumulusMX.exe
:loop
		tasklist | find /i "CumulusMX"
		if %errorlevel% == 1 (
			del stopping.flag
			rem Optionally restart Cumulus here.
		) else (
			timeout 5
			goto loop
		)
	)
)

Re: diagnostic settings

Posted: Sun 26 Apr 2015 11:13 pm
by BCJKiwi
Mark,
I process at realtime as it takes a while to close MX.
I wanted to close MX ASAP so there is a chance to get all the archive records from the logger when restarting.
Running it at tag interval guarantees at least one lost archive record.

Some versions of my realtime.cmd have other actions so the external program slot is already occupied - hence the separate file with realtime.cmd calling the data stopped tag file.
However this seemed to play havoc with Setlocal EnableDelayedExpansion and was unable to use it - took a while to get a syntax that worked OK.

Would not recommend the restart option. As noted in previous post, if the connection is not available when restarting MX nothing is achieved - MX runs but does nothing and won't recognise the connection if it is established later. So if you are there to fix the connection you may as well restart MX and monitor that it is running OK.