[WebDNA] 6.2 Monitor

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 108116
interpreted = N
texte = Hi All, Very rarely(once every couple months) I have WebDNA 6.2 stop, and drive the CPU nuts on Snow Leopard Server, and am looking at adding a script to keep an eye on it while I go on vacation. I found an old script... not sure where it come from or where I got it, but I had it on one of the old servers, and would like to get it working using launchd to start it, which isn't the problem. When I trigger the script, it comes up with "ps: No user named 'x'". Which is fairly obvious to those who no about these scripts, which I don't. So my question is, does anyone know how to get this working, or is there a better way? ... Script below. Rob #!/bin/sh ## Threshold of CPU % activity ## CPU_LIMIT=145; ## number of times in a row this threshold must be reached ## THRESHOLD=2; ## time between checks ## SLEEP_TIME=5; ## Other non user-edit stuff ## COUNTER=0; AGAIN=0; while true; do { LINE=`ps -aux | grep 'WebCatalog -m' | grep -v grep ` CPU=`echo $LINE | awk '{print int($3)}'` #echo "cpu "$CPU; #echo "n_times "$COUNTER; if [ $CPU -gt $CPU_LIMIT ]; then COUNTER=`expr $COUNTER + 1`; if [ $AGAIN -gt 0 ]; then # echo "again "$AGAIN; if [ $COUNTER -gt $THRESHOLD ]; then PID=`echo $LINE | awk '{print $2}'` date kill -9 $PID COUNTER=0; AGAIN=0; fi else ### [ AGAIN == 0 ] AGAIN=1; fi else ### [ $CPU lt $CPU_LIMIT ] AGAIN=0; COUNTER=0; fi sleep $SLEEP_TIME; } done Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] 6.2 Monitor (Kenneth Grome 2012)
  2. Re: [WebDNA] 6.2 Monitor (christophe.billiottet@webdna.us 2012)
  3. Re: [WebDNA] 6.2 Monitor (William DeVaul 2012)
  4. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  5. Re: [WebDNA] 6.2 Monitor (christophe.billiottet@webdna.us 2012)
  6. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  7. Re: [WebDNA] 6.2 Monitor (christophe.billiottet@webdna.us 2012)
  8. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  9. Re: [WebDNA] 6.2 Monitor (christophe.billiottet@webdna.us 2012)
  10. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  11. Re: [WebDNA] 6.2 Monitor (Donovan Brooke 2012)
  12. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  13. Re: [WebDNA] 6.2 Monitor (Donovan Brooke 2012)
  14. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  15. Re: [WebDNA] 6.2 Monitor (Donovan Brooke 2012)
  16. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  17. Re: [WebDNA] 6.2 Monitor (christophe.billiottet@webdna.us 2012)
  18. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  19. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  20. Re: [WebDNA] 6.2 Monitor (Donovan Brooke 2012)
  21. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  22. Re: [WebDNA] 6.2 Monitor (Kenneth Grome 2012)
  23. Re: [WebDNA] 6.2 Monitor (Donovan Brooke 2012)
  24. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  25. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  26. Re: [WebDNA] 6.2 Monitor (Robert Minor 2012)
  27. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  28. Re: [WebDNA] 6.2 Monitor (William DeVaul 2012)
  29. Re: [WebDNA] 6.2 Monitor (Rob 2012)
  30. Re: [WebDNA] 6.2 Monitor (Donovan Brooke 2012)
  31. [WebDNA] 6.2 Monitor (Rob 2012)
Hi All, Very rarely(once every couple months) I have WebDNA 6.2 stop, and drive the CPU nuts on Snow Leopard Server, and am looking at adding a script to keep an eye on it while I go on vacation. I found an old script... not sure where it come from or where I got it, but I had it on one of the old servers, and would like to get it working using launchd to start it, which isn't the problem. When I trigger the script, it comes up with "ps: No user named 'x'". Which is fairly obvious to those who no about these scripts, which I don't. So my question is, does anyone know how to get this working, or is there a better way? ... Script below. Rob #!/bin/sh ## Threshold of CPU % activity ## CPU_LIMIT=145; ## number of times in a row this threshold must be reached ## THRESHOLD=2; ## time between checks ## SLEEP_TIME=5; ## Other non user-edit stuff ## COUNTER=0; AGAIN=0; while true; do { LINE=`ps -aux | grep 'WebCatalog -m' | grep -v grep ` CPU=`echo $LINE | awk '{print int($3)}'` #echo "cpu "$CPU; #echo "n_times "$COUNTER; if [ $CPU -gt $CPU_LIMIT ]; then COUNTER=`expr $COUNTER + 1`; if [ $AGAIN -gt 0 ]; then # echo "again "$AGAIN; if [ $COUNTER -gt $THRESHOLD ]; then PID=`echo $LINE | awk '{print $2}'` date kill -9 $PID COUNTER=0; AGAIN=0; fi else ### [ AGAIN == 0 ] AGAIN=1; fi else ### [ $CPU lt $CPU_LIMIT ] AGAIN=0; COUNTER=0; fi sleep $SLEEP_TIME; } done Rob

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:

GD Scumbucket Spammer (2004) Weird Math and SV (1997) Updating checkboxes made easy !!! (1998) WebCatalog and Webstar 3.02 (1998) Searching an Email database (1997) Verifying both name and password (was: THANKS) (1997) japanese characters (1997) [WebDNA] Ubuntu 14.04 LTS / Apache 2.4 (2014) Charting records by state (2000) AAgghh!! Help, please. SSL strikes again. (1997) Signal Raised (1997) RE: WebCatalog2 for NT Beta Request (1997) Colors (2000) X etc.... (1999) Limiting user access to .tmpl files (1997) Smith Micro - no competition (2000) WebCat2b13MacPlugin - [math][date][/math] problem (1997) Banner DNA (1997) Replace context problem ... (1997) Extended [ConvertChars] (1997)