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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hourly Polling of PBX Traffic

Status
Not open for further replies.

lakehouse

Technical User
May 17, 2004
45
US
I'm in need of Aspect script to retrieve hourly PBX traffic data. It needs to do the following:

1. Automatically Dial the PBX modem number, Hourly about 10 min after the hour.
2. Login and send Password
3. Send LD 02 and related commands
4. Capture data received on screen. (less than 50 lines)
5. Log off
6. Process captured data, writing received data in to one row of a text file and adding Date/Time stamp.
7. Repeat process next hour and appending new row of text to same file.
8. Start new text file weekly on Sundays @ 00:00.

I can handle items # 3 and 6, just need work out the rest of the script.
 
For item 1, probably the easiest way is to use the ltimeints command to break the time into integers for hour, minutes, etc. and loop until the hours integer = 10.

For 2 and 3 (and 5 as well), you can use Procomm's script recorder to get most of this framework. Here is some more information from my site. If you are trying to create a script that automates communications with a remote system and the text is relatively constant, you can make the task easier by using the Script Recorder to create your script. To enable the Script Recorder, select the Tools | Scripts | Start Recorder menu item. Procomm Plus will now monitor all incoming data and your outgoing responses to that data. Start performing the tasks (keyboard-based only!) that you want Procomm Plus to record. Once done, select the Tools | Scripts | Stop Recorder menu item. You will be prompted to save your recorded script; some editing of the script may be necessary. Be aware that if you dialed an entry from the Connection Directory, then your recorded script will be attached to that entry unless you change the value at the bottom of the Save As dialog. When you view your script, you will see that it is composed of waitfor/transmit commands. If all looks well, compile your script and see if it executes as expected. To make a recorded script more extensible, you can take a recorded script and replace some of the recorded strings with variables so that a more general script can be created.

For item 4, you would use the capture ON and capture OFF command, as well as any set capture commands that might be applicable to your needs.

For item 8, you can have a when $DATE command at the beginning of your main script that will call a subprocedure when $DATE changes (i.e. it's a new day). You can then use ltimemisc to get the new day and act accordingly.

Here's a rough framework to get you started:

proc main
when $DATE call checkdate

while 1
ltimeints
if iHour == 10
do stuff
put a pause in here such that minutes will be
at least 11 when you are done capturing
endif
endwhile
endproc

proc checkdate
check for sunday, create new file if so
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top