[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; fielse ### [ AGAIN == 0 ] AGAIN=1; fielse ### [ $CPU lt $CPU_LIMIT ] AGAIN=0; COUNTER=0; fisleep $SLEEP_TIME;}done
Associated Messages, from the most recent to the oldest:
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; fielse ### [ AGAIN == 0 ] AGAIN=1; fielse ### [ $CPU lt $CPU_LIMIT ] AGAIN=0; COUNTER=0; fisleep $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:
sort problems....bug or brain fart? (1997)
I'm new be kind (1997)
browser info.txt and SSL (1997)
Looking for a Manual (1997)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
Emailing html (1998)
Netscape Cache and Linux (2001)
HomePage Caution (1997)
WebCat odd log behavior (1998)
notification solutions (1997)
RE: Append problem w/" (1999)
Country & Ship-to address & other fields ? (1997)
Multi-User Security on *nix using mod_rewrite (2002)
Emailer (1997)
RAM crash (1998)
Not really WebCat - need HTML Grider (1997)
NT beta ReadMe missing (b12-b15) (1997)
PSC recommends what date format yr 2000??? (1997)
[WebDNA] New Upload Tool (2009)
Searching multiple Databases (1997)