Top
PRIMECLUSTER GLS for Windows User's Guide 4.3

3.4.8 Setting Execution of User Scripts

Batch files prepared by the user can be executed with a specific timing. For more details on the trigger timing, refer to "2.4.1 Execution of User Scripts." To apply this function, you must set the definition files beforehand. You may use a sample file for reference when creating a batch file.

[Sample Files]

When an error has been detected on a transmission path

<GLS Installation Directory>\usr\script\monitor\sha.sam

When an error has been detected in the destination system

<GLS Installation Directory>\usr\script\monitor\nodeEvent.sam

[Setup Files]

When an error has been detected on a transmission path

<GLS Installation Directory>\usr\script\monitor\shaX.bat

When an error has been detected in the destination system

<GLS Installation Directory>\usr\script\monitor\nodeEvent.bat

Note

  • The wait time after completing the batch file is max. 1 second. If the time for executing the batch file exceeds 1 second, possibly multiple instances of the batch file are being executed at the same time.

  • Batch files for detecting errors on transmission paths have to be created separately for each virtual adapter. If you have multiple virtual adapters sharing the same physical adapter, please create a batch file for one of these virtual adapters.

The procedure for setting batch files is as follows:

When an error has been detected on a transmission path

[Format for Triggering Scripts]

<GLS Installation Directory>\usr\script\monitor\shaX.bat param1 param2

param1
Primary:   Error in the primary interface
Secondary: Error in the secondary interface
all:       Errors in both interfaces, primary and secondary
param2
disconnect: An error in the link status of a physical adapter has been detected.
fail:       The ping monitor has detected an error of a network device.

[Sample Definition File]

@echo off
@if not "%ECHO%"=="" echo %ECHO%
setlocal
pushd
set RETCODE=0
set TARGET=%1
set EVENT=%2

if {%TARGET%}=={Primary} (
          if {%EVENT%}=={disconnect} (
                   rem -- add procedure for primary disconnect --
          ) else if {%EVENT%}=={fail} (
                  rem -- add procedure for primary fail --
          )
) else if {%TARGET%}=={Secondary} (
         if {%EVENT%}=={disconnect} (
                   rem -- add procedure for secondary disconnect --
          ) else if {%EVENT%}=={fail} (
                   rem -- add procedure for secondary fail --
          )
) else if {%TARGET%}=={all} (
          if {%EVENT%}=={disconnect} (
                   rem -- add procedure for all disconnect --
          ) else if {%EVENT%}=={fail} (
                   rem -- add procedure for all fail --
          )
)

When an error has been detected in the destination system

[Format for Triggering Scripts]

<GLS Installation Directory>\usr\script\monitor\nodeEvent.bat param1 param2
param1
target:  IP address of destination system
param2
fail:    The ping monitor has detected an error in the destination system.

[Sample Definition File]

@echo off
@if not "%ECHO%"=="" echo %ECHO%
setlocal
pushd
set RETCODE=0
set TARGET=%1
set EVENT=%2

rem -- modify target IP address --
set REMOTE_NODE1=192.168.1.1
set REMOTE_NODE2=192.168.1.2

if {%TARGET%}=={%REMOTE_NODE1%} (
          if {%EVENT%}=={fail} (
                   rem -- add procedure for node monitoring --
          )
) else if {%TARGET%}=={%REMOTE_NODE2%} (
          if {%EVENT%}=={fail} (
                   rem -- add procedure for node monitoring --
          )
)