Re: Script to Email Me when a Service has Stopped

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"James" <James@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:23ED8F90-911A-4590-8456-BA922F369053@xxxxxxxxxxxxxxxx
I have two services one called vmagic.exe and the other csmagic.exe that
when
stopped I want an email sent to me to notify me that it has been stopped.
Is
it possible to do this? These services reside on both Windows 2000 and
Windows 2003 servers. I have no scripting background and am not familiar
with
the syntax or terminology. I have downloaded a couple of scripts in the
past
that have been preconfigured for certain task and substituted my specific
environment info where required in the script but thats as good as it gets
for me. If anyone knows if there are any scripts out there that can do
this
or if anyone can give me a copy of something they may have created with
some
very simple instructions for a NON SCRIPTOR such as myself that would be
greatly appreciated.

Thanks

You could invoke this script when the service fails:
@echo off
set Sender=support@xxxxxxxxxxx
set Receiver=James@xxxxxxxxxxx
set Host=mail.YourISP.com
set Subject=%date% %time:~0,5%: SomeService is not running

c:\tools\blat.exe "%0" -f %Sender% -to %Receiver% -server %Host% -subject
"%Subject%"

Adjust the four "set" lines to reflect your own environment. Blat.exe
is a command line mailer that you can download from a number of
sites.


.



Relevant Pages

  • Re: Aaagh! cScript no longer Returning! ??
    ... > try turning them off and run the script again... ... thats our entry level environment that must be used as a starting ... point] I am also running this on XP SP2 machines, ... we have a script that builds the web site on install. ...
    (microsoft.public.scripting.vbscript)
  • Re: Whereis Kernel? & Why Debian "KDE" freezing?
    ... > There is no config file in. ... Thats not a Script, thats the kernel. ... your KDE is unstable. ...
    (alt.linux)
  • Re: Linux Home Server HOWTO - Open For Review
    ... I did want to add some type of monitoring here, but I found the script ... Thats a fair call.. ... simple are a hard match to start with, thats the reason I at least ... I think it would be suitable to include a package ...
    (Fedora)
  • Re: avoid script running twice
    ... transaction and have your script check for that before running its main body. ... I think thats the most hassle free way of doing it. ...
    (comp.lang.python)
  • another clamstats.pl question
    ... The same is with the html output. ... its just the year thats being shown wrong. ... is the portion of the script that I 'think' controls this: ... Registered Linux User 283774 http://counter.li.org ...
    (perl.beginners)