drw_monitor - The Dr Watson monitor

drw_monitor watches the Dr Watson log file, and sends notification (email, alpha page) when the file changes size, indicating that Dr Watson has logged a crash condition.


System Requirements

You can usually get the latest version of drw_monitor from CPAN, in /Scripts/Win32

You will first need to install ActivePerl, which you can obtain from http://www.activestate.com/ The paths in this document assume that Instead of installing in the default location (c:\perl), you installed in c:\usr. This is something that I do, for a variety of reasons. If you don't, change your paths appropriately.

You will also need to install Mail::Sendmail and Net:SNPP in order to send email alpha pages, respectively. These modules are also available from CPAN. Or, you can install them with PPM.

Finally, in order to install drw_monitor as an NT service, you will need to have instsrv and srvany from the NT Resource Kit. This is the only part of this installation that is not free. However, I think that AINTX will soon have this functionality, and the NT Resource Kit won't be needed any more.


Installation

Copy drw_monitor.pl and srvany.exe to c:\bin.

Install drw_monitor as an NT service with instsrv, with the following command:

        instsrv drw_monitor c:\bin\srvany.exe

You will need to edit the registry, as specified in the documentation for instsrv, to tell it where to find drw_monitor.pl

This will look like:

        [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\drw_monitor\Parameters]
        "Application"="c:\\usr\\bin\\perl.exe c:\\bin\\drw_monitor.pl"

Contact your local NT guru if you don't know what that means.

Finally, type

        notepad c:\bin\drw_monitor.pl

A few lines down, you will see

        $machine = 'machinename';
        $to = 'notify@address.com';
        $from = "$machine\@address.com";
        $directory = 'c:/winnt';
        $file = 'c:/winnt/drwtsn32.log';

        $pagerhost = 'pager.service.com';
        $pager = 'pagerID';

You will probably not have to change $directory and $file, unless you have WinNT installed somewhere strange, but all of the other variables nees to be set to reasonable values. $pagerhost must be a valid SNPP-compliant pager server. $pager is the pager ID on that server to which you want to send alpha pages. $from is the address from which email notification will appear to come. $to is the email address to which those notifications will be send, in addition to alpha page notification.


OK, now what?

To make sure that it is working, change to the c:\bin directory and run perl drw_monitor.pl from the command line. You should see a message that says

        Monitoring Dr Watson on machinename ...
        
To verify that it is working, open up the Dr Watson log in notepad

        notepad c:\winnt\drwtsn32.log
        
Modify the file slightly. For example, add a carriage return at the end
of the file, and save it. You should immediately see a message in the
DOS window stating that a crash has occurred. Shortly after that, you 
should receive email and an alpha page to the same effect.

Having verified that it is working, you can start the service from the services panel.


Author

drw_monitor was written by Rich Bowen - <rbowen@rcbowen.com>