House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Linux (CF-Linux)

Bash script cfmonitor sh

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Wil Genovese
06/01/2007 12:24 AM

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.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
mac jordan
12/07/2007 03:04 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Leon Oosterwijk
12/07/2007 09:34 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Wil Genovese
12/07/2007 12:27 PM

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.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matthew Scalf
12/06/2007 02:08 PM

What would it take to get a copy of this script?


<< Previous Thread Today's Threads Next Thread >>

Search cf-linux

May 23, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference