;This simple script logs you into a DMS-100 SDM telnet session, telnets to the front-end, tranmits quser to find user "LOGS2," ;saves this data to an appending file in the c:\tempfolder folder which you will need to create. This script is only useful if ;you are able to telnet to the CM from the SDM on your DMS-100. It starts recording and capture file of selected logs from logutil. ; proc main string lineinfo string catline pwtitlebar "DMSLOGS2" permanent dial telnet "yoursiteSDM" ;calls "yoursiteSDM" from the dialing directory waitfor "login: " forever transmit "root^M" ;login to the SDM as the root user waitfor "root's Password: " forever transmit "yourpassword^M" waitfor "# " transmit "telnet 127.0.0.0^M" ;insert your switch CM ip address here. waitfor "Name" forever waitfor ">" forever transmit "LOGS2^M" ;userid in this example waitfor "Password" forever waitfor ">" transmit "logs2password^M" ;LOGS2 password here waitfor ">" forever set capture overwrite on ;overwrites the file each time you run script. set capture path "c:\tempfolder" set capture file "aspectcap.txt" transmit "quser^M" waitfor "LOGS2" clear capture on waitfor ">" capture off fopen 0 "c:\tempfolder\aspectcap.txt" READ fgets 0 lineinfo ;this reads the first line of text fclose 0 strreplace lineinfo " " "" strrev lineinfo strdelete lineinfo 0 2 ;parses the linefeed/carriage return off strrev lineinfo transmit "logutil^M" waitfor ">" forever strcat catline "startdev" ;the following lines perform DMS commands strcat catline lineinfo ;to add the logs you want and start the device. strcat catline "^M" transmit catline waitfor ">" forever transmit "stopdev " transmit lineinfo transmit "^M" waitfor ">" forever transmit "deldevice" transmit lineinfo transmit "^M" waitfor ">" forever transmit "addrep" transmit lineinfo transmit " ms" transmit "^M" waitfor ">" forever transmit "addrep" transmit lineinfo transmit " cm" transmit "^M" waitfor ">" forever transmit "addrep" transmit lineinfo transmit " pm" transmit "^M" waitfor ">" forever transmit "addrep" transmit lineinfo transmit " sdm" transmit "^M" waitfor ">" forever transmit "addrep" transmit lineinfo transmit " ext" transmit "^M" waitfor ">" forever transmit "addrep" transmit lineinfo transmit " enet" transmit "^M" waitfor ">" forever transmit "startdev" transmit lineinfo transmit "^M" waitfor ">" set capture overwrite off set capture path "c:\tempfolder" set capture file "tempDMSLOGS.txt" capture on endproc