We have to send and receive a heart beat to an external vendor. Here’s how we do it. Note that the vendor also uses Cloverleaf.
Example message:
MSH|^~&|HEARTBEAT|HEARTBEAT|HEARTBEAT|HEARTBEAT|20080909082000||ORM^O01|999999-999999999999|P|2.3.1
Example cron entry:
*/5 * * * * /hci/bin/heartbeat testbno bno31 bno31bblab_out heartbeat_bb.hl7 heartbeat_bb.log > /dev/null 2>&1
heartbeat.tcl
#!/hci/quovadx/qdx5.6/integrator/bin/tcl
################################################################################
#
# Name: heartbeat
# Developer: Max Drown
# Date: 09/15/2008
# Purpose: Send a heartbeat to keep vpn/firewall connections alive
#
################################################################################
# Note: The heartbeat message needs to be in $HCISITEDIR/iig/files/ directory.
global HciRoot
# Set the date (used for debugging and logging if needed)
set date [clock format [clock seconds] -format %Y%m%d]
# Example cron:
#00,05,10,15,20,25,30,35,40,45,50,55 * * * * . ~/.profile.cron;/hci/bin/heartbeat.tcl testbno bno31 bno31bblab_out heartbeat_bb.hl7 heartbeat_bb.log > /dev/null 2>&1
# Get args
set scriptName $argv0
set site [lindex $argv 0]
set process [lindex $argv 1]
set thread [lindex $argv 2]
set heartbeat [lindex $argv 3]
set log [lindex $argv 4]
# Set up the environment for Cloverleaf commands
eval [exec $HciRoot/sbin/hcisetenv -root tcl $HciRoot $site]
# Send the heartbeat
#catch {exec hcicmd -p $process [code]#!/hci/quovadx/qdx5.6/integrator/bin/tcl
################################################################################
#
# Name: heartbeat
# Developer: Max Drown
# Date: 09/15/2008
# Purpose: Send a heartbeat to keep vpn/firewall connections alive
#
################################################################################
# Note: The heartbeat message needs to be in $HCISITEDIR/iig/files/ directory.
global HciRoot
# Set the date (used for debugging and logging if needed)
set date [clock format [clock seconds] -format %Y%m%d]
# Example cron:
#00,05,10,15,20,25,30,35,40,45,50,55 * * * * . ~/.profile.cron;/hci/bin/heartbeat.tcl testbno bno31 bno31bblab_out heartbeat_bb.hl7 heartbeat_bb.log > /dev/null 2>&1
# Get args
set scriptName $argv0
set site [lindex $argv 0]
set process [lindex $argv 1]
set thread [lindex $argv 2]
set heartbeat [lindex $argv 3]
set log [lindex $argv 4]
# Set up the environment for Cloverleaf commands
eval [exec $HciRoot/sbin/hcisetenv -root tcl $HciRoot $site]
# Send the heartbeat
#catch {exec hcicmd -p $process