Importing Collectd Metrics into Logscape using the Graphite Write plugin.

Logging and monitoring system health is a hot topic where operational engineers manage large server estates. There are many solutions out there that solve a piece of the puzzle of how the metrics are generated, where the metric data is stored and how it is then visualized.

Collectd Sensors

In this blog post we are going to take a look at Collectd and how to integrate this with Logscape. Collectd is an excellent monitoring backend for collecting operating system metrics. Collectd has around 90+ plugins including hardware sensors such as temperature and power usage. Metric data by itself is of little use unless you can visualize it in some way or fire alerts based on trends in the systems under supervision.

Selection_470

This table shows some of the available sensors being collected. There are abount 32 different sensors from 8 different hosts being imported in this environemnt. Here is dashboard of system health KPIs.

Selection_471

CPU Temperatures and Wattage metrics depend on the server hardware.

 | _type.equals(collectd-tcp) name.equals(temp) value.max(_host)

Selection_472

Importing Collectd Data Using the Graphite Plugin.

Collectd can export data over a network connection using the graphite plugin

The first step is to make sure that Logscape RawSocketServer service is running. To do this edit the boot.properties on the manager update the socket.port system property:

-Dsocketserver.port=$PORT

then restart the Manager. This will start the socket server on the specified port. Any data sent to that destination will be copied to disk.

Enable the Graphite Plugin

The write_graphite plugin has a configuration similar to this

LoadPlugin "write_graphite"
<Plugin "write_graphite">
 <Carbon>
   Host "localhost"
   Port "2003"
   #Prefix "collectd."
   #Postfix ""
   #Protocol "udp"
   EscapeCharacter "_"
   SeparateInstances true
   StoreRates false
   AlwaysAppendDS false
 </Carbon>
</Plugin>

Replace the Host and Port to match the settings of the Socket Server. Once this is done,restart the collectd service and data will be now be exported to Logscape.

Configure the Collectd Data Type

Collectd exports the data using a simple format of metric,value sets.

myhost_example_com.cpu-2.cpu-idle 98.6103 1329168255
myhost_example_com.cpu-2.cpu-nice 0 1329168255
myhost_example_com.cpu-2.cpu-user 0.800076 1329168255
myhost_example_com.cpu-2.cpu-wait 0.400054 1329168255

 

A Collectd data type has been provided which extracts the host, metric, metric type and value as separate fields. These fields are extracted at realtime.

Selection_473

 

Any data recevied by the SocketServer is imported by the socket-server data source and the Collectd type is assigned to the data. The next step will is to explore the data.

The next blog post in the Collectd series will look at other ways of importing Collectd data.