|
Mailing Lists
|
Home /
Groups /
ColdFusion Linux (CF-Linux)
Bash script cfmonitor sh
I've already done this. My bash script does two things. It checks aWil Genovese 06/01/07 12:24 A Can I get a copy of this?Matthew Scalf 12/06/07 02:05 P On Jun 1, 2007 4:23 AM, Wil Genovese <juggler@visi.com> wrote:mac jordan 12/07/07 03:04 A All,Leon Oosterwijk 12/07/07 09:34 A Just so people know I am responding to requests and sending the scriptWil Genovese 12/07/07 12:27 P What would it take to get a copy of this script?Matthew Scalf 12/06/07 02:08 P I've already done this. My bash script does two things. It checks a specified URL for a certain string to see if CF is still responsive and it also calls a cf script which reports back an integer that is the amount of free JVM memory left. If a hang situation is detected the script will pause for a specified amount of time and try again. If the second attempt fails then it issues a restart command. I've also scripted a way to perform automatic stack dumps (it can even find the proper PID on it's own) when when a hang situation is detected. This way you can go into your logs and try to figure out what went wrong. If your JVM memory usage creeps up and is causing unresponsive behavior this script will also record the memory usage when memory reaches a threshold that you set. It can also restart CF if the low memory reaches a second threshold that you set. The script also logs everything into it's own log file in /var/logs/ so you can track actions taken by the script. The reason I wrote this was that when we migrated from CF5 to CFMX 7 the code base was so bad this was the only way to keep the server running. It took me months to track down all the bugs and bad queries to get the code stable. This is what can happen when there is no version control, ten years of development, hacking and re-hacking by so many different programmers that the owner can't name them all. Now we have SVN, good programmers and a bug hound (me). Email me and I can send you a generic copy. -- Wil Genovese (The Juggler) One man with courage makes a majority. -Andrew Jackson A fine is a tax for doing wrong. A tax is a fine for doing well. Can I get a copy of this? ----- Excess quoted text cut - see Original Post for more ----- On Jun 1, 2007 4:23 AM, Wil Genovese <juggler@visi.com> wrote: > I've already done this. My bash script does two things. It checks a > specified URL for a certain string to see if CF is still responsive and > it also calls a cf script which reports back an integer that is the > amount of free JVM memory left. > > Ooh - I'd love a copy of this! -- mac jordan www.webhorus.net www.nibblous.com www.photocena.com All, I don't have the script you asked for, but we also use a script to get the memory status of our jrun instances. we feed this into snmp which allows us to graph it over time using cacti. Here's the juicy part: <snip> #!/bin/bash tail -n 1 /opt/jrun4/logs/instancename-metrics.log | cut -d"=" -f 2,3 | perl -e' $input = <STDIN>; if ($input =~ m/.*?(\d+).+?(\d+).*/g) {print $1-$2 . "\n"; }' </snip> On Jun 1, 2007 4:23 AM, Wil Genovese <juggler@visi.com> wrote: > I've already done this. My bash script does two things. It checks a > specified URL for a certain string to see if CF is still responsive > and it also calls a cf script which reports back an integer that is > the amount of free JVM memory left. > > Ooh - I'd love a copy of this! -- mac jordan www.webhorus.net www.nibblous.com www.photocena.com Just so people know I am responding to requests and sending the script to peoples private emails as they ask. Also note that this is just for CFMX 7.0x and is tested with the standard server installation. Cheers, -- Wil Genovese One man with courage makes a majority. -Andrew Jackson A fine is a tax for doing wrong. A tax is a fine for doing well. What would it take to get a copy of this script?
|
May 23, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||