Re: Auto-email upon restart?
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 38515
interpreted = N
texte = >On 9/7/01 7:47 PM, Kenneth Grome
wrote:>>> WebCat does not offer an option to activate a trigger automatically>> when the program is restarted. Does anyone have an idea (or>> existing code) for how to make this happen? I simply want to receive>> an email message when webcat is restarted ... but I do not want to>> receive this message at any other time.>>>My winNT runs all the daily triggers whenever the machine starts up.>In fact I had to set things up so that it ignored everytime webcat crashed>and restarted itself. I was getting 3-5 crashes everyday and it would run>specialized routines that should have only run at 1 in the morning.>>You could set the trigger to run at 1:01 and then do a hideif [time] is>between 101 and 103. Its not perfect, but, its within 3 minutes a day.Thanks for the ideas, Bob. Given the fact that triggers should execute on time -- within the second -- the following code seems like it should work with a trigger set to run at 00:00:01 am every day (* * * 0 0 1). This code increases the precision of the messages being sent to a range of about 3 seconds.When webcat's trigger system sends a request for this file at 00:00:01, the first set of showif's allow the nested sendmail message to be sent, because the time is between 00:00:00 and 00:00:03. At the same time, the second set of showif's prevent the second message from being sent.But when this file is requested by a restart of webcat -- at any time except the few seconds during which the trigger requests this file -- the second message will be sent and the first one will not.This is just what I need: a system that tells me every day that the trigger is still working, and when the server is restarted at a time that's not within a few seconds of the trigger time, I will receive a different message telling me exactly when the server was restarted.Presumably the only time this solution will not work perfectly is when webcat is restarted during the few seconds between 00:00:00 and 00:00:03, because at this time it will not send me a 'server restart' message. But my need is not so critical that I have to be concerned about those few seconds.[showif [time]>00:00:00][showif [time]<00:00:03][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Daily trigger activated at [time] --> emailOnRestart]This message confirms that the trigger I refer to as emailOnRestart is actually working every day like it is supposed to.[/sendmail][/showif][/showif][showif [time]<23:59:59][showif [time]>00:00:02][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Server restarted at [time]]This message confirms that the server has restarted at some time of the day which does not fall between 00:00:00 and 00:00:03.[/sendmail][/showif][/showif]----------------------------------------------------Kenneth Grome & Associatesweb: http://kengrome.comemail: owner@kengrome.commobile: +63 917 254-1494office: +63 32 262-8164-----------------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>On 9/7/01 7:47 PM, Kenneth Grome wrote:>>> WebCat does not offer an option to activate a trigger automatically>> when the program is restarted. Does anyone have an idea (or>> existing code) for how to make this happen? I simply want to receive>> an email message when webcat is restarted ... but I do not want to>> receive this message at any other time.>>>My winNT runs all the daily triggers whenever the machine starts up.>In fact I had to set things up so that it ignored everytime webcat crashed>and restarted itself. I was getting 3-5 crashes everyday and it would run>specialized routines that should have only run at 1 in the morning.>>You could set the trigger to run at 1:01 and then do a hideif [time] is>between 101 and 103. Its not perfect, but, its within 3 minutes a day.Thanks for the ideas, Bob. Given the fact that triggers should execute on time -- within the second -- the following code seems like it should work with a trigger set to run at 00:00:01 am every day (* * * 0 0 1). This code increases the precision of the messages being sent to a range of about 3 seconds.When webcat's trigger system sends a request for this file at 00:00:01, the first set of showif's allow the nested sendmail message to be sent, because the time is between 00:00:00 and 00:00:03. At the same time, the second set of showif's prevent the second message from being sent.But when this file is requested by a restart of webcat -- at any time except the few seconds during which the trigger requests this file -- the second message will be sent and the first one will not.This is just what I need: a system that tells me every day that the trigger is still working, and when the server is restarted at a time that's not within a few seconds of the trigger time, I will receive a different message telling me exactly when the server was restarted.Presumably the only time this solution will not work perfectly is when webcat is restarted during the few seconds between 00:00:00 and 00:00:03, because at this time it will not send me a 'server restart' message. But my need is not so critical that I have to be concerned about those few seconds.[showif [time]>00:00:00][showif [time]<00:00:03][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Daily trigger activated at [time] --> emailOnRestart]This message confirms that the trigger I refer to as emailOnRestart is actually working every day like it is supposed to.[/sendmail][/showif][/showif][showif [time]<23:59:59][showif [time]>00:00:02][sendmail to=owner@kengrome.com&from=Ken's Server&subject=Server restarted at [time]]This message confirms that the server has restarted at some time of the day which does not fall between 00:00:00 and 00:00:03.[/sendmail][/showif][/showif]----------------------------------------------------Kenneth Grome & Associatesweb: http://kengrome.comemail: owner@kengrome.commobile: +63 917 254-1494office: +63 32 262-8164-----------------------------------------------------------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
emailer (1997)
Trouble with [Math] (1998)
[LOOKUP] (1997)
UPS Online (2002)
Is there a way......... (2000)
Username/Password with [Protect] (2000)
Banners and sort of random display (1997)
Can't load tmpl files (1997)
[WebDNA] Google Maps (2019)
Tip: upgrading to WebCatalog 3.x, fields to watch for (1999)
encrypt (2000)
Error Lob.db records error message not name (1997)
Quit revisited (1997)
NetSplat and WebCat2 (1997)
Automated FTP from Shell (2004)
shownext (2001)
can WC render sites out? (1997)
Bug or syntax error on my part? (1997)
all records returned. (1997)
Some Questions (1997)