= Ganglia Component
:doctitle: Ganglia
:shortname: ganglia
:artifactid: camel-ganglia
:description: Send metrics to Ganglia monitoring system.
:since: 2.15
:supportlevel: Stable
:component-header: Only producer is supported
//Manually maintained attributes
:camel-spring-boot-name: ganglia

*Since Camel {since}*

*{component-header}*

Provides a mechanism to send a value (the message body) as a metric to
the http://ganglia.info[Ganglia] monitoring system.  Uses the gmetric4j
library.  Can be used in conjunction with standard
http://ganglia.info[Ganglia] and
https://github.com/ganglia/jmxetric[JMXetric] for monitoring metrics
from the OS, JVM and business processes through a single platform.

You should have a Ganglia gmond agent running on the machine where your
JVM runs.  The gmond sends a heartbeat to the Ganglia infrastructure,
camel-ganglia can't send the heartbeat itself currently.

On most Linux systems (Debian, Ubuntu, Fedora and RHEL/CentOS with EPEL)
you can just install the Ganglia agent package and it runs automatically
using multicast configuration.  You can configure it to use regular UDP
unicast if you prefer.

== URI format

----
ganglia:address:port[?options]
----

// component-configure options: START

// component-configure options: END

// component options: START
include::partial$component-configure-options.adoc[]
include::partial$component-endpoint-options.adoc[]
// component options: END

// endpoint options: START

// endpoint options: END


== Message body

Any value (such as a string or numeric type) in the body is sent to the
Ganglia system.

== Return value / response

Ganglia sends metrics using unidirectional UDP or multicast.  There is
no response or change to the message body.

== Examples

=== Sending a String metric

The message body will be converted to a String and sent as a metric
value.  Unlike numeric metrics, String values can't be charted but
Ganglia makes them available for reporting.  The os_version string at
the top of every Ganglia host page is an example of a String metric.

[source,java]
----
from("direct:string.for.ganglia")
    .setHeader(GangliaConstants.METRIC_NAME, simple("my_string_metric"))
    .setHeader(GangliaConstants.METRIC_TYPE, GMetricType.STRING)
    .to("direct:ganglia.tx");

from("direct:ganglia.tx")
    .to("ganglia:239.2.11.71:8649?mode=MULTICAST&prefix=test");
----

=== Sending a numeric metric

[source,java]
----
from("direct:value.for.ganglia")
    .setHeader(GangliaConstants.METRIC_NAME, simple("widgets_in_stock"))
    .setHeader(GangliaConstants.METRIC_TYPE, GMetricType.UINT32)
    .setHeader(GangliaConstants.METRIC_UNITS, simple("widgets"))
    .to("direct:ganglia.tx");

from("direct:ganglia.tx")
    .to("ganglia:239.2.11.71:8649?mode=MULTICAST&prefix=test");
----


include::spring-boot:partial$starter.adoc[]
