Local Graphite installation on CentOS 5.5 howto

Feature request Our client called:- “I want something to monitor my application!”- “Ok, let’s use JMX, we have plenty of stats exposed there already.”- “Fine, but I want something fancy!”- “Ok, let’s install Graphite, take a look at screenshots!”- “Exc…

Feature request

Our client called:
– “I want something to monitor my application!”
– “Ok, let’s use JMX, we have plenty of stats exposed there already.”
– “Fine, but I want something fancy!”
– “Ok, let’s install Graphite, take a look at screenshots!”
– “Excellent! Use our testing CentOS machine for this.”
– “Ok, erm… wait, nooooo! We have no root access there, there is no internet access and we can’t install anything!!!”
– “(hangup click)”

Setup

There I was, standing alone, looking for help…

My scenario: * no internet access * only user account, no root account * gcc and make installed * some libraries missing * no development packages for installed libraries

    My goals:

  • install libraries to $HOME
  • install Graphite and stuff to $HOME/graphite

Solution

It took me a few days, but I’ve managed to install Graphite locally. Here is a gist for a sake of documentation and for others that may need it.

<a href="https://gist.github.com/SpOOnman/5957589">https://gist.github.com/SpOOnman/5957589</a>
You May Also Like

Grails render as JSON catch

One of a reasons your controller doesn't render a proper response in JSON format might be wrong package name that you use. It is easy to overlook. Import are on top of a file, you look at your code and everything seems to be fine. Except response is still not in JSON format.

Consider this simple controller:

class RestJsonCatchController {
def grailsJson() {
render([first: 'foo', second: 5] as grails.converters.JSON)
}

def netSfJson() {
render([first: 'foo', second: 5] as net.sf.json.JSON)
}
}

And now, with finger crossed... We have a winner!

$ curl localhost:8080/example/restJsonCatch/grailsJson
{"first":"foo","second":5}
$ curl localhost:8080/example/restJsonCatch/netSfJson
{first=foo, second=5}

As you can see only grails.converters.JSON converts your response to JSON format. There is no such converter for net.sf.json.JSON, so Grails has no converter to apply and it renders Map normally.

Conclusion: always carefully look at your imports if you're working with JSON in Grails!

Edit: Burt suggested that this is a bug. I've submitted JIRA issue here: GRAILS-9622 render as class that is not a codec should throw exception