Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Global Error Handling Task
Topic Summary:
Created On: 05/01/2005 05:45 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 05/01/2005 05:45 PM
User is offline View Users Profile Print this message

Author Icon
Pete
Master (500-999)

Posts: 740
Joined: 03/30/2005

This post is about AM 6's global error-handling facilities. Jean posted recently about this in the AM 5 forums at:
http://forum.networkautomation...on=9&read=12936&fid=8

I have also posted about this in the past. I'm posting again now because AM 6 has different challenges in this regard than AM 5 had.

I'll start by explaining why I want global error handling. It's not enough to use Task Administrator for this purpose because (1) I run AutoMate on my home computer (as opposed to in a corporate IT production-support building) and I don't want something like Task Administrator running on my screen all the time and (2) all that Task Administrator can do anyway (on a global level) is display an error message on the screen (which assumes that someone is always sitting in front of the computer waiting for an error to occur) or send an email to someone (which didn't work for me when I tried it). Instead, I want to be able to programmatically act on errors at a global level, without immediate human intervention. Because we don't have the specific error information in the global task, this is currently not directly possible with AutoMate.

I do have a small number of tasks in which I've added complex error-handling logic on a step-by-step basis. I've also added retry logic in several places inside these tasks. Some tasks require this amount of effort, and I'm very happy with AutoMate's facilities for error handling at the task level. However, for most of my tasks, I do not need or want to do all of this inside each task. I also do not want to change each of these tasks' Properties to specify how to handle errors because this is tedious and it's too easy to forget to do this for newly created tasks, especially if more than one person is responsible for creating tasks.

The simplest method is to have a single error-handling task that I define in Task Administrator in the menu "System > Options > Task Errors > Run Task on Error". I know that Network Automation agrees, otherwise they wouldn't have bothered to give us this option. As Jean said, though, the current problem with this is that we don't have access to any error information in this global task, so it's not currently very useful.

It didn't work in AM 5 either. As a workaround, some of us created an Event Log Watcher to obtain error information on a global level. Other people used a File Watcher on the automate.log file for this purpose (a difficult and error-prone procedure). With AM 6, it has become even more difficult because AutoMate no longer sends errors (on a global level) to these two places, and we're left with only a new logfile (AM6LogFile.ald) that's in an unreadable binary format.

I'm just a home user with about one hundred tasks. I would guess that this is a bigger problem for an admin in an IT shop who might be using AutoMate in a more complex environment than me. Maybe the new SNMP actions are exactly what they want. I don't know, but I do know that SNMP doesn't help small businesses or home users like me.

Anyway, I'm not posting this simply to complain. I've designed a workaround for AM 6 that allows me to use a single task to handle errors globally, and I'm posting this in case it might help someone else.

The workaround consists of three AutoMate tasks:

"Add or Remove Error Handling.aml"
sets an error filename in the Errors tab of the Properties of every managed task. It does this by stopping Task Administrator, the Event Monitor, and the AutoMate Service, then it adds the relevant tag attributes to the ATL file. It will only do this with the tasks that don't already specify an error file. When you run this task, it also gives you the option to remove all the error-file attributes. After the first time that you run this, you only need to run it again if you create new managed tasks.

"New AML File Created.aml"
simply displays a message box whenever you create a new managed task to remind you to re-run the first task.

"Error Handler.aml"
is the task that will run when an error occurs.

To "install" the workaround, I suggest the following steps:

1) In Task Administrator's "System > Options"
.....(these changes are optional)
.....go to the General tab
..........disable Show error window
..........disable Play sound on task failure
.....go to the Task Errors tab
..........disable Run task on error

2) Import the three tasks (that I attached to this post) into Task Administrator. Of course you can change them however you want. In particular, you might want to change "Error Handler.aml" to do special things. Although I only posted a simple example of this task (it simply displays a dialog box), I actually use a more complex version of the task that includes sending an email to my work computer, but only if my home computer is currently locked.

3) Change the Properties for "Error Handler.aml"
.....add a File Watcher Trigger
..........watch folder is C:\Documents and Settings\All Users\Documents
..........enable Wait for file to be accessible
..........enable File added
..........include filter is automateErrorFile*.txt
.....Priority
..........Limit instances of this task
..........1
..........Hold task indefinitely

4) Change the Properties for "New AML File Created.aml"
.....add a File Watcher Trigger
..........watch folder is the root folder of where you keep your tasks
..........enable Watch subfolders
..........enable Wait for file to be accessible
..........enable File added
..........include filter is *.aml
.....Priority
..........Limit instances of this task
..........1
..........Hold task indefinitely (or) Don't run

5) Run "Add or Remove Error Handling.aml" from a Task Builder window.


I realize that it's not a perfect solution, but until AutoMate provides this capability, this is one possible workaround. It works very well for me.

A couple of notes. (1) I disable the message box and the error sound in Task Administrator because the error task does these things. It has to because Task Administrator might not be running. (2) This workaround will only work with managed tasks.

-------------------------
AutoMate Pro 7.1.1.0 (Medium isolation level)
WinXP Home sp3, "Classic Theme", 120 DPI
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 2601 guests browsing this forum, which makes a total of 2601 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog