[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

2674.0. "ALARM BUILDER COM FILE" by FAILTE::JONESR (Buy one and stop me ;-}) Thu Apr 02 1992 08:25

       Hello,

       Anybody interested in a command file which will ask questions,
       then build command files to create, enable, and disable DECmcc
       alarms ?

       If so, see .1 - (Note it's over 2500 lines)

       I suggest you start it from a subdirectory.

       Note that not all questions are "verified" so it is possible to
       enter "garbage".

       Please try to break it - and let me know if you succeed ;-)


       Richard.

    
T.RTitleUserPersonal
Name
DateLines
2674.1BUILDER.COMFAILTE::JONESRBuy one and stop me ;-}Thu Apr 02 1992 08:252550
$ sv=f$v(0)
$ on error then goto error_exit
$ set control = y
$ on control_y then goto control_exit
$ !
$ ! +
$ TITLE:
$ !
$ !	* * *   B U I L D E R . C O M   * * *
$ ! -
$ !
$ ! +
$ REVISION:
$ !
$ !	V1.0	24-MAR-1992	Initial Release
$ ! -
$ !
$ ! +
$ ABSTRACT:
$ !
$ !	Builds command files to create, enable, and disable DECmcc alarm
$ !	rules.
$ ! -
$ !
$ ! +
$ DEFINITIONS:
$ !
$	say		=	"write sys$output"
$	go		=	"set default"
$       home_dir        =      	f$trnlnm("SYS$LOGIN")
$       home_root       =      	home_dir - "]" + "."
$       home_seq        =      	f$fa("!AD[2H",1,f$fa("!27**"))
$       cl_seq          =      	f$fa("!AD[2J",1,f$fa("!27**"))
$       cl              =      	"write sys$output cl_seq+home_seq"
$	mcc		=	"manage/enterprise"
$	quote		=	"""""
$	bold_on		=	f$fa("!AD[1m",1,f$fa("!27**"))
$	underline_on	=	f$fa("!AD[4m",1,f$fa("!27**"))
$	blink_on	=	f$fa("!AD[5m",1,f$fa("!27**"))
$	inverse_on	=	f$fa("!AD[7m",1,f$fa("!27**"))
$	dbltop		=	f$fa("!AD#3",1,f$fa("!27**"))
$	dblbot		=	f$fa("!AD#4",1,f$fa("!27**"))
$	all_off		=	f$fa("!AD[0m",1,f$fa("!27**"))
$	oblique		=	"/"
$	edit		=	"edit"
$	thisdir		=	f$env("default")
$	thisdir_root	=	thisdir - "]" + "."
$	aldir		=	thisdir_root + "alarm]"
$	profdir		=	thisdir_root + "profile]"
$	workdir		=	thisdir_root + "work]"
$	pu*rge		=	"purge"
$
$ ! -
$ !
$ ! +
$ HELP:				subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	if	-
		p1 .eqs. ""
$	then
		say	-
"%BUILDER-E-NOHELP, No help available."
$		exit
$	endif
$ !
$	if	-
		p1 .eqs. "DOMFILE"
$	then
$		type sys$input
$		deck

	BUILDER has located the file SYS$LOGIN:MCC_DOMAINS.LIS
	which was created by a previous execution of BUILDER.

	This file is used to determine which MCC domain contains
	the Entity for which you wish to create Alarm Rules.

	If you have added new Entities into DECmcc, you should
	select the Build option, otherwise Use the existing
	file.

$		eod
$	endif
$ !
$	if	-
		p1 .eqs. "DOMAIN"
$	then
$		type sys$input
$		deck

	The Entity you have selected has been found in more
	than one domain.

	You must select the domain in which you wish DECmcc
	Alarm Rules to be created.
	
$		eod
$	endif
$ !
$	if	-
		p1 .eqs. "ENTITY"
$	then
$		type sys$input
$		deck

	You must enter the name of the DECmcc global entity
	for which you want to create DECmcc alarms.

	Your response must be in the format shown below :

	NODE4 .DNA_NODE.MYVAX
	NODE4 .MYVAX
	BRIDGE .BRIDGE.MYBRIDGE
	BRIDGE .MYBRIDGE

$		eod
$		exit
$	endif
$	
$ !
$	if	-
		p1 .eqs. "AREA"
$	then
$		type sys$input
$		deck

	Use this rule to ensure that crucial areas are reachable 
	from a particular area routing node.

$		eod
$		exit
$	endif
$ !
$	if	-
		p1 .eqs. "PARAMETER"
$	then
$		type sys$input
$		deck

	When DECmcc discovers an alarm condition, designated users 
	can be sent VAXamil notifications of the alarm condition.

	You should enter the VAXmail address for receipt of such mail.

$		eod
$		exit
$	endif
$ !
$ !
$	if	-
		p1 .eqs. "BATCH_QUEUE"
$	then
$		type sys$input
$		deck

	When an alarm condition is discovered, DECmcc starts a batch
	job which notifies designated users of the alarm condition

	You should enter the name of a batch queue which may be used
	for this purpose.

$		eod
$		exit
$	endif
$ !
$	if	-
		p1 .eqs. "LINE"
$	then
$		type sys$input
$		deck

	This procedure will create the following alarm rules for
	the specified line :

        LINE_CONTENTION

	Enter the name of the line for which this rule should
	be created.

$		eod
$		exit
$	endif
$ !
$	if	-
		p1 .eqs. "CIRCUIT"
$	then
$		type sys$input
$		deck

	This procedure will create the following alarm rules for
	the specified circuit :

	ADJACENCY_DOWN
	CIRCUIT_DOWNS
	CIRCUIT_SUBSTATE
        TUNING_NEEDED
	NODE_ERRORS

	Enter the name of the line for which this rule should
	be created.

$		eod
$		exit
$	endif
$ !
$	if	-
		p1 .nes. ""
$	then
		say	-
"%BUILDER-E-TBS, Help to be supplied."
$		exit
$	endif
$	endsubroutine
$ ! -
$ !
$ ! +
$ DONE_MESSAGE:			subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$!	wait 00:00:05
$	cl
$	say 	-
"%BUILDER-S-DONE, Normal successful completion."
$	say 	-
"%BUILDER-I-CREATED, Builder has created the following files :"
$	say 	""
$	say 	-
"''p1'"
$	say 	""
$	say	-
"%BUILDER-I-CHECK, You should check that the above files contain the"
$	say	-
"-BUILDER-I-CHECK, correct alarm rules you want to create"
$	say 	""
$	say	-
"%BUILDER-I-MODIFIED, Builder has modified the following files :"
$	say	""
$	say	-
"''p2'"
$	say	-
"%BUILDER-I-CHECK, You should check that the above files contain the"
$	say	-
"-BUILDER-I-CHECK, correct information."
$	say	""
$	say	""
$	say	-
"%BUILDER-I-RESUBMIT, Remember to resubmit the batch file ''p3'"
$	say	""
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ BUILD_NODE4_ALARM_FILES:	subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	copy	nl:	'aldir''entity_name'_create_mcc_alarms.com
$	copy	nl:	'aldir''entity_name'_enable_mcc_alarms.com
$	copy	nl:	'aldir''entity_name'_disable_mcc_alarms.com
$ !
$	files_created_list	==	"''aldir'''entity_name'_create_mcc_alarms.com" + "
" + -
                                        "''aldir'''entity_name'_enable_mcc_alarms.com" + "
" + -
                                        "''aldir'''entity_name'_disable_mcc_alarms.com"
$ !
$	open		/append		-
	create_file	'aldir''entity_name'_create_mcc_alarms.com	
$ !
$	open		/append		-
	enable_file	'aldir''entity_name'_enable_mcc_alarms.com	
$ !
$	open		/append		-
	disable_file	'aldir''entity_name'_disable_mcc_alarms.com	
$ !
$	write 	create_file 	"$ ! ''entity_name'_CREATE_MCC_ALARMS.COM"		
$	write 	create_file 	"$ !"
$	write 	create_file 	"$ 	MANAGE / ENTERPRISE"
$	write 	create_file 	"!"
$ !
$	write	enable_file	"! ''entity_name'_ENABLE_MCC_ALARMS.COM"		
$	write	enable_file	"!"
$ !
$	write	disable_file	"! ''entity_name'_DISABLE_MCC_ALARMS.COM"		
$	write	disable_file	"!"
$ !
$	write	create_file	"!"
$	write	create_file	"! *****************************************************************************"
$	write	create_file	"!               DECNET PHASE IV alarm rules..."
$	write	create_file	"! *****************************************************************************"
$	write	create_file	"!"
$ !
$	if	-
		node4_rule_1
$	then
$ !
$		circ_count = 1
$ !
$ NODE4_RULE_1_LOOP:
$ !
$		TARGET$CIRCUIT	= 	TARGET$CIRCUIT'circ_count'
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%                    C I R C U I T   P R O B L E M S                      %%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''entity_name'_circuit_''TARGET$CIRCUIT'_substate -"
$		write	create_file	" expression        = -"
$		write	create_file	"(change_of(''TARGET$ENTITY' circuit ''TARGET$CIRCUIT' substate, none,*)), -"
$		write	create_file	" procedure         = mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler = mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" category          = ''quote'Circuit Problems''quote', -"
$		write	create_file	" description       = ''quote'If the substate is anything other than NONE, then -"
$		write	create_file	"                      either there is a problem with the circuit or the -"
$		write	create_file	"                      circuit is in  the OFF or SERVICE state.''quote', -"
$		write	create_file	" queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter         = ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''entity_name'_circuit_''TARGET$CIRCUIT'_substate, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''entity_name'_circuit_''TARGET$CIRCUIT'_substate, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$		write	disable_file	"!"
$ !
$		circ_count = circ_count + 1
$ !
$		if	-
			f$type(TARGET$CIRCUIT'circ_count') .nes. ""
$		then
$			goto node4_rule_1_loop
$		endif
$	endif
$ !
$	if	-
		node4_rule_2
$	then
$ !
$		circ_count = 1
$ !
$ NODE4_RULE_2_LOOP:
$ !
$		TARGET$CIRCUIT	= 	TARGET$CIRCUIT'circ_count'
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%            M O N I T O R   C I R C U I T   D O W N S                    %%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''entity_name'_circuit_''TARGET$CIRCUIT'_downs -"
$		write	create_file	" expression         = -"
$		write	create_file	"(''TARGET$ENTITY' cir ''TARGET$CIRCUIT' circuit down > 3, -"
$		write	create_file	"                        at every 15:00:00), -"
$		write	create_file	" description        =  ''quote'Circuit counter data errors and circuit -"
$		write	create_file	"                        downs could also be watched to ensure the circuits -"
$		write	create_file	"                        are running clean. -"
$		write	create_file	"                        ==> COUNTER TIMER SHOULD BE AT 65000 <==''quote', -"
$		write	create_file	" procedure          =  mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler  =  mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter          =  ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity = warning, -"
$		write	create_file	" in domain          = ''TARGET$DOMAIN' "
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''entity_name'_circuit_''TARGET$CIRCUIT'_downs, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                  ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''entity_name'_circuit_''TARGET$CIRCUIT'_downs, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                  !"
$		write	disable_file	"!"
$
$		circ_count = circ_count + 1
$ !
$		if	-
			f$type(TARGET$CIRCUIT'circ_count') .nes. ""
$		then
$			goto node4_rule_2_loop
$		endif
$	endif
$ !
$	if	-
		node4_rule_3
$	then
$ !
$		circ_count = 1
$ !
$ NODE4_RULE_3_LOOP:
$ !
$		TARGET$CIRCUIT	= 	TARGET$CIRCUIT'circ_count'
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%            M O N I T O R   I N B O U N D   D A T A   E R R O R S        %%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''entity_name'_''TARGET$CIRCUIT'_errors -"
$		write	create_file	" expression         = -"
$		write	create_file	"(''TARGET$ENTITY' cir ''TARGET$CIRCUIT' data errors inbound > 20, -"
$		write	create_file	"                        at every 15:00:00), -"
$		write	create_file	" description        =  ''quote' Data error count is too high in INBOUND -"
$		write	create_file	"                         stream. -"
$		write	create_file	"                         ==> COUNTER TIMER SHOULD BE AT 65000 <==''quote', -"
$		write	create_file	" procedure          =  mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler  =  mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter          =  ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity = minor, -"
$		write	create_file	" in domain          = ''TARGET$DOMAIN' "
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''entity_name'_''TARGET$CIRCUIT'_errors, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'           ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''entity_name'_''TARGET$CIRCUIT'_errors, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'           !"
$		write	disable_file	"!"
$
$		circ_count = circ_count + 1
$ !
$		if	-
			f$type(TARGET$CIRCUIT'circ_count') .nes. ""
$		then
$			goto node4_rule_3_loop
$		endif
$	endif
$ !
$	if	-
		node4_rule_4
$	then
$ !
$		circ_count = 1
$ !
$ NODE4_RULE_4_LOOP:
$ !
$		TARGET$CIRCUIT	= 	TARGET$CIRCUIT'circ_count'
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%            M O N I T O R   O U T B O U N D   D A T A   E R R O R S      %%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''entity_name'_''TARGET$CIRCUIT'_errors_o -"
$		write	create_file	" expression         = -"
$		write	create_file	"(''TARGET$ENTITY' cir ''TARGET$CIRCUIT' data errors outbound > 20, -"
$		write	create_file	"                        at every 15:00:00), -"
$		write	create_file	" description        =  ''quote' Data error count is too high in OUTBOUND -"
$		write	create_file	"                         stream. -"
$		write	create_file	"                         ==> COUNTER TIMER SHOULD BE AT 65000 <==''quote', -"
$		write	create_file	" procedure          =  mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler  =  mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter          =  ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity = minor, -"
$		write	create_file	" in domain          = ''TARGET$DOMAIN' "
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''entity_name'_''TARGET$CIRCUIT'_errors_o, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'           ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''entity_name'_''TARGET$CIRCUIT'_errors_o, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'           !"                    
$		write	disable_file	"!"
$
$		circ_count = circ_count + 1
$ !
$		if	-
			f$type(TARGET$CIRCUIT'circ_count') .nes. ""
$		then
$			goto node4_rule_4_loop
$		endif
$	endif
$ !
$	if	-
		node4_rule_5
$	then
$ !
$		line_count = 1
$ !
$ NODE4_RULE_5_LOOP:
$ !
$		TARGET$LINE	= 	TARGET$LINE'line_count'
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%                    T R A N S M I T   P R O B L E M S                    %%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''entity_name'_line_''TARGET$LINE'_contention -"
$		write	create_file	" expression        = -"
$		write	create_file	"(change_of(''TARGET$ENTITY' line ''TARGET$LINE' send failure,*, *), -"
$		write	create_file	"                        at every 01:00:00), -"
$		write	create_file	" procedure         = mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler = mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" category          = ''quote'Transmit problems''quote', -"
$		write	create_file	" description       = ''quote'If a line cannot send a packet after 16 attempts -"
$		write	create_file	"                      this counter will increase.  This is only true for -"
$		write	create_file	"                      ethernet lines and usually indicates that the -"
$		write	create_file	"                      channel is very heavily used.''quote', -"
$		write	create_file	" queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter         = ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity = minor, - "
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	create_file	" "
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''entity_name'_line_''TARGET$LINE'_contention, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                    ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''entity_name'_line_''TARGET$LINE'_contention, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                    !"
$		write	disable_file	"!"
$
$		line_count = line_count + 1
$ !
$		if	-
			f$type(TARGET$LINE'line_count') .nes. ""
$		then
$			goto node4_rule_5_loop
$		endif
$	endif
$ !
$	if	-
		node4_rule_6
$	then
$ !
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%                    T R A F F I C   I N D I C A T O R                    %%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''entity_name'_peak_links -"
$		write	create_file	" expression         = (''TARGET$ENTITY' maximum logical links active>30, -"
$		write	create_file	"                       at every 12:00:00), -"
$		write	create_file	" procedure         = mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler = mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" category          = ''quote'Traffic Indicator''quote', -"
$		write	create_file	" description       = ''quote'This attribute represents the peak number of -"
$		write	create_file	"                      logical links active on the specified system. -"
$		write	create_file	"                      If this counter regularly reaches the value of -"
$		write	create_file	"                      MAXIMUM LINKS, some users may be experiencing -"
$		write	create_file	"                      network resource problems. Set the constant value -"
$		write	create_file	"                      (30 above) to or near your MAXIMUM LINKS  value.''quote', -"
$		write	create_file	" queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter         = ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity = warning, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''entity_name'_peak_links, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'               ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''entity_name'_peak_links, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'               !"
$		write	disable_file	"!"
$ !
$	endif
$ !
$	if	-
		node4_rule_7
$	then
$ !
$		circ_count = 1
$ !
$ NODE4_RULE_7_LOOP:
$ !
$		TARGET$CIRCUIT	= 	TARGET$CIRCUIT'circ_count'
$		write	create_file	"!# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!# %%                                                                         %%"
$		write	create_file	"!# %%           M O N I T O R   C I R C U I T S                               %%"
$		write	create_file	"!# %%                                                                         %%"
$		write	create_file	"!# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!#"
$		write	create_file	"create mcc 0 alarms rule nodename_''TARGET$CIRCUIT'_adjacency_down -"
$		write	create_file	"  expression        = -"
$		write	create_file	"(occurs(''TARGET$ENTITY' circuit ''TARGET$CIRCUIT' adjacent node * -"
$		write	create_file	"                          adjacency down)), -"
$		write	create_file	"  category          =  ''quote'circuit_events''quote', -"
$		write	create_file	"  description       =  ''quote'This rule is made on routers to detect if -"
$		write	create_file	"                         any of the routers becomes unreachable''quote', -"
$		write	create_file	"  procedure         =  mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	"  exception handler =  mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	"  parameter         =  ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity =  critical, -"
$		write	create_file	" in domain          = ''TARGET$DOMAIN'"
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule nodename_''TARGET$CIRCUIT'_adjacency_down, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                   !"
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule nodename_''TARGET$CIRCUIT'_adjacency_down, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                   !"
$		write	disable_file	"!"
$
$		circ_count = circ_count + 1
$ !
$		if	-
			f$type(TARGET$CIRCUIT'circ_count') .nes. ""
$		then
$			goto node4_rule_7_loop
$		endif
$	endif
$ !
$	if	-
		node4_rule_8
$	then
$ !
$		circ_count = 1
$ !
$ NODE4_RULE_8_LOOP:
$ !
$		TARGET$CIRCUIT	= 	TARGET$CIRCUIT'circ_count'
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%            C I R C U I T   N E E D S   T U N I N G                      %%"
$		write	create_file	"! %%                                                                         %%"
$		write	create_file	"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule nodename_''TARGET$CIRCUIT'_tuning_needed -"
$		write	create_file	" expression         = -"
$		write	create_file	"(''TARGET$ENTITY' cir ''TARGET$CIRCUIT' transit congestion loss > 10, -"
$		write	create_file	"                         at every 12:00:00), -"
$		write	create_file	" description        = ''quote'Check to see how circuits are doing. Transit -"
$		write	create_file	"                       congession loss is an indication that the circuit -"
$		write	create_file	"                       is saturated or may need tuning''quote', -"
$		write	create_file	" procedure          =  mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler  =  mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" queue              = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter          = ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity = minor, -"
$		write	create_file	" in domain          = ''TARGET$DOMAIN'"
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule nodename_''TARGET$CIRCUIT'_tuning_needed, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                  ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule nodename_''TARGET$CIRCUIT'_tuning_needed, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                  !"
$		write	disable_file	"!"
$
$		circ_count = circ_count + 1
$ !
$		if	-
			f$type(TARGET$CIRCUIT'circ_count') .nes. ""
$		then
$			goto node4_rule_8_loop
$		endif
$	endif
$ !
$	if	-
		node4_rule_9
$	then
$ !
$		area_count = 1
$ !
$ NODE4_RULE_9_LOOP:
$ !
$		TARGET$AREA	= 	TARGET$AREA'area_count'
$		write	create_file	"!# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!# %%                                                                         %%"
$		write	create_file	"!# %%                   A R E A   U N R E A C H A B L E                       %%"
$		write	create_file	"!# %%                                                                         %%"
$		write	create_file	"!# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
$		write	create_file	"!#"
$		write	create_file	"create mcc 0 alarms rule nodename_remote_area_''TARGET$AREA'_state -"
$		write	create_file	" expression        = -"
$		write	create_file	"(''TARGET$ENTITY' area ''TARGET$AREA' state = unreachable, -"
$		write	create_file	"                       at every 03:00:00), -"
$		write	create_file	" procedure         = mcc_common:mcc_alarms_mail_alarm.com, -"
$		write	create_file	" exception handler = mcc_common:mcc_alarms_mail_exception.com, -"
$		write	create_file	" category          = ''quote'Area unreachable''quote', -"
$		write	create_file	" description       = ''quote'If an area becomes unreachable, alarm notification -"
$		write	create_file	"                      command procedure will be run.  If there is a - "
$		write	create_file	"                      communication failure the exception handler will be - "
$		write	create_file	"                      executed.  Use this rule to ensure that crucial areas - "
$		write	create_file	"                      are reachable from a particular area routing node. - "
$		write	create_file	"                      To be useful, the NODE4 should be an area router, as - "
$		write	create_file	"                      other nodes do not know about other areas.''quote', -"
$		write	create_file	" queue             = ''quote'''TARGET$BATCH_QUEUE'''quote', -"
$		write	create_file	" parameter         = ''quote'''TARGET$PARAMETER'''quote', -"
$		write	create_file	" perceived severity =  critical, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	create_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule nodename_remote_area_''TARGET$AREA'state, -  ! "
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                       ! "
$		write	enable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule nodename_remote_area_''TARGET$AREA'_state, -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                       !"
$		write	disable_file	"!"
$
$		area_count = area_count + 1
$ !
$		if	-
			f$type(TARGET$AREA'area_count') .nes. ""
$		then
$			goto node4_rule_9_loop
$		endif
$	endif
$
$ 	close	create_file
$	close	enable_file
$	close	disable_file
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ BUILD_BRIDGE_ALARM_FILES:	subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	copy	nl:	'aldir''entity_name'_create_mcc_alarms.com
$	copy	nl:	'aldir''entity_name'_enable_mcc_alarms.com
$	copy	nl:	'aldir''entity_name'_disable_mcc_alarms.com
$ !
$	files_created_list	==	"''aldir'''entity_name'_create_mcc_alarms.com" + "
" + -
                                        "''aldir'''entity_name'_enable_mcc_alarms.com" + "
" + -
                                        "''aldir'''entity_name'_disable_mcc_alarms.com"
$ !
$	open		/append		-
	create_file	'aldir''entity_name'_create_mcc_alarms.com	
$ !
$	open		/append		-
	enable_file	'aldir''entity_name'_enable_mcc_alarms.com	
$ !
$	open		/append		-
	disable_file	'aldir''entity_name'_disable_mcc_alarms.com	
$ !
$	write 	create_file 	"$ ! ''entity_name'_CREATE_MCC_ALARMS.COM"		
$	write 	create_file 	"$ !"
$	write 	create_file 	"$ 	MANAGE / ENTERPRISE"
$	write 	create_file 	"!"
$ !
$	write	enable_file	"! ''entity_name'_ENABLE_MCC_ALARMS.COM"		
$	write	enable_file	"!"
$ !
$	write	disable_file	"! ''entity_name'_DISABLE_MCC_ALARMS.COM"		
$	write	disable_file	"!"
$ !
$	if	-
		bridge_rule_1
$	then
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule bridge_''ENTITY_NAME'_broken -"
$		write	create_file	"  expression        = (''TARGET$ENTITY' device state <> operating ,-"
$		write	create_file	"                        at every 00:15:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'configuration problem''quote' ,-"
$		write	create_file	"  description       = ''quote'The bridge is either broken or initializing.  if the    -"
$		write	create_file	"                       bridge cannot be reached (communication problems),      -"
$		write	create_file	"                       the exception handler procedure will be executed.       -"
$		write	create_file	"                       check the device broken reason attribute of the bridge  -"
$		write	create_file	"                       for more information.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule bridge_''ENTITY_NAME'_broken -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule bridge_''ENTITY_NAME'_broken -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$	endif
$ !
$	if	-
		bridge_rule_2
$	then
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule bridge_''ENTITY_NAME'_memory_bad -"
$		write	create_file	"  expression        = (''TARGET$ENTITY' nvram failed flag = true ,-"
$		write	create_file	"                       at every 12:00:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'bridge memory problem''quote' ,-"
$		write	create_file	"  description       = ''quote'if there is a problem with the memory in the specified  -"
$		write	create_file	"                       bridge this rule will fire.  field service should be    -"
$		write	create_file	"                       notified.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule bridge_''ENTITY_NAME'_memory_bad -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule bridge_''ENTITY_NAME'_memory_bad -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$	endif
$ !
$	if	-
		bridge_rule_3
$	then
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule bridge_''ENTITY_NAME'_line_1_disabled -"
$		write	create_file	"  expression        = (''TARGET$ENTITY' line 1 port module state <> forwarding ,-"
$		write	create_file	"                       at every 00:15:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'bridge problem''quote' ,-"
$		write	create_file	"  description       = ''quote'the line is not operating properly.  it may have been   -"
$		write	create_file	"                       disabled by a management directive, or it might be      -"
$		write	create_file	"                       broken.  use this rule for lines in your local area     -"
$		write	create_file	"                       network whose availability is crucial.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule bridge_''ENTITY_NAME'_line_1_disabled -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule bridge_''ENTITY_NAME'_line_1_disabled -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule bridge_''ENTITY_NAME'_line_2_disabled -"
$		write	create_file	"  expression        = (''TARGET$ENTITY' line 2 port module state <> forwarding ,-"
$		write	create_file	"                       at every 00:15:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'bridge problem''quote' ,-"
$		write	create_file	"  description       = ''quote'the line is not operating properly.  it may have been   -"
$		write	create_file	"                       disabled by a management directive, or it might be      -"
$		write	create_file	"                       broken.  use this rule for lines in your local area     -"
$		write	create_file	"                       network whose availability is crucial.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule bridge_''ENTITY_NAME'_line_2_disabled -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule bridge_''ENTITY_NAME'_line_2_disabled -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$	endif
$ !
$	if	-
		bridge_rule_4
$	then
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''ENTITY_NAME'_line_1_collisions -"
$		write	create_file	"  expression        = (change_of(''TARGET$ENTITY' line 1 collision limit exceeded,*,*),-"
$		write	create_file	"                       at every 00:10:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'transmit problems''quote' ,-"
$		write	create_file	"  description       = ''quote'if a line cannot send a packet after 16 attempts this   -"
$		write	create_file	"                       counter will increase.  this is only true for lines on  -"
$		write	create_file	"                       a lan bridge 200, and usually indicates that the line   -"
$		write	create_file	"                       is very heavily used.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''ENTITY_NAME'_line_1_collisions -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''ENTITY_NAME'_line_1_collisions -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''ENTITY_NAME'_line_2_collisions -"
$		write	create_file	"  expression        = (change_of(''TARGET$ENTITY' line 1 collision limit exceeded,*,*),-"
$		write	create_file	"                       at every 00:10:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'transmit problems''quote' ,-"
$		write	create_file	"  description       = ''quote'if a line cannot send a packet after 16 attempts this   -"
$		write	create_file	"                       counter will increase.  this is only true for lines on  -"
$		write	create_file	"                       a lan bridge 200, and usually indicates that the line   -"
$		write	create_file	"                       is very heavily used.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''ENTITY_NAME'_line_2_collisions -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''ENTITY_NAME'_line_2_collisions -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$	endif
$ !
$	if	-
		bridge_rule_5
$	then
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule bridge_''ENTITY_NAME'_resets -"
$		write	create_file	"  expression        = (change_of(''TARGET$ENTITY' unsolicited resets, *, *),-"
$		write	create_file	"                       at every 00:15:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'bridge reset problem''quote' ,-"
$		write	create_file	"  description       = ''quote'whenever a lanbridge 150 or 200 encounters a serious    -"
$		write	create_file	"                       internal problem it will reset itself.  this may be     -"
$		write	create_file	"                       caused by power glitches and/or deteriorating hardware. -"
$		write	create_file	"                       it this problem occurs frequently field service may     -"
$		write	create_file	"                       need to be informed.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule bridge_''ENTITY_NAME'_resets -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule bridge_''ENTITY_NAME'_resets -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$	endif
$ !
$	if	-
		bridge_rule_6
$	then
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule ''ENTITY_NAME'_spanning_tree_change -"
$		write	create_file	"  expression        = (change_of(''TARGET$ENTITY' spanning tree mode changes,*, *),-"
$		write	create_file	"                       at every 00:10:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'configuration problem''quote' ,-"
$		write	create_file	"  description       = ''quote'either a lanbridge 100 bridge has been added or         -"
$		write	create_file	"                       removed from your local area network.  the bridge       -"
$		write	create_file	"                       specified must be either a lanbridge 150 or 200.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule ''ENTITY_NAME'_spanning_tree_change -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule ''ENTITY_NAME'_spanning_tree_change -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$	endif
$ !
$	if	-
		bridge_rule_7
$	then
$		write	create_file	"!"
$		write	create_file	"create mcc 0 alarms rule bridge_''ENTITY_NAME'_is_listener -"
$		write	create_file	"  expression        = (''TARGET$ENTITY' bridge function <> bridge ,-"
$		write	create_file	"              at every 00:15:00) ,-"
$		write	create_file	"  procedure         = mcc_common:mcc_alarms_mail_alarm.com ,-"
$		write	create_file	"  exception handler = mcc_common:mcc_alarms_mail_exception.com ,-"
$		write	create_file	"  category          = ''quote'configuration problem''quote' ,-"
$		write	create_file	"  description       = ''quote'the bridge is currently operating as a ltm listener.    -"
$		write	create_file	"                       use this rule for bridges in your local area network    -"
$		write	create_file	"                       whose availability is crucial.''quote' ,-"
$		write	create_file	"  queue             = ''quote'''TARGET$BATCH_QUEUE'''quote' ,-"
$		write	create_file	"  parameter         = ''quote'''TARGET$PARAMETER'''quote' , -"
$		write	create_file	" perceived severity =  major, -"
$		write	create_file	" in domain         = ''TARGET$DOMAIN' "
$		write	enable_file	"!"
$		write	enable_file	"enable mcc 0 alarms rule bridge_''ENTITY_NAME'_is_listener -  ! <ENABLE>"
$		write	enable_file	" in domain         = ''TARGET$DOMAIN'                     ! <ENABLE>"
$		write	disable_file	"!"
$		write	disable_file	"disable mcc 0 alarms rule bridge_''ENTITY_NAME'_is_listener -  !"
$		write	disable_file	" in domain         = ''TARGET$DOMAIN'                     !"
$	endif
$ !
$	close	create_file 	
$	close	enable_file 	
$	close	disable_file 	
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ GET_NODE4_CIRCUIT:		subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	say	-
 	"%BUILDER-I-FINDCIRCUIT, Finding circuit type for ''entity_name'"
$	define sys$output 'workdir'nodecircuit.tmp
$	mcc show 'TARGET$ENTITY' circuit *
$	deass sys$output
$	sea 'workdir'nodecircuit.tmp name /out='workdir''entity_name'_circuit.dat
$	circuitcount = 1
$	open /read 'entity_name'_circuit 'workdir''entity_name'_circuit.dat
$ !
$ CIRCUIT_LOOP:
$ !
$	read /end=no_more_circuits 'entity_name'_circuit 'entity_name'_circuit_data
$	'entity_name'_circuit_data = f$edit('entity_name'_circuit_data,"trim,compress")
$	circuit_'circuitcount' = f$element(2," ",'entity_name'_circuit_data)
$	circuitcount = circuitcount+1
$	goto circuit_loop
$ !
$ NO_MORE_CIRCUITS:
$ !
$	close 'entity_name'_circuit
$ !
$	say	""
$	say	-
 	"%BUILDER-I-CIRCUITFOUND, ''entity_name' has the following circuits : "
$ !
$	shocircuitcount = 1
$ !
$ SHOCIRCUIT_LOOP:
$ !
$	say	circuit_'shocircuitcount
$	if	-
 		shocircuitcount .eq. circuitcount - 1
$	then
$      		goto sho_no_more_circuits
$	endif
$	shocircuitcount = shocircuitcount + 1
$	goto shocircuit_loop
$ !
$ SHO_NO_MORE_CIRCUITS:
$ !
$      	target_circuit_count = 1	
$	if	-
 		shocircuitcount .eqs. 1
$	then
$		say	-
 		"%BUILDER-I-DEFCIRCUIT, Using circuit ''circuit_1' for alarm rules."
$		TARGET$CIRCUIT1 == circuit_1
$		goto got_circuit
$	endif
$ !
$ ASK_TARGET_CIRCUIT:
$ !
$	inquire TARGET$CIRCUIT'target_circuit_count' 	-
 	"* Enter the name of a circuit ("." = no more)"
$ !
$	TARGET$CIRCUIT'target_circuit_count' == TARGET$CIRCUIT'target_circuit_count' 
$	if 	-
 		TARGET$CIRCUIT'target_circuit_count' .eqs. "?"
$	then
$		call help circuit
$		goto ask_target_circuit
$	endif
$ !
$	if 	-
 		TARGET$CIRCUIT'target_circuit_count' .eqs. ""
$	then
$		goto ask_target_circuit
$	endif
$ !
$	if 	-
 		TARGET$CIRCUIT1 .eqs. "."
$	then
$		say	-
		"%BUILDER-E-INVRESP, You must enter the name of a circuit."
$		goto ask_target_circuit
$	endif
$ !
$	if 	-
 		TARGET$CIRCUIT'target_circuit_count' .eqs. "."
$	then
$		delete /symbol /glo TARGET$CIRCUIT'target_circuit_count' 
$	       	target_circuit_count = target_circuit_count - 1
$		goto got_circuit
$	endif
$ !
$      	target_circuit_count = target_circuit_count + 1	
$	goto ask_target_circuit
$ !
$ GOT_CIRCUIT:
$ !
$	say	-
 	"%BUILDER-I-MULTICIRCUIT, The following circuits have been selected "
$ !
$	say	""
$	multicircuit_count = 1
$ !
$ MULTICIRCUIT_LOOP:
$ !
$	say	-
 	TARGET$CIRCUIT'multicircuit_count'
$	if 	-
 		multicircuit_count .eq. target_circuit_count 
$	then
$		goto finished_circuits
$       endif
$ !
$	multicircuit_count = multicircuit_count + 1
$	goto multicircuit_loop
$ !
$ FINISHED_CIRCUITS:
$ !
$ 	endsubroutine
$ ! -
$ !
$ ! +
$ GET_NODE4_LINE:		subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	say	-
 	"%BUILDER-I-FINDLINE, Finding line type for ''TARGET$ENTITY'"
$	define sys$output 'workdir'nodeline.tmp
$	mcc show 'TARGET$ENTITY' line *
$	deass sys$output
$	sea 'workdir'nodeline.tmp name /out='workdir''entity_name'_line.dat
$	linecount = 1
$	open /read 'entity_name'_line 'workdir''entity_name'_line.dat
$ !
$ LINE_LOOP:
$ !
$	read /end=no_more_lines 'entity_name'_line 'entity_name'_line_data
$	'entity_name'_line_data = f$edit('entity_name'_line_data,"trim,compress")
$	line_'linecount' = f$element(2," ",'entity_name'_line_data)
$	linecount = linecount+1
$	goto line_loop
$ !
$ NO_MORE_LINES:
$ !
$	close 'entity_name'_line
$ !
$	say	""
$	say	-
 	"%BUILDER-I-LINEFOUND, ''TARGET$ENTITY' has the following lines : "
$ !
$	sholinecount = 1
$ !
$ SHOLINE_LOOP:
$ !
$	say	line_'sholinecount
$	if	-
 		sholinecount .eq. linecount - 1
$	then
$      		goto sho_no_more_lines
$	endif
$	sholinecount = sholinecount + 1
$	goto sholine_loop
$ !
$ SHO_NO_MORE_LINES:
$ !
$      	target_line_count = 1	
$	if	-
 		sholinecount .eqs. 1
$	then
$		say	-
 		"%BUILDER-I-DEFLINE, Using line ''line_1' for alarm rules."
$		TARGET$LINE1 == line_1
$		goto got_line
$	endif
$ !
$ ASK_TARGET_LINE:
$ !
$	inquire TARGET$LINE'target_line_count' 	-
 	"* Enter the name of a line ("." = no more)"
$ !
$	TARGET$LINE'target_line_count' ==  TARGET$LINE'target_line_count' 	
$ !
$	if 	-
 		TARGET$LINE'target_line_count' .eqs. "?"
$	then
$		call help line
$		goto ask_target_line
$	endif
$ !
$	if 	-
 		TARGET$LINE'target_line_count' .eqs. ""
$	then
$		goto ask_target_line
$	endif
$ !
$	if 	-
 		TARGET$LINE1 .eqs. "."
$	then
$		say	-
		"%BUILDER-E-INVRESP, You must enter the name of a line."
$		goto ask_target_line
$	endif
$ !
$	if 	-
 		TARGET$LINE'target_line_count' .eqs. "."
$	then
$		delete /symbol /glo TARGET$LINE'target_line_count' 
$	       	target_line_count = target_line_count - 1
$		goto got_line
$	endif
$ !
$      	target_line_count = target_line_count + 1	
$	goto ask_target_line
$ !
$ GOT_LINE:
$ !
$	say	-
 	"%BUILDER-I-SELECTED, The following lines have been selected :"
$
$	say	""
$	multiline_count = 1
$ !
$ MULTILINE_LOOP:
$ !
$	say	-
 	TARGET$LINE'multiline_count' 
$	if 	-
 		multiline_count .eq. target_line_count 
$	then
$		goto finished_lines
$       endif
$ !
$	multiline_count = multiline_count + 1
$	goto multiline_loop
$ !
$ FINISHED_LINES:
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ GET_NODE4_TYPE:		subroutine
$ !
$ !	p1	=	TARGET$ENTITY
$ !	p2	-	entity_name
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	say	-
 	"%BUILDER-I-FINDTYPE, Finding node type for ''TARGET$ENTITY'"
$	nodetype = ""
$      	'entity_name'_type_data = ""
$	define sys$output 'workdir'nodetype.tmp
$	mcc show 'TARGET$ENTITY' type
$	deass sys$output
$	sea 'workdir'nodetype.tmp type /out='workdir''entity_name'_type.dat
$	open/read 'entity_name'_type 'workdir''entity_name'_type.dat
$	read 'entity_name'_type 'entity_name'_type_data
$	close 'entity_name'_type 
$	'entity_name'_type_data = f$edit('entity_name'_type_data,"trim,compress")
$	nodetype = f$element(2," ",'entity_name'_type_data)
$	ntype = f$edit(f$element(2," ",'entity_name'_type_data),"upcase")
$	if	-
		ntype .eqs. " "
$	then
$		say	-
		"%BUILDER-E-UNREACHABLE, ''entity_name' not currently reachable"
$		exit %X50000004
$	endif
$ !     
$	if	-
 		ntype .eqs. "AREAIV"
$	then
$		say	-
 		"%BUILDER-I-AREARTR, ''TARGET$ENTITY is an area router."
$	endif
$ !
$	if	-
 		ntype .nes. "AREAIV"
$	then
$		say	-
 		"%BUILDER-I-NOTAREARTR, ''TARGET$ENTITY is a ''nodetype' node."
$		say	-
 		"-BUILDER-I-NOTAREARTR, Area reachability rules will not be created."
$	endif
$ !
$	nodetype == nodetype
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ GET_DOMAIN:			subroutine
$ !		
$ !	p1 	= 	TARGET$ENTITY
$ !	p2 	=	ENTITY_NAME
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	say	""
$	say	-
"%BUILDER-I-GETINFO, Now obtaining data for ''TARGET$ENTITY'"
$ !
$	sea sys$login:mcc_domains.lis ".''entity_name'" -
	/out='workdir''entity_name'_domfile.dat
$ !
$	domcount = 1	
$	open/read 'entity_name'_dom 'workdir''entity_name'_domfile.dat
$ !
$ DOMLOOP:
$ !
$	read	/end=no_more_domains 'entity_name'_dom domain_'domcount'_record
$	domain_'domcount' = f$element(1," ",domain_'domcount'_record)
$	domain_'domcount' = f$extract(f$locate(".",domain_'domcount')+1, 	-
			    f$length(domain_'domcount')-f$locate(".",domain_'domcount')-1, -
			    domain_'domcount') 
$	domcount = domcount+1
$	goto domloop
$ !
$ NO_MORE_DOMAINS:
$ !
$	close 'entity_name'_dom 
$ !
$	if	-
		f$type(domain_1) .eqs. ""
$	then
$		say	-
		"%BUILDER-F-NODOMFOUND, ''TARGET$ENTITY' was not found in any domain"
$		say	-
		"-BUILDER-F-NODOMFOUND, Entity Name may be incorrect"
$		exit %X50000004
$	endif
$ !
$ !
$	say	""
$	say	-
"%BUILDER-I-DOMFOUND, ''TARGET$ENTITY' was found in the following domain(s)"
$ !
$	shodomcount = 1
$ !
$ SHODOM_LOOP:
$ !
$	say	domain_'shodomcount
$	if	-
		shodomcount .eq. domcount - 1
$	then
$       	goto sho_no_more_domains
$	endif
$	shodomcount = shodomcount + 1
$	goto shodom_loop
$ !
$ SHO_NO_MORE_DOMAINS:
$ !
$	if	-
		shodomcount .eqs. 1
$	then
$		say	-
		"%BUILDER-I-DEFDOM, Using domain ''domain_1' for alarm rules."
$		TARGET$DOMAIN == domain_1
$		goto got_domain
$	endif
$ !
$ ASK_TARGET_DOMAIN:
$ !
$
$	inquire TARGET$DOMAIN	-
"* Enter the name of the domain in which rules are to be created "
$ !
$	if 	-
		TARGET$DOMAIN .eqs. "?"
$	then
$		call help domain
$		stat = $status
$		goto ask_target_domain
$	endif
$ !
$	if 	-
		TARGET$DOMAIN  .eqs. ""
$	then
$		goto ask_target_domain
$	endif
$ ! 
$ GOT_DOMAIN:
$ ! -
$	wait 00:00:01
$ !
$	TARGET$DOMAIN	==  	TARGET$DOMAIN		
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ BRIDGE_ALARM_MENU:		subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	bridge_rule_1	==	"FALSE"
$	bridge_rule_2	==	"FALSE"
$	bridge_rule_3	==	"FALSE"
$	bridge_rule_4	==	"FALSE"
$	bridge_rule_5	==	"FALSE"
$	bridge_rule_6	==	"FALSE"
$	bridge_rule_7	==	"FALSE"
$ !
$ CHECK_OLD_BR_AL_PROFILE:
$ !
$		bridge_profile_exists	=	"FALSE"
$ !
$	if	-
		f$search("''profdir'bridge_alarm_profile.dat") .nes. ""
$	then
$		bridge_profile_exists	=	"TRUE"
$		open	/read	br_al_prof	'profdir'bridge_alarm_profile.dat
$ !
$		read		br_al_prof	br_al_1	
$		read		br_al_prof	br_al_2
$		read		br_al_prof	br_al_3	
$		read		br_al_prof	br_al_4	
$		read		br_al_prof	br_al_5	
$		read		br_al_prof	br_al_6	
$		read		br_al_prof	br_al_7	
$ !
$		close		br_al_prof
$ !
$		br_al_1		=	f$element(1," ",br_al_1)
$		br_al_2		=	f$element(1," ",br_al_2)
$		br_al_3		=	f$element(1," ",br_al_3)
$		br_al_4		=	f$element(1," ",br_al_4)
$		br_al_5		=	f$element(1," ",br_al_5)
$		br_al_6		=	f$element(1," ",br_al_6)
$		br_al_7		=	f$element(1," ",br_al_7)
$ !
$		bridge_rule_1	==	br_al_1
$		bridge_rule_2	==	br_al_2
$		bridge_rule_3	==	br_al_3
$		bridge_rule_4	==	br_al_4
$		bridge_rule_5	==	br_al_5
$		bridge_rule_6	==	br_al_6
$		bridge_rule_7	==	br_al_7
$ !
$	endif
$
$	bridge_alarm_count	=	1
$ !
$ DRAW_BRIDGE_MENU:
$ !
$	cl
$	say	-
"''bold_on'''inverse_on'                       Entity ''quote'Bridge''quote' Alarm Rule Profile                       ''all_off'"
$	say	""
$	say	""
$	if	-
		bridge_rule_1
$	then
$		say	-
		"		''bold_on'''inverse_on'(1)''all_off'	''bold_on'''inverse_on'Bridge Not Operating''all_off'"
$	else
$		say	-
		"		(1)	Bridge Not Operating"
$	endif
$ !
$	if	-
		bridge_rule_2
$	then
$		say	-
		"		''bold_on'''inverse_on'(2)''all_off'	''bold_on'''inverse_on'Bridge Memory Problem''all_off'"
$	else
$		say	-
		"		(2)	Bridge Memory Problem"
$	endif
$ !
$	if	-
		bridge_rule_3
$	then
$		say	-
		"		''bold_on'''inverse_on'(3)''all_off'	''bold_on'''inverse_on'Bridge Not Forwarding''all_off'"
$	else
$		say	-
		"		(3)	Bridge Not Forwarding"
$	endif
$ !
$	if	-
		bridge_rule_4
$	then
$		say	-
		"		''bold_on'''inverse_on'(4)''all_off'	''bold_on'''inverse_on'Collision Limit Exceded''all_off'"
$	else
$		say	-
		"		(4)	Collision Limit Exceded"
$	endif
$ !
$	if	-
		bridge_rule_5
$	then
$		say	-
		"		''bold_on'''inverse_on'(5)''all_off'	''bold_on'''inverse_on'Unsolicited Resets''all_off'"
$	else
$		say	-
		"		(5)	Unsolicited Resets"
$	endif
$ !
$	if	-
		bridge_rule_6
$	then
$		say	-
		"		''bold_on'''inverse_on'(6)''all_off'	''bold_on'''inverse_on'Network Reconfigured''all_off'"
$	else
$		say	-
		"		(6)	Network Reconfigured"
$	endif
$ !
$	if	-
		bridge_rule_7
$	then
$		say	-
		"		''bold_on'''inverse_on'(7)''all_off'	''bold_on'''inverse_on'Bridge Is Listener''all_off'"
$	else
$		say	-
		"		(7)	Bridge Is Listener"
$	endif
$ !
$	say	""
$	say	""
$ !
$	if	-
		bridge_profile_exists
$	then
$		say	-
			"%BUILDER-I-PROFILEEXISTS, The Bridge Alarm Rule Profile shown above Exisits."
$ !
$ ASK_USE_BRIDGE_ALARMS_PROFILE:
$ !
$		say	""
$		inquire	use_br_al_profile	-
		"* Do you want to ''bold_on'''inverse_on'U''all_off'se this profile or ''bold_on'''inverse_on'B''all_off'uild another "
$ !
$               if	-
			use_br_al_profile .eqs. "?"
$		then
$			call help bridge_profile
$		endif
$ !
$               if	-
			use_br_al_profile .eqs. "U"
$		then
$			goto done_bridge_alarm_profile
$		endif
$ !
$		if	-
			use_br_al_profile .eqs. "B"
$		then
$			delete 	'profdir'bridge_alarm_profile.dat.*
$			bridge_profile_exists 	=	"FALSE"
$ !
$			bridge_rule_1	==	"FALSE"
$			bridge_rule_2	==	"FALSE"
$			bridge_rule_3	==	"FALSE"
$			bridge_rule_4	==	"FALSE"
$			bridge_rule_5	==	"FALSE"
$			bridge_rule_6	==	"FALSE"
$			bridge_rule_7	==	"FALSE"
$			goto draw_bridge_menu
$		endif
$ !
$               if	-
			use_br_al_profile .eqs. ""
$		then
$			goto ask_use_bridge_alarms_profile
$		endif
$	endif
$
$ !
$ ASK_BRIDGE_ALARM:
$ !
$	inquire		BRIDGE$ALARM_RULE'bridge_alarm_count'	-
	"* Enter the number of a rule to create ("." = no more) "
$ !
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "?"
$	then
$		call help bridge_alarm
$		stat = $status
$		goto draw_bridge_menu
$	endif
$ !
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. ""
$	then
$		goto ask_bridge_alarm
$	endif
$ !
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "."
$	then
$		delete /symbol BRIDGE$ALARM_RULE'bridge_alarm_count' 
$	       	bridge_alarm_count = bridge_alarm_count - 1
$		goto got_bridge_alarm_profile
$	endif
$ !
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "1"
$	then
		bridge_rule_1	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "2"
$	then
		bridge_rule_2	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "3"
$	then
		bridge_rule_3	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "4"
$	then
		bridge_rule_4	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "5"
$	then
		bridge_rule_5	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "6"
$	then
		bridge_rule_6	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		BRIDGE$ALARM_RULE'bridge_alarm_count' .eqs. "7"
$	then
		bridge_rule_7	==	"TRUE"
$	endif
$ ! 
$      	bridge_alarm_count = bridge_alarm_count + 1	
$	goto draw_bridge_menu
$ !
$ GOT_BRIDGE_ALARM_PROFILE:
$ !
$ BUILD_BRIDGE_ALARM_PROFILE:
$ !
$	if	-
		f$search("''profdir'bridge_alarm_profile.dat") .eqs. ""
$	then
$		copy	nl:	'profdir'bridge_alarm_profile.dat
$	endif
$
$ 	open	/append		br_al_profile		'profdir'bridge_alarm_profile.dat	
$
$ 	br_al_count	=	1
$
$ BR_AL_PROFLOOP:
$
$	if	-
		bridge_rule_'br_al_count'	
$	then
$		write	br_al_profile	"BRIDGE_RULE_''br_al_count' TRUE"
$	else
$		write	br_al_profile	"BRIDGE_RULE_''br_al_count' FALSE"
$	endif
$ !
$	if	-
		br_al_count .eq. "7"
$	then
		goto built_br_al_profile
$	endif
$ !
$	br_al_count	=	br_al_count + 1
$
$	goto br_al_profloop
$ !
$ BUILT_BR_AL_PROFILE:
$ !
$	close 	br_al_profile
$ !
$ DONE_BRIDGE_ALARM_PROFILE:
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ NODE4_ALARM_MENU: 		subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	p1	=	f$edit(p1,"upcase")
$	node4_rule_1	==	"FALSE"
$	node4_rule_2	==	"FALSE"
$	node4_rule_3	==	"FALSE"
$	node4_rule_4	==	"FALSE"
$	node4_rule_5	==	"FALSE"
$	node4_rule_6	==	"FALSE"
$	node4_rule_7	==	"FALSE"
$	node4_rule_8	==	"FALSE"
$	node4_rule_9	==	"FALSE"
$ !
$ CHECK_OLD_N4_AL_PROFILE:
$ !
$		node4_profile_exists	=	"FALSE"
$ !
$	if	-
		f$search("''profdir'node4_alarm_profile.dat") .nes. ""
$	then
$		node4_profile_exists	=	"TRUE"
$		open	/read	n4_al_prof	'profdir'node4_alarm_profile.dat
$ !
$		read		n4_al_prof	n4_al_1	
$		read		n4_al_prof	n4_al_2
$		read		n4_al_prof	n4_al_3	
$		read		n4_al_prof	n4_al_4	
$		read		n4_al_prof	n4_al_5	
$		read		n4_al_prof	n4_al_6	
$		read		n4_al_prof	n4_al_7	
$		read		n4_al_prof	n4_al_8	
$		read		n4_al_prof	n4_al_9	
$ !
$		close		n4_al_prof
$ !
$		n4_al_1		=	f$element(1," ",n4_al_1)
$		n4_al_2		=	f$element(1," ",n4_al_2)
$		n4_al_3		=	f$element(1," ",n4_al_3)
$		n4_al_4		=	f$element(1," ",n4_al_4)
$		n4_al_5		=	f$element(1," ",n4_al_5)
$		n4_al_6		=	f$element(1," ",n4_al_6)
$		n4_al_7		=	f$element(1," ",n4_al_7)
$		n4_al_8		=	f$element(1," ",n4_al_8)
$		n4_al_9		=	f$element(1," ",n4_al_9)
$ !
$		node4_rule_1	==	n4_al_1
$		node4_rule_2	==	n4_al_2
$		node4_rule_3	==	n4_al_3
$		node4_rule_4	==	n4_al_4
$		node4_rule_5	==	n4_al_5
$		node4_rule_6	==	n4_al_6
$		node4_rule_7	==	n4_al_7
$		node4_rule_8	==	n4_al_8
$		node4_rule_9	==	n4_al_9
$ !
$	endif
$
$	if	-
		p1 .eqs. "ENDNODEIV"
$	then
$		node4_rule_7	==	"FALSE"
$		node4_rule_8	==	"FALSE"
$	endif
$ !
$	if	-
		p1 .nes. "AREAIV"
$	then
$		node4_rule_9	==	"FALSE"
$	endif
$ !
$	node4_alarm_count	=	1
$ !
$ DRAW_NODE4_MENU:
$ !
$	cl
$	say	-
"''bold_on'''inverse_on'                       Entity ''quote'Node4''quote' Alarm Rule Profile                       ''all_off'"
$	say	""
$	say	""
$	if	-
		node4_rule_1
$	then
$		say	-
		"		''bold_on'''inverse_on'(1)''all_off'	''bold_on'''inverse_on'Node4 Circuit Substate Change''all_off'"
$	else
$		say	-
		"		(1)	Node4 Circuit Substate Change"
$	endif
$ !
$	if	-
		node4_rule_2
$	then
$		say	-
		"		''bold_on'''inverse_on'(2)''all_off'	''bold_on'''inverse_on'Node4 Circuit Down''all_off'"
$	else
$		say	-
		"		(2)	Node4 Circuit Down"
$	endif
$ !
$	if	-
		node4_rule_3
$	then
$		say	-
		"		''bold_on'''inverse_on'(3)''all_off'	''bold_on'''inverse_on'Node4 Circuit Inbound Data Errors''all_off'"
$	else
$		say	-
		"		(3)	Node4 Circuit Inbound Data Errors"
$	endif
$ !
$	if	-
		node4_rule_4
$	then
$		say	-
		"		''bold_on'''inverse_on'(4)''all_off'	''bold_on'''inverse_on'Node4 Circuit Outbound Data Errors''all_off'"
$	else
$		say	-
		"		(4)	Node4 Circuit Outbound Data Errors"
$	endif
$ !
$	if	-
		node4_rule_5
$	then
$		say	-
		"		''bold_on'''inverse_on'(5)''all_off'	''bold_on'''inverse_on'Node4 Line Transmit Problems''all_off'"
$	else
$		say	-
		"		(5)	Node4 Line Transmit Problems"
$	endif
$ !
$	if	-
		node4_rule_6
$	then
$		say	-
		"		''bold_on'''inverse_on'(6)''all_off'	''bold_on'''inverse_on'Node4 Traffic Indicator''all_off'"
$	else
$		say	-
		"		(6)	Node4 Traffic Indicator"
$	endif
$ !
$!ver
$	if	-
		p1 .eqs. "ROUTINGIV" .or. p1 .eqs. "AREAIV"
$	then
$ !
$		if	-
			node4_rule_7
$		then
$			say	-
			"		''bold_on'''inverse_on'(7)''all_off'	''bold_on'''inverse_on'Node4 Adjacency Down''all_off'"
$		else
$			say	-        
			"		(7)	Node4 Adjacency Down"
$		endif
$ !
$		if	-
			node4_rule_8
$		then
$			say	-
			"		''bold_on'''inverse_on'(8)''all_off'	''bold_on'''inverse_on'Node4 Circuit Needs Tuning''all_off'"
$		else
$			say	-
			"		(8)	Node4 Circuit Needs Tuning"
$		endif
$ !
$	endif
$ !
$	if	-
		p1 .eqs. "AREAIV"
$	then
$		if	-
			node4_rule_9
$		then
$			say	-
			"		''bold_on'''inverse_on'(9)''all_off'	''bold_on'''inverse_on'Node4 Area Unreachable''all_off'"
$		else
$			say	-
			"		(9)	Node4 Area Unreachable"
$		endif
$ !
$	endif
$ !
$!nover
$	say	""
$	say	""
$ !
$	if	-
		node4_profile_exists
$	then
$		say	-
			"%BUILDER-I-PROFILEEXISTS, The Node4 Alarm Rule Profile shown above Exisits."
$ !
$ ASK_NODE4_ALARM_PROFILE:
$ !
$		say	""
$		inquire	use_n4_al_profile	-
		"* Do you want to ''bold_on'''inverse_on'U''all_off'se this profile or ''bold_on'''inverse_on'B''all_off'uild another "
$ !
$               if	-
			use_n4_al_profile .eqs. "?"
$		then
$			call help node4_profile
$		endif
$ !
$               if	-
			use_n4_al_profile .eqs. "U"
$		then
$			goto ask_watch_area
$		endif
$ !
$		if	-
			use_n4_al_profile .eqs. "B"
$		then
$			delete 	'profdir'node4_alarm_profile.dat.*
$			node4_profile_exists 	=	"FALSE"
$ !
$			node4_rule_1	==	"FALSE"
$			node4_rule_2	==	"FALSE"
$			node4_rule_3	==	"FALSE"
$			node4_rule_4	==	"FALSE"
$			node4_rule_5	==	"FALSE"
$			node4_rule_6	==	"FALSE"
$			node4_rule_7	==	"FALSE"
$			node4_rule_8	==	"FALSE"
$			node4_rule_9	==	"FALSE"
$			goto draw_node4_menu
$		endif
$ !
$               if	-
			use_n4_al_profile .eqs. ""
$		then
$			goto ask_node4_alarm_profile
$		endif
$ !
$	endif
$
$ !
$ ASK_NODE4_ALARM:
$ !
$	inquire		NODE4$ALARM_RULE'node4_alarm_count'	-
	"* Enter the number of a rule to create ("." = no more) "
$ !
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "?"
$	then
$		call help node4_alarm
$		stat = $status
$		goto draw_node4_menu
$	endif
$ !
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. ""
$	then
$		goto ask_node4_alarm
$	endif
$ !
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "."
$	then
$		delete /symbol NODE4$ALARM_RULE'node4_alarm_count' 
$	       	node4_alarm_count = node4_alarm_count - 1
$		goto got_node4_alarm_profile
$	endif
$ !
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "1"
$	then
		node4_rule_1	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "2"
$	then
		node4_rule_2	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "3"
$	then
		node4_rule_3	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "4"
$	then
		node4_rule_4	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "5"
$	then
		node4_rule_5	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "6"
$	then
		node4_rule_6	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "7"
$	then
		node4_rule_7	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "8"
$	then
		node4_rule_8	==	"TRUE"
$	endif
$ ! 
$	if 	-
 		NODE4$ALARM_RULE'node4_alarm_count' .eqs. "9"
$	then
		node4_rule_9	==	"TRUE"
$	endif
$ ! 
$      	node4_alarm_count = node4_alarm_count + 1	
$	goto draw_node4_menu
$ !
$ GOT_NODE4_ALARM_PROFILE:
$ !
$ BUILD_NODE4_ALARM_PROFILE:
$ !
$	if	-
		f$search("''profdir'node4_alarm_profile.dat") .eqs. ""
$	then
$		copy	nl:	'profdir'node4_alarm_profile.dat
$	endif
$
$ 	open	/append		n4_al_profile		'profdir'node4_alarm_profile.dat	
$
$ 	n4_al_count	=	1
$
$ N4_AL_PROFLOOP:
$
$	if	-
		node4_rule_'n4_al_count'	
$	then
$		write	n4_al_profile	"NODE4_RULE_''n4_al_count' TRUE"
$	else
$		write	n4_al_profile	"NODE4_RULE_''n4_al_count' FALSE"
$	endif
$ !
$	if	-
		n4_al_count .eq. "9"
$	then
		goto built_n4_al_profile
$	endif
$ !
$	n4_al_count	=	n4_al_count + 1
$
$	goto n4_al_profloop
$ !
$ BUILT_N4_AL_PROFILE:
$ !
$	close 	n4_al_profile
$ !
$ ASK_WATCH_AREA:
$ !
$	if	-
		node4_rule_9
$	then
$		target_area_count 	=	1
$ !
$ ASK_TARGET_AREA:
$ !
$		inquire TARGET$AREA'target_area_count' 		-
		"* Enter an area to be monitored for reachability (* = all, "." = no more) "
$ !
$		TARGET$AREA'target_area_count' == TARGET$AREA'target_area_count'
$		if 	-
			TARGET$AREA'target_area_count' .eqs. "?"
$		then
$			call help watch_area
$			goto ask_target_area
$		endif
$ !
$		if 	-
			TARGET$AREA'target_area_count' .eqs. ""
$		then
$			goto ask_target_area
$		endif
$ !
$		if 	-
			TARGET$AREA'target_area_count' .eqs. "."
$		then
$			delete /symbol /glo TARGET$AREA'target_area_count'
$		       	target_area_count = target_area_count - 1
$			goto got_areas
$		endif
$ !
$	       	target_area_count = target_area_count + 1	
$		goto ask_target_area
$ !
$ GOT_AREAS:
$ !
$		say	-
 		"%BUILDER-I-SELECTED, The following areas have been selected :"
$ !
$		say	""
$		multiarea_count = 1
$ !
$ MULTIAREA_LOOP:
$ !
$		say	-
		TARGET$AREA'multiarea_count' 
$		if 	-
			multiarea_count .eq. target_area_count 
$		then
$			goto finished_areas
$               endif
$ !
$		multiarea_count = multiarea_count + 1
$		goto multiarea_loop
$ !
$ FINISHED_AREAS:
$ !
$	endif
$ !
$ DONE_NODE4_ALARM_PROFILE:
$ !
$
$	endsubroutine
$ ! -
$ !
$ ! +
$ ASK_PROFILE:			subroutine
$ !
$ !	P1	=	Symbol
$ !	P2	=	Query Text
$ !	P3	=	Help parameter
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$ INQ:
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	inquire 'p1'	"* ''p2' "
$ !
$	if 	-
		'p1' .eqs. "?"
$	then
$		call help 'p3'
$		goto inq
$	endif
$ !
$	if 	-
		'p1' .eqs. ""
$	then
$		goto inq
$	endif
$ !
$	value	=	'p1'
$	if	-
		f$search("''profdir'profile.dat") .eqs. ""
$	then
$		copy	nl:	'profdir'profile.dat
$	endif
$
$ 	open	/append		profile		'profdir'profile.dat
$
$	write	profile		"''p1' ''value'"
$	close profile
$	endsubroutine
$ ! -
$ !
$ ! +
$ DOMAIN_FILE:			subroutine
$ !
$	on error 	then exit %X10000004
$	on control_y	then exit %X30000004
$ !
$	use_it	=	"B"
$	if	-
		f$search("SYS$LOGIN:MCC_DOMAINS.LIS") .nes. ""
$	then
$		say	-
		"%BUILDER-I-FOUNDFILE, Found file SYS$LOGIN:MCC_DOMAINS.LIS."
$		say	""
$		dire	/date	SYS$LOGIN:MCC_DOMAINS.LIS;
$		say	""
$ !
$ INQ_USE_DOMFILE:
$ !
$		inquire	use_it	-
		"* Do you want to ''inverse_on'''bold_on'U''all_off'se this file or ''inverse_on'''bold_on'B''all_off'uild a new version "
$
$
$		if	-
			use_it .eqs. "?"
$		then
$			call help domfile
$			goto inq_use_domfile
$		endif
$
$		if	-
			use_it .eqs. "U"
$		then 
$			exit
$		endif
$ !
$		if	-
			use_it .eqs. "B"
$		then 
$			goto build_new_dom_file
$		endif
$ !
$		say	-
		"%BUILDER-E-BADVAL, Invalid response - enter U to use existing"
$		say	-
		"-BUILDER-E-BADVAL, file or B to build new file"
$		goto inq_use_domfile
$	endif
$ !		
$ BUILD_NEW_DOM_FILE:
$ !
$	say	-
"%BUILDER-I-BUILDING, Building new MCC_DOMAINS.LIS file"
$ !
$	set noon
$	define sys$output 'workdir'domfile.tmp
$	manage/enterprise
sho dom * mem *
$	deass sys$output
$	sea 'workdir'domfile.tmp such /match=nor /out='workdir'domfile1.tmp
$	sea 'workdir'domfile1.tmp Unknown /match=nor /out='workdir'domfile2.tmp
$	sea 'workdir'domfile2.tmp Domain /out=sys$login:mcc_domains.lis
$	delete 'workdir'domfile.tmp.
$	delete 'workdir'domfile1.tmp.
$	delete 'workdir'domfile2.tmp.
$ !
$	endsubroutine
$ ! -
$ !
$ ! +
$ MAIN:
$ !
$ ! +
$ CREATE_WORK_DIR:
$ !
$	on error 	then goto error_exit
$	on control_y	then goto control_exit
$ !
$	if	-
		f$search("alarm.dir") .eqs. ""
$	then
$		create /dir 'aldir'
$	endif
$ !
$	if	-
		f$search("profile.dir") .eqs. ""
$	then
$		create /dir 'profdir'
$	endif
$ !
$	if	-
		f$search("work.dir") .eqs. ""
$	then
$		create /dir 'workdir'
$	endif
$ ! -
$ !
$ ! +
$ BANNER:
$ !
$	cl
$	say	""
$	say	-
"''dbltop'''bold_on'	''inverse_on' Welcome to Builder V1.0 ''all_off'"
$	say	-
"''dblbot'''bold_on'	''inverse_on' Welcome to Builder V1.0 ''all_off'"
$	say 	""
$	say	""
$	say	-
"''bold_on'			DECmcc Alarms Rule Build Utility''all_off'"
$ !
$	type sys$input
$	deck


			Enter a "?" at any time for help


$	eod
$ !	wait	00:00:02
$ ! -
$ !
$ ! +
$	set noon
$	call domain_file
$ !
$	stat = $status
$	if 	stat .eqs. "%X10000004" then goto error_exit
$	if 	stat .eqs. "%X30000004" then goto control_exit
$ ! -
$ !
$ ! +
$ BUILD_PROFILE:
$ !
$	call ask_profile TARGET$PARAMETER 				-
	"Enter NODE::USERNAME to receive VAXmail alarms"		-
	parameter
$ !
$	stat = $status
$	if stat .eqs. "%X10000004" then goto error_exit
$	if stat .eqs. "%X30000004" then goto control_exit
$ !
$	call ask_profile TARGET$BATCH_QUEUE				-
	"Enter the name of a batch queue for alarms "                  -
	batch_queue
$ !
$	stat = $status
$	if stat .eqs. "%X10000004" then goto error_exit
$	if stat .eqs. "%X30000004" then goto control_exit
$ !
$	goto new_entity
$ ! +
$ ANOTHER_ENTITY:
$ !
$	copy	nl:	'profdir'profile.dat
$	open	/read	oldprofile	'profdir'profile.dat;-1
$	open	/append	newprofile	'profdir'profile.dat
$	read	oldprofile	data1
$	read	oldprofile	data2
$	write	newprofile	data1
$	write	newprofile	data2
$	close	newprofile
$	close	oldprofile
$	purge	'profdir'profile.dat
$ ! -
$ !
$ ! +	
$ NEW_ENTITY:
$	call ask_profile TARGET$ENTITY	                                -
        "Name of DECmcc Global Entity (format e.g. Node4 .DNA_NODE.MYVAX) "	-
	entity
$ !
$	stat = $status
$	if stat .eqs. "%X10000004" then goto error_exit
$	if stat .eqs. "%X30000004" then goto control_exit
$ ! -
$ !
$ ! +
$ ASSIGN_SYMBOLS:
$
$	open	/read	profile		'profdir'profile.dat
$	read	profile		data1
$	read	profile		data2
$	read	profile		data3
$	close	profile
$ !
$	symbol1		=	f$element(0," ",data1)
$	symbol2		=	f$element(0," ",data2)
$	symbol3		=	f$element(0," ",data3)
$	value1		=	f$element(1," ",data1)
$	value2		=	f$element(1," ",data2)
$	value3		=	f$element(1," ",data3) + " " + -
				f$element(2," ",data3) 
$ !
$	'symbol1'	=	value1
$	'symbol2'	=	value2
$	'symbol3'	=	value3
$ !
$	delete	/symbol	symbol1
$	delete	/symbol	symbol2
$	delete	/symbol	symbol3
$	delete	/symbol	value1
$	delete	/symbol	value2
$	delete	/symbol	value3
$ !
$	entity_type	=	f$element(0," ",TARGET$ENTITY)
$	entity_name	=	f$element(1," ",TARGET$ENTITY)
$	entity_name	=						-
		f$extract(f$locate(".",entity_name)+1,		-
		f$length(entity_name)-f$locate(".",entity_name)-1,	-
		entity_name)
$ !
$	if	-
		f$locate(".",entity_name) .lt. -
		f$length(entity_name)
$	then
$		entity_name	=					-
		f$extract(f$locate(".",entity_name)+1,			-
		f$length(entity_name)-f$locate(".",entity_name)-1,	-
		entity_name)
$	endif
$ ! -
$ !
$ ! +
$ 	if	-
		entity_type .nes. "BRIDGE" .and. -
		entity_type .nes. "NODE4"
$	then
$		say	-
			"%BUILDER-F-INVENTITY, Invalid Entity Type - Re-enter"
$		goto another_entity
$	endif
$ ! -
$ !
$ ! +
$	if	-
		entity_type .eqs. "BRIDGE"
$	then
$		call 	get_domain	
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$		if 	stat .eqs. "%X50000004" then goto ask_another
$	endif
$ ! -
$ !
$ ! +
$	if	-
		entity_type .eqs. "NODE4"
$	then
$		call 	get_domain	
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$		if 	stat .eqs. "%X50000004" then goto ask_another
$		call 	get_node4_type	
$		stat	=	$status
$ !
$	endif
$ !
$	if 	stat .eqs. "%X10000004" then goto error_exit
$	if 	stat .eqs. "%X30000004" then goto control_exit
$ ! -
$ !
$ ! +
$	if	-
		entity_type .eqs. "NODE4"
$	then
$ !
$		call 	get_node4_line
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$		call 	get_node4_circuit
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$	endif
$ ! -
$ !
$ ! +
$ GET_BRIDGE_PROFILE:
$ !
$	if	-
		entity_type .eqs. "BRIDGE"
$	then
$		call bridge_alarm_menu
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$	endif
$ ! -
$ !
$ ! +
$ GET_NODE4_PROFILE:
$ !
$	if	-
		entity_type .eqs. "NODE4"
$	then
$		call node4_alarm_menu 'nodetype'
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$	endif
$ ! -
$ !
$ ! +
$ BUILD_COMFILES:
$ !
$	if	-
		entity_type .eqs. "BRIDGE"
$	then
$		call build_bridge_alarm_files
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$	endif
$ !
$	if	-
		entity_type .eqs. "NODE4"
$	then
$		call build_node4_alarm_files
$ !
$		stat = $status
$		if 	stat .eqs. "%X10000004" then goto error_exit
$		if 	stat .eqs. "%X30000004" then goto control_exit
$ 	endif
$ ! -
$ !
$ ! +
$	call 	done_message		-
		'files_created_list'
$ ! -
$ !
$ ! +
$ ASK_ANOTHER:
$ !
$  	inquire	another	-
"* Do you want to build alarm rules for another entity "
$ !
$	if 	-
		another .eqs. "?"
$	then
$		call help build_another
$		goto ask_another
$	endif
$ !
$	if 	-
		another .eqs. ""
$	then
$		goto ask_another
$	endif
$ !
$	if	-
		another .eqs. "Y" .or. another .eqs. "YES"
$	then
$		delete	/symbol	/global	/all
$		goto another_entity
$	endif
$ !
$	if	-
		another .eqs. "N" .or. another .eqs. "NO"
$	then
$	goto tidy
$	endif
$ !
$	goto ask_another
$ ! -
$ !
$ ! +
$ ERROR_EXIT:
$ !
$	say	-
"%BUILDER-F-ERREXIT, an error has occurred,"
$	say	-
"-BUILDER-F-ERREXIT, No files will be created."
$	say	""
$	say	-
"%BUILDER-I-TIDY, deleting temporary files ..."
$
$	goto tidy
$ ! -
$ !
$ ! +
$ CONTROL_EXIT:
$ !
$	say	-
"%BUILDER-F-CTRLEXIT, Operation abouted by <CTRL/Y>,"
$	say	-
"-BUILDER-F-CTRLEXIT, No files will be created."
$	say	""
$	say	-
"%BUILDER-I-TIDY, deleting temporary files ..."
$
$	goto tidy
$ ! -
$ !
$ ! +
$ TIDY:
$ !
$	delete 'profdir'profile.dat.*
$	delete	/symbol	/global	/all
$ 	del 'workdir'*.*.*
$	set def 'thisdir'
$ ! -