Re: need a program to email me when service stops



Hey Gilbert,

Have you tried copying:
--------------
@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%"
--------------

Modify the above and save it as send.bat. does it work? (And make sure that you have blat.exe in the correct directory.

--
Jabez Gan [MVP]
Microsoft MVP: Windows Server
http://www.blizhosting.com
MSBLOG: http://www.msblog.org

"Gilbert" <Gilbert@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:F161CED2-2282-4CC2-89B0-7C036BAEAE3F@xxxxxxxxxxxxxxxx
No, not really, it's a little overkill for what I'm trying to do. I'm just
trying to monitor 1 service on 1 server, nothing else.

I found another person posted something about Blat.exe but it's very
confusing on how to use. It's basically a batch file that you create.
Here's what they said:

"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."

I am confused on how to use it. Should I create a test.bat file with the 4
lines and then run blat.exe ??? I tried that but it didn't work. I also
tried to include all of the lines in 1 batch file but that didn't work
either.


"Chris" wrote:

Maybe something like this?

http://www.programurl.com/servicekeeper.htm

"Gilbert" wrote:

> I have a Windows service that stops every few weeks. I'd like to be > notified
> by e-mail whenever that service stops. If I go to Services.msc and go > to the
> Properties of that service, I have the option of selecting "Run this > program
> on 1st failure".
>
> Basically, all I need is a basic batch file that runs some commands to > send
> me an email. We have an internal Exchange server I can use for SMTP > relay.
>
> I think this should be pretty simple to do.
>
> Any ideas?

.



Relevant Pages

  • Re: Access Denied Error -- Reading Text File in .BAT program
    ... without seeing the whole batch file I am unable to offer any further ... echo Start %date% %TimeMarker%>> c:\test.txt ... on the server console. ... It is strange the file disappears completely after using the NET FILE ...
    (microsoft.public.scripting.wsh)
  • Re: Access Denied Error -- Reading Text File in .BAT program
    ... - Add three statements to the batch file, two at the start, one at the ... echo Start %date% %TimeMarker%>> c:\test.txt ... on the server console. ... It is strange the file disappears completely after using the NET FILE ...
    (microsoft.public.scripting.wsh)
  • Re: Access Denied Error -- Reading Text File in .BAT program
    ... Since you can't post the whole batch file, I can only offer some hints: ... echo Start %date% %TimeMarker%>> c:\test.txt ... on the server console. ... It is strange the file disappears completely after using the NET FILE ...
    (microsoft.public.scripting.wsh)
  • Re: How to backup files using original extension
    ... The Server stays on 24/7 ... @echo off ... REM Backup to Server script ... this as a batch file that runs a few times a day via task scheduler. ...
    (microsoft.public.win2000.general)
  • Re: SPBackup utility failing
    ... generates a batch file that, when run on a server running Windows SharePoint ... backs up changed site collections using the Stsadm.exe tool. ... >> Mike Walsh, Helsinki, Finland ...
    (microsoft.public.sharepoint.windowsservices)

Loading