Re: Monitoring Script

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 69680
interpreted = N
texte = Jesse: What was the Uptime.tpl file doing? On 1/15/08 12:26 PM, "Jesse Proudman" wrote: > I have a shell script I wrote to monitor our WebDNA boxes. Seems to > work fairly well. Modify paths as needed: > > #!/bin/sh > > restartWebDNA() { > echo "WebDNA Dead... Restarting... Reset Count $restartCount" > > if [ "$restartCount" = "x" ]; then > cd /www/cgi-bin/WebCatalogEngine/ > killall WebCatalog > killall -9 WebCatalog > ./WebCatalog & > /dev/null > else > cd /www/cgi-bin/WebCatalogEngine/ > killall WebCatalog > sleep 1; > killall -9 WebCatalog > /www/bin/apachectl stop > sleep 1; > killall -9 httpd > /www/bin/apachectl start > ./WebCatalog & > /dev/null > fi > > restartCount=`expr $1 + 1` > sleepCount=`expr $restartCount \* 15` > > logFile=$(tail -n 40 /www/logs/access_log) > DNAlogFile=$(tail -n 100 /www/cgi-bin/WebCatalogEngine/WebDNA > \ -\ Commerce\ Edition.debug) > > # echo -e "$2\n\n$logFile\n\n$DNAlogFile" | /usr/sbin/sendmail > your@email.com > > sleep $sleepCount > } > > sleep 10 > while [ 1 ] > do > DNAoutput=$(curl -s --connect-timeout 45 -m 45 http://localhost/ > cgi-bin/WebCatalogEngine/Admin/Uptime.tpl) > if [ "$DNAoutput" = "Sorry WebDNA server not running. body>" ]; then > restartWebDNA $restartCount NOTRUNNING; > elif [ "$DNAoutput" = "" ]; then > restartWebDNA $restartCount NORESPONSE; > else > restartCount=0; > echo "WebDNA Running... $DNAoutput" > sleep .1 > fi > done > -- > > Jesse Proudman, Blue Box Group, LLC > > > > > On Jan 15, 2008, at 9:51 AM, Donovan Brooke wrote: > >> Clint Davis wrote: >>> Chris, >>> We've had several different developers writing WebDNA over the >>> last 8 years, >>> so the problem is most likely bad code. I just don't want to take >>> the time >>> to comb through 75 sites to find the bad code when it's going to be >>> completely re-written in PHP very soon. >> >> >> well then, go over to the linux forums and have them write a shell >> script for you? >> >> >> Donovan ------------------------------------------------------------- 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://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Monitoring Script ( Pat McCormick 2008)
  2. Re: Monitoring Script ( Jesse Proudman 2008)
  3. Re: Monitoring Script ( Clint Davis 2008)
  4. Re: Monitoring Script ( Clint Davis 2008)
  5. Re: Monitoring Script ( Jesse Proudman 2008)
  6. Re: Monitoring Script ( Donovan Brooke 2008)
  7. Re: Monitoring Script ( Clint Davis 2008)
  8. Re: Monitoring Script ( Chris 2008)
  9. Monitoring Script ( Clint Davis 2008)
Jesse: What was the Uptime.tpl file doing? On 1/15/08 12:26 PM, "Jesse Proudman" wrote: > I have a shell script I wrote to monitor our WebDNA boxes. Seems to > work fairly well. Modify paths as needed: > > #!/bin/sh > > restartWebDNA() { > echo "WebDNA Dead... Restarting... Reset Count $restartCount" > > if [ "$restartCount" = "x" ]; then > cd /www/cgi-bin/WebCatalogEngine/ > killall WebCatalog > killall -9 WebCatalog > ./WebCatalog & > /dev/null > else > cd /www/cgi-bin/WebCatalogEngine/ > killall WebCatalog > sleep 1; > killall -9 WebCatalog > /www/bin/apachectl stop > sleep 1; > killall -9 httpd > /www/bin/apachectl start > ./WebCatalog & > /dev/null > fi > > restartCount=`expr $1 + 1` > sleepCount=`expr $restartCount \* 15` > > logFile=$(tail -n 40 /www/logs/access_log) > DNAlogFile=$(tail -n 100 /www/cgi-bin/WebCatalogEngine/WebDNA > \ -\ Commerce\ Edition.debug) > > # echo -e "$2\n\n$logFile\n\n$DNAlogFile" | /usr/sbin/sendmail > your@email.com > > sleep $sleepCount > } > > sleep 10 > while [ 1 ] > do > DNAoutput=$(curl -s --connect-timeout 45 -m 45 http://localhost/ > cgi-bin/WebCatalogEngine/Admin/Uptime.tpl) > if [ "$DNAoutput" = "Sorry WebDNA server not running. body>" ]; then > restartWebDNA $restartCount NOTRUNNING; > elif [ "$DNAoutput" = "" ]; then > restartWebDNA $restartCount NORESPONSE; > else > restartCount=0; > echo "WebDNA Running... $DNAoutput" > sleep .1 > fi > done > -- > > Jesse Proudman, Blue Box Group, LLC > > > > > On Jan 15, 2008, at 9:51 AM, Donovan Brooke wrote: > >> Clint Davis wrote: >>> Chris, >>> We've had several different developers writing WebDNA over the >>> last 8 years, >>> so the problem is most likely bad code. I just don't want to take >>> the time >>> to comb through 75 sites to find the bad code when it's going to be >>> completely re-written in PHP very soon. >> >> >> well then, go over to the linux forums and have them write a shell >> script for you? >> >> >> Donovan ------------------------------------------------------------- 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://webdna.smithmicro.com/ Clint Davis

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 on Windows Beta 18 (1997) Client-side Image Maps and WebCat? (1998) [isfile] ? (1997) Running 2 two WebCatalog.acgi's (1996) multi-paragraph fields (1997) [WebDNA] Problem saving returned value as a variable (2012) [setcookie] (2001) Uploading out of FMP (2001) New WebDNA Example from Olin -- (1998) OT: Please set your computer's clock (1997) Odd error in logs (1998) [WebDNA] Auto Suggest Form (2014) can you take a look (2003) Re2: AAgghh!! Help, please. SSL strikes again. (1997) Online Docs? (1997) Bug or syntax error on my part? (1997) [WebDNA] lists opinion - [listwords] delimiter change (2009) Protecting Images (2003) Problems setting MIME Headers (1998) [OT] MacWorld Expo (2004)