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!

Waitlist trigger's not working. 1

Status
Not open for further replies.

andytaylor58

Technical User
Jan 24, 2003
2
GB
Hi,

I am starting to use Procomm Plus 4.8 on a Nokia DX220 switch.

For the last four years I have used HIT. (Nokia’s own proprietry software).

I need a trigger waitlist for responses from the switch.

All errors begin with /***

Currently my waitlist procedure is pretty standard, borrowed from one of the many samples available on various (30 second timeout, and 2 trigger responses).

WaitList(30, "COMMAND EXECUTED", "/***" )
Which then relies upon WHEN TARGET to trigger.

But this never triggers on /***

I have tried changing the position of the trigger responses within the waitlist.

In HIT I had to trigger on "'/***'", Note the extra single quote. But this does not seem to work in Aspect. I guess it is due to /*** being special characters.

Any ideas?

Regards, Andy Taylor
 
When target "/***" call procedurename should work. Can you post your current script to review? Also try using Procomm's monitor window to see if the /*** is being sent, or if there is a non-printable character somwhere in the string as well. To activate this window, select the Data | Monitor Window menu item. Resize the Monitor Window so that you can view the entire width of the window, then click back in the Procomm Plus window so that the Monitor Window does not have focus. Incoming text is displayed in red, while text you send is colored blue. aspect@aspectscripting.com
 
Monitor window – Excellent tool. Showed me lots of ‘hidden’ characters. Lots to work on.

And I must have had an error in my WHEN TARGET. Re-wrote it from scratch, and it works now.

Thanks a lot.

regards, Andy taylor
 
I'm having a problem capturing "when target" conditions. I would like to dial, look for a login, then send a ^M if the login doesn't appear and then try the "when target" statements again.

The linefeeds don't seem to be transmitted following a block of "when target" statements.

Is this the best approach to automate logins to different devices that present different login prompts? Some of them need a linefeed or two to present a prompt. Then I would like to call the appropriate procedure depending on the prompt I get.

thanks

 
Instead of using when target, I would use waitfor statements with a 5 or 10 second timeout instead of the default 30 seconds. Something like this should work (untested):

while 1
if waitfor "login prompt" 5
exitwhile
else
transmit "^M"
endif
endwhile

Also, I notice you mentioned linefeeds. ^M is a carriage return, while ^J is a linefeed. This could be the problem you are seeing with your script.
aspect@aspectscripting.com
 
Thanks for the info. I've actually been using "waitfor" as well as "when," but I am having a lot of problems because I am dialing several different types of devices that all behave differently. Do you recommend using a combination of "waitfor" and "when" statements?

Here is another problem. In this same script I create an output file:

if fopen 1 outfile APPEND TEXT
...

and write to it at each iteration of the main loop:

strcat city ",Cisco login reached"
strcat city ","
fputs 1 city
;close file every iteration to make outfile ;viewable in ;Windows Explorer
fclose 1
...

Periodically I get an "invalid identifier" message during script execution, indicating the fputs line number. If I hit "continue" in the message box, execution resumes. After 20 or 30 more iterations through the main loop it occurs again.
 
Using when target or waitfor depends on the environment you are in. If you want to handle an error message that can occur at random, I would use when target. If you are expecting responses from the switch in a straightforward, repetitive manner that never deviates, then waitfor is the way to go.

As for your other problem, does the value of outfile change at any point during your script or does it have a constant value? aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top