Graphite Integration breaks ganglia/gmetad

gangliagraphitemonitoring

I'm trying to forward metrics from gmetad to graphite/carbon. After configuring carbon_server and ganglia_prefix in gmetad.conf gmetad starts losing metrics.

gmetad Version is 3.3.5, carbon/whisper/graphite-web is 0.9.8.

There is no I/O bottleneck on the system and no CPU bottleneck (HP DL385G7 with 2 SSDs in RAID0), I even configured another gmetad on a remote host to send metrics to graphite/carbon, which also broke down.

Does anyone else experience this?

Best Answer

Got that fixed with two small bash & perl scripts (dirty hack ahead)

g2g.pl

#!/usr/bin/perl 

use XML::Simple; 


$now = time;
$ref = XMLin("-");
$clustername = $ref->{"CLUSTER"}{"NAME"};
foreach (@{$ref->{"CLUSTER"}{"HOST"}}) {
    $hostname = $_->{"NAME"};
    $hostname =~ s/\./_/g;
    $hostname = "here.goes.my.prefix.".$clustername.".".$hostname; 
    foreach (@{$_->{"METRIC"}}) {
        print "$hostname".".".$_->{"NAME"}." ".$_->{"VAL"}." ".$now."\n";
    }
}

ganglia2graphite.sh

#!/bin/sh 

while true ; do 
    nc localhost 8649 | /usr/local/bin/g2g.pl | nc -q1  localhost 2003
done