At 09:33 AM 5/9/2006, [EMAIL PROTECTED] wrote:
How often do you run the batch file?
(ie. Do you schedule it to run at certain times?

nah, that's my "somethin's broke" batch file.
the one i schedule on problem systems is this one:

@echo Off
:begin
  set log=z-keepalive.log
  set msg=mail_services_restart
  set watson=
  for /f "tokens=1,2*" %%a in ('z-plist drwtsn32') do @set watson=%%b
  if NOT "%watson%"=="drwtsn32" goto log_error
  goto start_all_mail_related_services
:log_error
for /f "tokens=2" %%d In ('date /t') do for /f %%t in ('time /t') do (echo %%d %%t %msg%>>%log%)
:kill_dr_watson_process
 echo killing dr watson error...
  z-pkill -f %watson%
:stop_all_mail_related_services
  echo stopping all mail services...
  net stop scsmfilterpluse
  net stop imsdolist
  net stop smtprcv
  net stop smtpds
  net stop pop3s
:system cleanup
  echo clearing out undelivered mail mri files...
  del e:\spooler\domains\*.mri /s /q
  echo clearing out lockfiles...
  del f:\netmail\$LockFile /s /q
  echo clearing out antivirus temp files...
  del e:\antispam\ezav\temp\*.*
:restart_all_mail_related_services
  echo restarting all mail services...
  net start pop3s
  net start smtpds
  net start smtprcv
  net start imsdolist
  net start scsmfilterpluse
:e-mail_administrator
  echo sending a nasty note to god...
  z-sleep 30
c:\blat\blat.exe c:\z-keepalive.msg -to [EMAIL PROTECTED] -subject "restarted mail services on gone-postal"
  goto loop_batch_file_if_not_scheduled
:start_all_mail_related_services
  echo starting all mail services...
  net start pop3s
  net start smtpds
  net start smtprcv
  net start imsdolist
  net start scsmfilterpluse
:loop_batch_file_if_not_scheduled
  echo sleeping 60 seconds...
  z-sleep 60
  goto begin
:end


this one looks for a drwatson error and then executes everything else when it finds one. smtprcv doesn't like to be shut down sometimes, so my bounce file will force kill it, and keep checking for it to not be there before it continues. this one acts the same way, but it loops every 60 seconds and does nothing if dr watson hasn't thrown up a window.

the readme.nfo says

keepalive and monitoring script for the emwac ims mailserver
- kevin schooler, 13:32.05.07.2002
http://www.L7.net/

notes:

please edit the z-keepalive.bat file, and set the parameters to what works for your system.

line 4  (message logged to the logfile)
line 22 (domain directory path for deleting .mri files)
line 24 (mail directory path for deleting lock files)
line 26 (antivirus path for deleting antivirus temp files)

line 35 is a sleep statement to allow the mailserver to come
back up so that blat can sent the error message to the admin.
this can be shortened, and is in seconds. i.e. sleep 5 will
cause the batch file to pause for 5 seconds.

line 36 should be edited so it sends your error messages to you, not me :)
the z-keepalive.msg file is the body of the message that will be sent.

add a rem in front of, or remove, lines 45, 46, 47, if you are going to schedule this file. otherwise it will just loop continuously.

note: i renamed some of the utilities, etc. to keep them all in the same place in a file listing. this whole thing sits in c:\ as written

acknowledgements:

this script uses the following executables:

z-plist.exe - process lister
this is a renamed pslist.exe
PsList v1.12 - Process Information Lister
Copyright (C) 1999-2000 Mark Russinovich

z-pkill.exe - process killer
this is a renamed kill.exe
kill v3.5 for NT
Copyright (C) 1994 Microsoft Corp.

z-sleep.exe - pause utility
i found this file on the internet,
and i can find no information on it.

blat.exe - e mail sending utility
(v1.9.4) Blat - Windows NT/95 util to send
SMTP mail from the command line (Intel
version) Useful for sending mail from
automated jobs, HTML CGI scripts, etc.
Includes source code. Public Domain.


anyway, works for me. i made both files so they would cleanup the system a bit while it was down.
-dd

-dd

                                \\\\\//
       \\|//       _\\|//_      |     |      _\\|//_       \\|//
       (@ @)      (' 0-0 ')     (.) (.)     (' @-@ ')      (o-o)
+-=oOOo-(_)-oOOo=oo0=(_)=0oo=oOO=-(_)-=OOo=oo0=(_)=0oo=oOOo-(_)-oOOo=-+
                | Level Seven inc. http://www.L7.net/ |                 /"\
       The worlds "one stop" InterNetworking Provider 360.753.3556      \ /
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+  X
ASCII Ribbon campaign against HTML E-Mail >- - - - - - - - - - - - - -> / \
This is the discussion list for the IMS Free email server software.
 To unsubscribe send mailto:[EMAIL PROTECTED]

           Delivered by Rockliffe MailSite
          http://www.rockliffe.com/mailsite
               Rock Solid Software (tm)

Reply via email to