Heartbeat to a Receiving System

  • Creator
    Topic
  • #51018
    Lawrence Staffieri
    Participant

      Good Afternoon,

      Currently, the CSC Client sends heartbeats to the CSC server on a routine basis depending on settings on the CSC Server for that client.

      I had a customer ask me for the CSC to also send Heartbeats to their system that is receiving messages.

      Has anyone else had to do this? and how would I go about handling this request?

      Thanks!

      Larry Staffieri

      Standing Stone Inc

    Viewing 2 reply threads
    • Author
      Replies
      • #68466

        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:

        Code:

        MSH|^~&|HEARTBEAT|HEARTBEAT|HEARTBEAT|HEARTBEAT|20080909082000||ORM^O01|999999-999999999999|P|2.3.1

        Example cron entry:

        Code:

        */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

        -- Max Drown (Infor)

      • #68467
        Lawrence Staffieri
        Participant

          Thank you for the reply.  We’ll give it a go and see how it works for us.

        • #68468
          Scott Folley
          Participant

            It seems to me that this is something that you should be able to do with CSC by itself.  Just set up custom_main.tcl with an event that fires after 60000 milliseconds.  The event that it executes would just need to create a message (a heartbeat) and put it on the outbound queue then schedule itself again in 60000 milliseconds.  There are also probably ways to have the event check to see if there was idle time before it tries to send.  Off the cuff it seems that this could be done by checking the outbound log to see when the last message was sent.  I have not done this part but it certainly seems like it would work.

        Viewing 2 reply threads
        • The forum ‘Cloverleaf Secure Courier’ is closed to new topics and replies.