Technical information

INSTALLATION AND ADMINISTRATION GUIDE
120
These arguments are passed to sys-devfail :
$1
Device name.
$2
Reason for the failure.
Example for Unix and Linux platforms
The following samples run on Unix and Linux platforms only (not on Windows platforms).
Below is a sample device fail Tcl script (sys-devfail.tcl) that automatically re-enables any failed device and
records the incident to a log file:
# Tcl script that runs when a fax device has failed.
#---------------------------------------------------
global argv argc env
#---------------------------------------------------
# Get all arguments and setup environment
set DEVICE [lindex $argv 0 ]
set REASON [lindex $argv 1 ]
set VSIFAX $env(VSIFAX)
set TMP_DIR "$VSIFAX/spool/temp"
set f [open $VSIFAX/spool/logs/devfail.log a+]
#---------------------------------------------------
#
# Update log file
puts $f "Device $DEVICE failed due to $REASON"
exit 0
Below is a sample device fail shell script (sys-devfail.sh) that automatically re-enables any failed device and
records the incident to a log file:
#!/bin/sh
# Description:
# -----------------------------------------------------
#exec > $VSIFAX/spool/logs/sysdev.log ; set -x
#------------------------------------------------------
# Get arguments
DEST=$1
CAUSE=$2
LOG="$VSIFAX/spool/logs/devfail.log"
#
# Update log file
echo "Device $DEST was restarted due to $CAUSE" >> $LOG
#
exit 0
Example for Windows platforms
Below is a sample device fail Tcl script (sys-devfail.tcl) that runs only on Windows platforms (not on Unix
and Linux platforms). It is called when a fax device goes down (for instance, after having encountered too many
errors). It logs the device failure and the failure reason in %VSI-FAX%/spool/logs/devfail, it sends a notification email
to an administrator and it re-enables the device.
#--------------------------------------------------------
# sys-devfail.tcl
# VSI-FAX Device failure notification and restart for Windows
#--------------------------------------------------------
#--------------------------------------------------------
# Get all arguments and setup environment
#--------------------------------------------------------
global argv env