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!

Revised NORTEL 1XEVDO RNC MONITOR SCRIPT

Status
Not open for further replies.

areotree

Technical User
Feb 16, 2003
24
US
I have rewritten the RNC monitor script to give you more control over what you want to collect and monitor. You now get a dialogbox with multiple choices. Some of the choices have alarms, I have placed a "*" beside those. Below are the choices:

Display Node Info *** --> Alarms if not "UP"
Display Show Mod Info *** --> Alarms if either of the SC cards status changes
Display CPU Util Info
DOM Check *** --> Alarms if total number of DOMs homed drops below number specified
Display DOM Type Info
Display AT Info
Display General Info
Do Memory Check ***--> Alarms if total memory drops below 25 Meg.
Display RNSM Info

Hide ProComm Window
Open Capture File

See below:
===============================================






;***********************************************************************
;* *
;* 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, pasec, cnt, cnt2, DOMpri, DOMsec
integer nodon, modon, cpuon, domchk, domon, aton, genon, memon, rnsmon, pchid, capon
;************************************************************************
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% 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
SHowCK()
NODEck()
SCcard()
CPUutil()
DOMck()
DOMtype()
ATinfo()
GENinfo()
MEMck()
RNSMinfo()
GUIupdt()
endwhile
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get RNC Monitor Setup from user:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc MONsetup
dialogbox 0 219 30 181 248 6 "RNC Monitor Setup Written By: Chase Vale"
checkbox 1 138 13 12 11 "" nodon
checkbox 2 138 22 12 11 "" modon
checkbox 3 138 33 12 11 "" cpuon
checkbox 4 138 43 12 11 "" domchk
checkbox 5 138 53 12 11 "" domon
checkbox 6 138 63 12 11 "" aton
checkbox 7 138 74 12 11 "" genon
checkbox 8 138 85 12 11 "" memon
checkbox 9 138 96 12 11 "" rnsmon
checkbox 10 138 115 12 11 "" pchid
checkbox 11 138 128 12 11 "" capon
editbox 12 65 180 50 11 DOMS
editbox 13 65 207 50 11 PAUSEC
pushbutton 14 49 226 40 13 "GO!!!!" OK DEFAULT
pushbutton 15 103 226 40 13 "&Quit"
groupbox 16 10 2 158 139
text 17 9 194 170 11 "Enter the number of seconds to pause (Default is 60)" left
text 18 17 167 150 11 "in enable mode, 'show 1xevdo counters air'" left
text 19 31 128 68 9 "Open Capture File:" left
text 20 32 116 82 9 "Hide ProComm Window:" left
text 21 33 98 68 9 "Display RNSM Info:" left
text 22 33 88 67 9 "Do Memory Check:" left
text 23 33 77 72 9 "Display General Info:" left
text 24 33 65 58 9 "Display AT Info:" left
text 25 33 54 80 9 "Display DOM Type Info:" left
text 26 33 45 70 9 "DOM Check:" left
text 27 33 35 80 9 "Display CPU Util Info:" left
text 28 33 24 80 9 "Display Show Mod Info:" left
text 29 33 13 79 9 "Display Node Info:" left
text 30 9 158 170 11 "Enter the number of expected DOMS (Default is 1)" left
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 off
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
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
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Clock Check:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc SHowCK
transmit "en^M"
waitforpt("#")
transmit "exit^M"
waitforpt(">")
transmit "show clock^M"
waitfor "show clock"
rget trash
rget Rtime
termwrites trash
termwrites Rtime
transmit "^M"
waitforpt(">")
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Node Status Check:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc NODEck
if nodon
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 "show node-alias^M"
rget trash
termwrites trash
rget trash
termwrites trash
rget RNCnme
termwrites RNCnme
transmit "exit^M"
waitforpt(">")
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% SC Card Check:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc SCcard
if modon
transmit "^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
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get CPU Util:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc CPUutil
if cpuon
transmit "^M"
waitforpt(">")
termmsg "`r`n`r`n"
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]
if strfind cpucnt[cnt] "CPU" MATCHCASE
strfind cpucnt[cnt] "CPU" pos MATCHCASE
strdelete cpucnt[cnt] 0 pos-1
strfind cpucnt[cnt] "%" pos MATCHCASE
strdelete cpucnt[cnt] pos+1 1
endif
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
termmsg " %s `r`n" cpucnt[cnt]
endfor
termmsg "`r`n"
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% DOM Check:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc DOMck
if domchk
transmit "en^M"
waitforpt("#")
transmit "no hidden enable^M"
waitforpt("#")
transmit "show 1xevdo counters air^M"
waitfor "RN Homing:"
rget trash
rget sInput1
rget sInput2
rget sInput3
termwrites "^M"
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(">")
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get DOM type:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc DOMtype
if domon
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 domchk
if(DOMpri+DOMsec) == Dom
numtostr DOMpri DOMprim 10
numtostr DOMsec DOMsecd 10
else
DOMprim = "N/A"
DOMsecd = "N/A"
endif
else
numtostr DOMpri DOMprim 10
numtostr DOMsec DOMsecd 10
endif
transmit "exit^M"
waitforpt(">")
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get AT Info:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc ATinfo
if aton
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(">")
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get General Info:
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc GENinfo
if genon
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 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
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Check Memory for 25 meg. or more
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc MEMck
if memon
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(">")
endif
endproc

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;% Get RNSM Card Info
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc RNSMinfo
if rnsmon
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"
rnsmon = 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
strlen rncts[cnt] pos
strdelete rncts[cnt] pos-1 1
termmsg "%s `r" rncts[cnt]
cnt++
endif
endwhile
endif
if rnsmon
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
pause 1
transmit "exit^M"
waitforpt(">")
endif
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 !!"
winshow $PWMAINWIN
exit
endif
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top