HiTek Software Home
 
Monitor a log file for alerts.  Receives immediate cell phone/pager notification.
Date Updated  -  07/22/2007
Description
User is an equipment engineer in a manufacturing setting.  He uses Automize to detect alerts/errors in his production equipments log file.  
The format of his log file is as follows:
Aug 05, 2002, 14:45:53 - Alert - low chamber pressure....
Aug 05, 2002, 14:45:57 -  ............

The alerts are always output with the following word  'Alert'.  He needs to be notified immediately of any alerts that occur in the last 1 hour
Solution
You should be using version 5.3 or later

1) Create a TextSearch task  (TaskTitle = scanlog) 
Directory = directory where log file resides 
Filename = log file name
Results file = alert.txt (results file folder = c:\alerts)
Search terms = $%DATE::Qqq dd, YY, hh%$
Surrounding lines to append = 0

This task will look for all lines which contain the current date and time, and have been logged in the current hour.  Only lines which have been logged in the current hour will be output to the file alert.txt.

2) Create an email task (TaskTitle = emailAlert) to send yourself an email to your Cell phone/pager number.  Most cell phone companies in the US provide the ability to receive emails to cell phone.

3) Create a Variable Monitor task (TaskTitle = AlertMonitor)
Variable Name = FILE::LINECONTAINS::ALL::Alert::c:\alerts\alert.txt
Variable Value =  Alert
Comparison Criteria = contains
Task To Run = emailPager

If the file alert.txt contains the word 'Alert' then it means that an alert has been generated in the last 1 hour.  Then the emailAlert task is run to send an alert to the users cell phone.

4) Create a Chain task as follows:
Step 1 = TextSearch Task (scanLog)
Step 2 = Variable Monitor Task (AlertMonitor)

5) Schedule the Chain to run every 1 hour, at 59 minutes after the hour.

Note that this technique will not detect alerts that are generated in the 59th minute of every hour.  The user configured his equipment so that it is doing its 3 minute required maintenance during the minutes 58-01, so he does not miss any alerts