HiTek Software Home
 
Detect errors in telnet tasks using variable monitor
Date Updated  -  07/22/2007
Description
The Telnet tasks can only send the telnet commands and get replies.  The telnet task cannot detect if the command failed or if the batch file generated errors.
User is running a batch file on a Windows server using the telnet task.  He needs to detect when errors are generated in his batch file.  
Solution
1) When the Telnet task is run, every response from the Telnet server is stored as a Variable in Automize.  Please see the help section on Task Variables for details.  The variable name is of the form:
task_title::ResponseX, where X is the response number and task_title is the telnet task title

2)  When the users batch file is run, the Telnet sends back its data reply to Automize.  This reply is stored in the variable  task_title::Response4.  If an error occurs in the batch file the word 'error' is output back to Automize and stored in the Response variable..

3)  Create a Variable Monitor task, using the following settings:
Variable Name = task_title::Response4
Variable Value  = error
Comparison criteria = contains
Task To Run = Email (send alert email when his batch file fails)

4) Create a Chain task with the following steps:
step 1 = Telnet task
step 2 = Variable Monitor task

The telnet task will generate/update the value of the variable task_title::Response4.  The variable monitor task will check if the variable value contains the word 'error'.  If it does, it sends an email to the user.