Run Periodic Tasks with vovliveness

If the directory "tasks" exist in the Server Working Directory, the server calls the vovliveness script once per minute.

The script executes all the tasks contained in the "tasks" directory.


vovliveness: Usage Message
  
  DESCRIPTION:
      This script is called by vovserver about once a minute.
      It can be used to perform maintenance tasks.
  
  USAGE:
      % vovliveness [OPTIONS] <taskdirectory> <timestamp>
  
  WHERE:
     task_directory     -- is the directory with the tasks
                           to be executed. The tasks are those
                           that match the expression "live_*.tcl".
     timestamp          -- Currently ignored.
  
  OPTIONS:
     -v                 -- Increase verbosity.
  

There are many uses for vovliveness. Examples are available in the directory $VOVDIR/etc/liveness.

To activate this functionality, create the directory tasks and add some tasks files with a name matching the expression live_*.tcl. The Tcl interpreter has access to all vtk_* procedures. Example:
% cd `vovserverdir -p .`
% mkdir tasks
% cd tasks
% cp $VOVDIR/etc/liveness/live_start_taskers.tcl .
Following an example of the script live_start_taskers.tcl to restart any down taskers, once per hour:
#
# Copyright © 2007-2021, Altair Engineering
#
# All Rights Reserved.
#
# Directory : src/scripts/liveness
# File      : live_start_taskers.tcl
# Content   : Start down taskers once an hour.
# Note      :
#
# $Id: //vov/branches/2019.01/src/scripts/liveness/live_start_taskers.tcl#3 $
#

set now [clock seconds]

# Get or initialize period
if { [catch {set period [vtk_prop_get 1 LIVE_START_TASKERS_PERIOD]}] } {
    set period 3600
    catch {vtk_prop_set 1 LIVE_START_TASKERS_PERIOD $period}
}

# Get age
if { [catch {set lastRun [vtk_prop_get 1 LIVE_START_TASKERS_LAST]}] } {
    set lastRun 0
}
set age [expr {$now - $lastRun}]

if { $age >= $period } {

    # Start down taskers
    if { [catch {exec vovtaskermgr start >&@ stdout} errmsg] } {
        VovError "Failed to start taskers: $errmsg"
    }

    # Reset the last run TS
    catch {vtk_prop_set 1 LIVE_START_TASKERS_LAST $now}

}

Alerts from Liveness Tasks

Alerts may occur that are related to liveness tasks such as "The previous liveness script is still connected", especially in Monitor.
Note: In previous releases, there is no control these occurrences; such occurrences cause no harm.

The liveness tasks system is designed to support short jobs that are triggered frequently (about once per minute) by the vovserver so long as it is running. It was also used for the database loading task for Monitor checkouts and Accelerator jobs; sometimes these jobs run significantly longer.

In later releases the debuglog parsing, batch reports and other maintenance items are converted to periodic jobs that run on a dedicated vovtasker named 'maintainer', so these alerts should no longer appear.