Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NORTEL 1XEVDO RNC MONITOR SCRIPT

Status
Not open for further replies.

areotree

Technical User
Feb 16, 2003
24
US
;***********************************************************************
;* *
;* THIS SCRIPT IS FOR COLLECTING AND MONITORING 1XEVDO RNC DATA. *
;* ! NO TECHNICAL SUPPORT IMPLIED ! *
;* *
;* *
;***********************************************************************
;************************************************************************
;* *
;* Global Variables for RNC_MOD_Monitor *
;* *
;************************************************************************
string sInput1, sInput2, sInput3, DOMS = "1", SC7stat, SC9stat, trash, RNCver, DOMsecd
string TotAT, RegAT, FMemNum, ADstat, OPstat, RNCnme, Rtime, DomNum, Domtyp[1500]
string trash1, trash2, CPUUT, cpunum, PAUSEC = "60", rncts[20], cpucnt[25], DOMprim
integer iLen, pos, Dom, Dom1, EVENT, FMem, cd7, cd9, rncon, pasec, cnt
integer cnt2, pchid, capon, DOMpri, DOMsec
;************************************************************************
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% MAIN:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc main
rncts[1] = " Retrieving Data"
rncts[2] = " !!! Please Wait !!!"
set terminal scroll on
set terminal sbpages 1300
set capture recordmode raw
set capture query on
MONsetup()
GUIbd()
when dialog 10 call winback
while 1
SCcard()
CPUutil()
DOMck()
DOMtype()
NODEck()
ATinfo()
GENinfo()
MEMck()
RNSMinfo()
GUIupdt()
endwhile
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get RNC Monitor Setup from user:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc MONsetup
dialogbox 0 216 121 196 158 6 "RNC Monitor Setup Written By: Chase Vale"
groupbox 1 11 0 174 59
text 3 22 13 110 11 "Display RNSM and CPU Util Info:" left
checkbox 4 157 13 12 11 "" rncon
text 5 22 28 110 11 "Hide ProComm Window:" left
checkbox 6 142 26 12 11 "" pchid
text 7 22 42 110 11 "Open Capture File:" left
checkbox 8 124 40 12 11 "" capon
text 9 12 67 170 11 "Enter the number of expected DOMS (Default is 1)" left
text 10 22 75 150 11 "in enable mode, 'show 1xevdo counters air'" left
editbox 11 68 89 50 11 DOMS
text 12 12 103 170 11 "Enter the number of seconds to pause (Default is 60)" left
editbox 13 68 116 50 11 PAUSEC
pushbutton 14 52 135 40 13 "GO!!!!" OK DEFAULT
pushbutton 15 106 135 40 13 "&Quit"
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate dialog event.
case 0 ; No event occurred.
endcase
case 14 ; Button was pressed.
if capon
capture on
endif
if pchid
winhide $PWMAINWIN
endif
exitwhile ; Exit the while loop.
case 15 ; Cancel button
exit
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Get rid of dialog box.
strtonum PAUSEC pasec
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Build monitor GUI:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc GUIbd
if rncon
dialogbox 10 174 77 364 390 6 "RNC Monitor:"
editbox 1 99 8 64 11 SC7stat
editbox 2 99 22 64 11 SC9stat
editbox 3 132 35 32 11 DomNum
editbox 4 132 48 32 11 DOMprim
editbox 5 132 61 32 11 DOMsecd
editbox 6 99 82 64 11 TotAT
editbox 7 99 95 64 11 RegAT
editbox 8 99 108 64 11 FMemNum
editbox 9 119 125 25 11 OPstat
editbox 10 119 137 25 11 ADstat
editbox 11 19 169 134 11 Rtime
editbox 12 19 182 134 11 RNCnme
editbox 13 19 195 134 11 RNCver
text 14 13 8 38 11 "SC7 Status:" left
text 15 13 22 38 11 "SC9 Status:" left
text 16 13 36 48 11 "DOMs Homed:" left
text 17 13 49 100 11 "# Of Primary DOMs Homed:" left
text 18 13 61 100 11 "# Of Secondary DOMs Homed:" left
text 19 13 85 77 11 "Total Reg. AT Sessions:" left
text 20 13 97 77 11 "Total Act. AT Sessions:" left
text 21 13 109 44 11 "Free Memory:" left
text 22 13 127 86 11 "RNC Operational Status:" left
text 23 13 139 86 11 "RNC Administrative Status:" left
text 24 39 158 86 11 "General RNC Info:" left
groupbox 25 8 0 348 216
groupbox 26 180 0 175 216
text 27 39 158 86 11 "General RNC Info:" left
text 28 228 9 78 9 "RNSM Card Info:" center
text 29 228 22 78 9 " Slot Load Sess" center
editbox 30 233 35 74 11 rncts[0]
editbox 31 233 48 74 11 rncts[1]
editbox 32 233 61 74 11 rncts[2]
editbox 33 233 74 74 11 rncts[3]
editbox 34 233 87 74 11 rncts[4]
editbox 35 233 100 74 11 rncts[5]
editbox 36 233 113 74 11 rncts[6]
editbox 37 233 126 74 11 rncts[7]
editbox 38 233 139 74 11 rncts[8]
editbox 39 233 152 74 11 rncts [9]
groupbox 40 8 211 347 175
text 41 103 220 165 16 "CPU Utilization:" center
editbox 42 35 235 115 11 cpucnt[1]
editbox 43 35 247 115 11 cpucnt[2]
editbox 44 35 259 115 11 cpucnt[3]
editbox 45 35 271 115 11 cpucnt[4]
editbox 46 35 283 115 11 cpucnt[5]
editbox 47 35 295 115 11 cpucnt[6]
editbox 48 35 307 115 11 cpucnt[7]
editbox 49 35 319 115 11 cpucnt[8]
editbox 50 35 331 115 11 cpucnt[9]
editbox 51 35 343 115 11 cpucnt[10]
editbox 52 35 355 115 11 cpucnt[11]
editbox 53 35 367 115 11 cpucnt[12]
editbox 54 220 235 115 11 cpucnt[13]
editbox 55 220 247 115 11 cpucnt[14]
editbox 56 220 259 115 11 cpucnt[15]
editbox 57 220 271 115 11 cpucnt[16]
editbox 58 220 283 115 11 cpucnt[17]
editbox 59 220 295 115 11 cpucnt[18]
editbox 60 220 307 115 11 cpucnt[19]
editbox 61 220 319 115 11 cpucnt[20]
editbox 62 220 331 115 11 cpucnt[21]
editbox 63 220 343 115 11 cpucnt[22]
editbox 64 220 355 115 11 cpucnt[23]
enddialog
else
dialogbox 10 450 16 170 210 6 "RNC Monitor:"
editbox 1 96 3 64 11 SC7stat
editbox 2 96 17 64 11 SC9stat
editbox 3 128 30 32 11 DomNum
editbox 4 128 43 32 11 DOMprim
editbox 5 128 56 32 11 DOMsecd
editbox 6 96 71 64 11 TotAT
editbox 7 96 84 64 11 RegAT
editbox 8 96 97 64 11 FMemNum
editbox 9 116 114 25 11 OPstat
editbox 10 116 126 25 11 ADstat
editbox 11 16 158 134 11 Rtime
editbox 12 16 171 134 11 RNCnme
editbox 13 16 184 134 11 RNCver
text 14 7 5 38 11 "SC7 Status:" left
text 15 7 19 39 11 "SC9 Status:" left
text 16 7 32 48 11 "DOMs Homed:" left
text 17 7 43 100 11 "# Of Primary DOMs Homed:" left
text 18 7 56 100 11 "# Of Secondary DOMs Homed:" left
text 19 7 74 77 11 "Total Reg. AT Sessions:" left
text 20 7 86 77 11 "Total Act. AT Sessions:" left
text 21 7 98 44 11 "Free Memory:" left
text 22 7 116 87 11 "RNC Operational Status:" left
text 23 7 128 87 11 "RNC Administrative Status:" left
text 24 36 147 87 11 "General RNC Info:" left
enddialog
endif
endproc
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% SC Card Check:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc SCcard
transmit "en^M^M"
waitforpt("#")
transmit "show node-alias^M^M"
waitforpt("#")
rget trash
rget trash
rget RNCnme
transmit "exit^M^M"
waitforpt(">")
transmit "show mod^M^M"
waitfor "07 YES YES sc1/7/1"
rget sInput1
termwrites sInput1
rget trash
termwrites trash
rget sInput2
termwrites sInput2
if cd7
if not strfind sInput1 "Active"
alarm 8
usermsg "%s Card 7 not in Active state" RNCnme
else
SC7stat = "Active"
endif
if not strfind sInput2 "Standby"
alarm 8
usermsg "%s Card 9 not in Standby state" RNCnme
else
SC9stat = "Standby"
endif
elseif cd9
if not strfind sInput2 "Active"
alarm 8
usermsg "%s Card 9 not in Active state" RNCnme
else
SC9stat = "Active"
endif
if not strfind sInput1 "Standby"
alarm 8
usermsg "%s Card 7 not in Standby state" RNCnme
else
SC7stat = "Standby"
endif
else
if strfind sInput1 "Active"
SC7stat = "Active"
cd7 = 1
elseif strfind sInput2 "Active"
SC9stat = "Active"
cd9 = 1
endif
if strfind sInput1 "Standby"
SC7stat = "Standby"
elseif strfind sInput2 "Standby"
SC9stat = "Standby"
endif
endif
pause 1
transmit "^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get CPU Util:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc CPUutil
transmit "^M"
waitforpt(">")
for cnt = 1 upto 23
CPUUT = "show util cpu cpu1/"
numtostr cnt cpunum 10
strcat CPUUT cpunum
strcat CPUUT "/1^M"
transmit CPUUT
rget trash
rget cpucnt[cnt]
termwrites trash
termwrites cpucnt[cnt]
if strfind cpucnt[cnt] "Can't"
rget trash
cpucnt[cnt] = "Slot "
strcat cpucnt[cnt] cpunum
strcat cpucnt[cnt] " CPU Utilization N/A"
else
strinsert cpucnt[cnt] cpunum 0
strinsert cpucnt[cnt] " " 0
strinsert cpucnt[cnt] "Slot " 0
endif
endfor
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% DOM Check:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc DOMck
transmit "en^M^M"
waitforpt("#")
transmit "no hidden enable^M^M"
waitforpt("#")
transmit "show 1xevdo counters air^M^M"
waitfor "RN Homing:"
rget trash
rget sInput1
rget sInput2
rget sInput3
termwrites trash
termwrites "^M"
termwrites sInput1
termwrites sInput2
termwrites sInput3
substr DomNum sInput3 51 4
atoi DomNum Dom
atoi DOMS Dom1
if Dom<Dom1
alarm 8
usermsg "%s DOMs are down!!!" RNCnme
endif
pause 1
transmit "exit^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get DOM type:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc DOMtype
cnt = 0
transmit "en^M"
waitforpt("#")
transmit "show abis peer^M"
rget trash
termwrites trash
rget trash
termwrites trash
rget trash
termwrites trash
rget trash
termwrites trash
rget trash
termwrites trash
rget Domtyp[cnt]
while not nullstr Domtyp[cnt]
cnt++
rget Domtyp[cnt] 256 1
endwhile
cnt = 0
DOMpri = 0
DOMsec = 0
while not nullstr Domtyp[cnt]
if strfind Domtyp[cnt] "(P)"
DOMpri++
elseif strfind DOMtyp[cnt] "(S)"
DOMsec++
endif
termmsg "%s `r" DOMtyp[cnt]
cnt++
endwhile
if (DOMpri+DOMsec) == Dom
numtostr DOMpri DOMprim 10
numtostr DOMsec DOMsecd 10
else
DOMprim = "N/A"
DOMsecd = "N/A"
endif
transmit "exit^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Node Status Check:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc NODEck
transmit "en^M"
waitforpt("#")
transmit "show node^M^M"
waitfor "show node"
rget trash
rget sInput1
rget sInput2
rget sInput3
termwrites "^M"
termwrites sInput1
termwrites sInput2
termwrites sInput3
substr ADstat sInput1 25 4
substr OPstat sInput2 25 4
if not strfind ADstat "UP"
alarm 8
usermsg "%s ADMIN state is down!!!" RNCnme
endif
if not strfind OPstat "UP"
alarm 8
usermsg "%s OPER state is down!!!" RNCnme
endif
pause 1
transmit "exit^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get AT Info:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc ATinfo
transmit "en^M"
waitforpt("#")
transmit "show 1xevdo counters call^M^M"
waitfor "Statistics"
rget trash
rget trash1
rget trash2
rget sInput1
rget sInput2
rget sInput3
substr TotAT sInput1 51 10
substr RegAT sInput2 51 10
termwrites trash
termwrites trash1
termwrites trash2
termwrites sInput1
termwrites sInput2
termwrites sInput3
pause 1
transmit "exit^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get General Info:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc GENinfo
transmit "en^M"
waitforpt("#")
transmit "show 1xevdo counters kpi^M^M"
waitforpt("#")
pause 1
transmit "show 1xevdo counters memory^M^M"
waitforpt("#")
pause 1
transmit "show 1xevdo counters task^M^M"
waitforpt("#")
pause 1
transmit "show uati counters^M^M"
waitforpt("#")
transmit "exit^M^M"
waitforpt(">")
transmit "show version^M^M"
waitfor "Version:"
rget RNCver
transmit "show clock^M^M"
waitfor "show clock"
rget trash
rget Rtime
termwrites trash
termwrites Rtime
transmit "show logging file match Unable^M^M"
waitforpt(">")
pause 2
transmit "show logging file match addPending^M^M"
waitforpt(">")
pause 2
transmit "show msg-client UATIMsgCS^M^M"
waitforpt(">")
pause 1
transmit "show msg-server UATIMsgCS^M^M"
waitforpt(">")
pause 1
transmit "show msg-server^M^M"
waitforpt(">")
pause 1
transmit "show msg-server DOServer^M^M"
waitforpt(">")
pause 1
transmit "show msg-server IPCServer^M^M"
waitforpt(">")
pause 1
transmit "show msg-server LogfacilityMgrMsgCS^M^M"
waitforpt(">")
pause 1
transmit "show msg-server LogMgrMsgCS^M^M"
waitforpt(">")
pause 1
transmit "show msg-server MSS^M^M"
waitforpt(">")
pause 1
transmit "show msg-client MSS^M^M"
waitforpt(">")
pause 1
transmit "^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Check Memory for 25 meg. or more
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc MEMck
transmit "^M"
waitforpt(">")
transmit "show memory^M^M"
waitfor "current"
rget trash
rget sInput1
termwrites trash
termwrites sInput1
strlen sInput1 iLen
if strfind sInput1 "free" pos
pos=pos+5
iLen=iLen-pos
strread sInput1 pos sInput2 12
endif
while iLen > 0 ;While the string has at least one character in it...
if rstrcmp sInput2 " " 1 ;Compare character
strdelete sInput2 0 1 ;If space, delete from string
else
exitwhile ;Else exit the while loop
endif
endwhile
FMemNum = sInput2
atoi sInput2 FMem
if FMem<25000000
alarm 8
usermsg "Memory is getting Low !!!"
endif
pause 1
transmit "^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get RNSM Card Info
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc RNSMinfo
if rncon
cnt = 0
transmit "en^M"
waitforpt("#")
transmit "show rnsmlb load table^M"
rget rncts[cnt]
while not nullstr rncts[cnt]
cnt++
rget rncts[cnt] 256 1
endwhile
cnt = 0
while not nullstr rncts[cnt]
if strfind rncts[cnt] "Invalid"
rncon = 0
for cnt = 0 upto 10
rncts[cnt] = ""
endfor
rncts[1] = " RNSM Card Info is"
rncts[2] = " not supported on"
rncts[3] = " this RNC load."
else
termmsg "%s `r" rncts[cnt]
cnt++
endif
endwhile
endif
if rncon
cnt = 0
while not strfind rncts[cnt] "Slot"
cnt++
endwhile
cnt = cnt+2
cnt2 = 0
while not strfind rncts[cnt] "------"
strcpy rncts[cnt2] rncts[cnt] 28
strreplace rncts[cnt2] "|" ""
strcpy rncts[cnt] " N/A"
cnt++
cnt2++
endwhile
endif
pause 1
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Update Monitor GUI
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc GUIupdt
dlgupdate 10 1 65
waitquiet pasec FOREVER
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% PROC WINBACK
;% Bring back Main window
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc winback
winshow $PWMAINWIN
exit
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%
;% Waitfor Prompt Error
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc waitforpt
param string pmpt
if not waitfor pmpt 15
alarm 8
usermsg "RNC has not responded in 15 seconds, check connection !!"
exit
endif
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top