@echo off rem Script: ALARM-STB.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 %1 is group to notify rem %2 is message to send rem if not in failover, then only if this is running on collection station B (OVNNMB) rem will we send the alarm. rem if we ARE in failover, then we will send the alarm if we are station A (OVNNMA) rem rem also, StationB alarms send with a preference for using the StationB telalert engine, falling rem back to the StationA 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%"=="%STATIONB%" 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 %STATIONA% will handle alarms for STATIONB also IF "%COMPUTERNAME%"=="%STATIONA%" GOTO SENDALERT rem else, we must be the central management station (OVNNMMGT) GOTO END :OURALERT rem alert is for this station GOTO SENDALERT :SENDALERT telalertc -host %TELIPLIST% -g %1 -m %2 %TELOPTIONS% :end exit /B 0