@echo off rem Script: Bldg AALARM.BAT rem Author: Chris Bartram rem Modified: rem 10/21/03 Added TELOPTIONS variable with telalert options for preventing DUP messages rem and basic response option rem rem parm 1 is group to notify rem parm 2 is message to send rem if not in failover, then only if this is running on Bldg A collection station (OVNNMA) rem will we send the alarm. rem if we ARE in failover, then we will send the alarm if we are the Bldg B station (OVNNMB) rem rem also, Bldg A alarms send with a preference for using the Bldg A telalert engine, falling rem back to the Bldg B server if that engine isn't answering rem The following environment variables must be setup before running this script: set STATIONB=OVNNMB set STATIONA=OVNNMA set FAILOVERFILE=C:\INFAILOVER.SWI set TELOPTIONS=-holdifsent -holdrefresh -releasewait 10m -check "%2" -response basic if "%COMPUTERNAME%"=="OVNNMB" GOTO OVNNMB if "%COMPUTERNAME%"=="OVNNMMGT" GOTO OVNNMMGT if "%COMPUTERNAME%"=="OVNNMA" GOTO OVNNMA GOTO SETUPEND :OVNNMB set TELIPLIST=10.2.1.1,10.1.1.1 GOTO SETUPEND :OVNNMMGT set TELIPLIST=10.2.1.1,10.1.1.1 GOTO SETUPEND :OVNNMA set TELIPLIST=10.1.1.1,10.2.1.1 GOTO SETUPEND :SETUPEND if "%COMPUTERNAME%"=="%STATIONA%" GOTO OURALERT rem Alert not for this system IF EXIST %FAILOVERFILE% GOTO FAILOVER rem echo alarm not for this station, no failover, we don't handle this alarm goto end :FAILOVER rem In Failover mode rem if in failover, then %STATIONB% will handle alarms for Bldg A also IF "%COMPUTERNAME%"=="%STATIONB%" GOTO SENDALERT rem else, we must be the central management station (OVNNMMGT) GOTO END :OURALERT rem alert is for this station GOTO SENDALERT :SENDALERT D:\telalert\telalertc -host %TELIPLIST% -g %1 -m %2 %TELOPTIONS% :end