Up | Application Start/Stop Commands | Alive-Check | Position and Size

 

  

 
Alive-Check

Specially rigged applications can cooperate with Resuscitator by updating an "alive" - flag in the Resuscitator configuration file.

Within the chosen number of intervals, the application must have written to the file.

The resuscitator’s configuration file is a standard Windows ini file. The controlled application must update a key with the name of its application name under the section [AliveStatus] to the numeric value of 1.

For example, if the application is "Server", the following line:

[AliveStatus]
Server=1

must be written to the configuration file. If the application fails to do this within the specified time, it will be restarted by Resuscitator.

In the screen shot to the right Resuscitator has been configured to perform alive-check on the Server application.

Note: You should use the Win32 API function WritePrivateProfileString for this, since this is an atomic operation. See your Win32 API documentation if unsure.

 

Example usage with Scorpion (min. ver. 8.1.0.462)

1) Configure Resuscitator for monitoring Alive-Check for particular scorpion profile.
2) In scorpion profile add PythonScript tool with scrip:

try:
  import ctypes
except Exception, ex:
  print "-" * 80
  print "Unable to load CTYPES library. Check if it is installed."
  print ex
  print "-" * 80

# Configuration
appName = "Server"; # Application name (as shown in Resuscitator).
iniFile = r"C:\profiles\Resuscitator.ini"; # Resuscitator configuration file.

# Write alive status for resuscitator.
ctypes.windll.kernel32.WritePrivateProfileStringA("AliveStatus", appName, "1", iniFile)

3) In the script change variables appName and iniFile according to your Resuscitator configuration.

 


Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2017 Tordivel AS.