letThemCodeCake

Server Monitoring for Web Applications

by codejunkie on Mar.16, 2009, under Systems Management

I’ll be honest, I am a lot better at getting a project out of the door than maintaining it in the long run. I think this is a common problem for a lot of developers who are more interested in the creation than the sustainability of a project. However, I have also come to learn that, like it or not, I am going to have to do some level of system monitoring and management if I want to be able to fund those future projects. There is no point in creating an app that is going to fail the next day.

That being said, I decided to take a little time to look into the available resources out there for systems or server monitoring. While there are definitely quite a few solutions available, I needed to start on a budget. I deciced to go with Hyperic for myriad reasons, but here are just a few of them…

  1. It’s open source. Or, at least, there is a free open source version available to get me started. Frankly, I don’t have the time or money to waste on a closed-source app that might turn out not to serve my needs. More importantly, with companies going downhill fast, I didn’t want to get tied down by proprietary software which might not be updated if the company itself goes out of business. For me, this was a no brainer.
  2. Easy installation. I am not a sys admin. I am a programmer. I recognize the difference and I am not prepared to hire a sysadmin at this time. I needed something I could install, setup and deploy quickly. The open-source part of it alone made installation a lot quicker. I didn’t even need to speak with a service rep to get started.
  3. Scaling up. At some rapidly approaching point, I am going to have to get some professional help for these projects. Putting together my own solution would mean that I would have to train folks to get up to speed. Using Hyperic means I can just upgrade to their professional products and use their own existing support community.

I won’t pretend that Hyperic is the perfect solution for everyone. For example, I have to get the Enterprise edition for role-based access control and external authentication with LDAP - two things I am actually interested in eventually. However, compared to everything else available, this definitely made the most sense for my current projects and my projected growth. I definitely think that for systems management and server monitoring that Hyperic is the right choice.

Leave a Comment more...

Frustration

by Ian on May.03, 2007, under Learning Cakephp

Have you ever been stuck 10 - 20 miles out in the middle of nowwhere with a broken down car? Gas looks fine, temp. is fine. The engine turns but just not quite enough to start. You’re faced with a question. Walk the 20 miles which you know will get you where you’re going, or tinker with the car,which if you can get it working will get you there a whole lot faster.

That’s my experience with cake today. I’m still commited to using it. I’d like to help the community succeed, but the lack of significant documentation is crippling. Cake is great for the exact tasks that the tutorials outline, but after that it gets sketchy.

I’m working on a HasAndBelongsToMany (HABTM) article to try to explain how it works. It seems to only work when it wants to, and due to lack of documentation I can’t figure out when that is. I can’t find anything significant online at the moment, so I’ll be delving in to the code but if anyone would like to help or point a resource my way it’d be appreciated.

Thanks.

Leave a Comment more...

Javascript Helper pt. 2

by Ian on Apr.30, 2007, under Learning Cakephp

So I just read my last post about the javascript helper and I realized it makes little to no sense.
I was in a rush and just wanted to document the finding. Here’s a second try at explaining the js helper:

Using Javascript on your site.
1. Add the helper to the controller.

To use javascript in your cakephp site you need to first set the $helpers array in your controller to:
var $helpers = array('other_helper', 'javascript', 'other_helper');

You’ll probably be using other helpers already so just add the ‘javascript’ to the array.

2. Save your .js file under /app/webroot/js this is the conventional place to put all your js files and will make life easier for you if you use this directory.

3. Call your file from the template.

Since the call
needs to be in the header of your page and all of your view templates get inserted after the call of your layout template (/app/views/layouts/default.thtml) you’ll need to insert this line inside the section:

link(”myfile.js”);?>

If you only want to include this in one page or in a class of pages you can create another layout template and call that from your controller using the $layout variable or the
setLayout() function.

Iif you must use an externally located .js file you can use the function $javascript->linkOut($url);

4. Use your javascript.

Now instead of writing out function() $javascript->codeBlock("function();"); and that will insert the script tags for you.
As of yet I don’t have much experience with the javascript helper so here is a list of functions litterally copied and pasted out of the 1.1 Helper:Javascript code. I’ll write more as I use the helper more.

codeBlock
* Returns a JavaScript script tag.
*
* @param string $script The JavaScript to be wrapped in SCRIPT tags.
* @param boolean $allowCache Allows the script to be cached if non-event caching is active
* @return string The full SCRIPT element, with the JavaScript inside it.

escapeScript
* Escape carriage returns and single and double quotes for JavaScript segments.
*
* @param string $script string that might have javascript elements
* @return string escaped string

escapeString
* Escape a string to be JavaScript friendly.
*
* List of escaped ellements:
* + “\r\n” => ‘\n’
* + “\r” => ‘\n’
* + “\n” => ‘\n’
* + ‘”‘ => ‘\”‘
* + “‘” => “\\’”
*
* @param string $script String that needs to get escaped.
* @return string Escaped string.

event
* Attach an event to an element. Used with the Prototype library.
*
* @param string $object Object to be observed
* @param string $event event to observe
* @param string $observer function to call
* @param boolean $useCapture default true
* @return boolean true on success

cacheEvents
* Cache JavaScript events created with event()
*
* @param boolean $file If true, code will be written to a file
* @param boolean $all If true, all code written with JavascriptHelper will be sent to a file
* @return void

writeEvents
* Write cached JavaScript events
*
* @return string

object
* Generates a JavaScript object in JavaScript Object Notation (JSON)
* from an array
*
* @param array $data Data to be converted
* @param boolean $block Wraps return value in a