• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    Perl
  • Created over 13 years ago
  • Updated about 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

collectd plugin for sending data to graphite

IMPORTANT!!! Collectd 5.1+ comes with a C-based graphite plugin. I would recommend using that as it will be maintained going forward as part of collectd. More info here: http://collectd.org/wiki/index.php/Plugin:Write_Graphite

Collectd-Graphite Plugin

This plugin acts as bridge between collectd's huge base of available plugins and graphite's excellent graphing capabilities. It sends collectd data directly to your graphite server.

It is implemented using the collectd-perl interface.

This plugin was inspired by the great collectd-to-graphite tool written by the prolific engineer Jordan Sissel at Loggly. Jordan's implementation uses an external process to bridge collectd to graphite. I did not want another process to manage or worry about, so I wrote a plugin for collectd instead.

REQUIREMENTS

Because the plugin requires the Globals option to be set to true, you will need at least version 4.9 of collectd. If you are using an older version, you'll have to compile with global visibility of symbols.

As of version 3, the plugin should work fine with collectd 5.0 as well.

This is the command to compile collectd with global visibility symbols:

./configure CFLAGS="-DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'"
make all install

INSTALLATION

Make sure collectd and the collectd-perl module are installed.

This was tested on CentOS 5 using the "collectd-4.10" and "perl-Collectd-4.10" rpm's from the EPEL yum repo.

Feedback on installing on other platforms is welcome.

To install this module, run the following commands:

perl Makefile.PL
make
make test
make install

Collectd 4.10.3 on RHEL5 / CentOS 5 errors

( Thanks to https://github.com/indygreg/collectd-carbon for this info which also affects collectd perl plugins. )

Using the plugin with collectd-4.10.3 from EPEL5 on RHEL or CentOS 5.x may produce the following error:

# /etc/init.d/collectd start
Starting collectd: plugin_load_file: The global flag is not supported, libtool 2 is required for this.
perl: Initializing Perl interpreter...
Can't load '/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/threads/threads.so' for module threads: /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/threads/threads.so: undefined symbol: PL_no_mem at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
 at /usr/lib/perl5/vendor_perl/5.8.8/Collectd.pm line 27
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Collectd.pm line 27.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Collectd.pm line 27.
Compilation failed in require.
BEGIN failed--compilation aborted.
perl: init_pi: Unable to bootstrap Collectd: Can't load '/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/threads/threads.so' for module threads: /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/threads/threads.so: undefined symbol: PL_no_mem at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
 at /usr/lib/perl5/vendor_perl/5.8.8/Collectd.pm line 27
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Collectd.pm line 27.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Collectd.pm line 27.
Compilation failed in require.
BEGIN failed--compilation aborted
perl: Configuration failed with a fatal error - plugin disabled!

This may also occur on other operating systems. It is caused by a libtool/libltdl quirk described in this mailing list thread. As per the workarounds detailed there, you may either:

  1. Modify the init script.

    @@ -25,7 +25,7 @@
            echo -n $"Starting $prog: "
            if [ -r "$CONFIG" ]
            then
    -               daemon /usr/sbin/collectd -C "$CONFIG"
    +               LD_PRELOAD=/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so daemon /usr/sbin/collectd -C "$CONFIG"
                    RETVAL=$?
                    echo
                    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
    
  2. Modify the RPM and rebuild.

    @@ -182,7 +182,7 @@
    
    
     %build
    -%configure \
    +%configure CFLAGS=-"DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'" \
         --disable-static \
         --disable-ascent \
         --disable-apple_sensors \
    

CONFIGURATION

Add the following to your collectd.conf:

<LoadPlugin "perl">
	Globals true
</LoadPlugin>

<Plugin "perl">
  BaseName "Collectd::Plugins"
  LoadPlugin "Graphite"

	<Plugin "Graphite">
	  Buffer "256000"
	  Prefix "servers"
	  Host   "graphite.example.com"
	  Port   "2003"
	</Plugin>
</Plugin>

NETWORK TRAFFIC

Metrics are stored in an 8KB buffer before being sent to graphite in order to take reduce network overhead. The buffer size is configurable in the config file.

Data is sent to graphite on a "best effort" basis. If the graphite server is down or the tcp connection fails, you will lose that buffer's worth of data.

GRAPHITE PATHS

Graphite paths are constructed according to Collectd's standard serialized form, eg:

prefix.host_name.plugin[-plugin_instance].type[-type_instance].metric_name

Examples of valid paths:

collectd.host1_example_com.cpu-0.cpu-idle.value
collectd.host2_example_com.disk-sda.disk_octets.read
collectd.host3_example_com.load.load.shortterm
collectd.host3_example_com.interface.if_octets-eth0.rx

The default prefix is 'collectd'. This can be changed in the collectd config file.

See here for more information on collectd plugin naming:

http://collectd.org/wiki/index.php/Naming_schema#Plugin_instance_and_type_instance

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the perldoc command.

perldoc Collectd::Plugins::Graphite

You can also look for information on the github page:

https://github.com/joemiller/collectd-graphite

Please use the github issues page for bugs and feedback. Pull requests are also welcome!

https://github.com/joemiller/collectd-graphite/issues

You can also check the syslog (/var/log/syslog) where the plugin will log any unsuccessful attempts to connect to your Graphite server.

Changelog

See the Changes file.

FUTURE?

  • write tests!!
  • Support sending data to graphite via AMQP
  • Re-write in C if collectd-perl interface proves problematic

LICENSE AND COPYRIGHT

Copyright 2011 Joe Miller.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

creds

[DEPRECATED] Simple local encrypted credential management with GPG 🔐
Shell
124
star
2

vault-token-helper

@Hashicorp Vault Token Helper for macOS, Linux and Windows with support for secure token storage and multiple Vault servers 🔐
Go
104
star
3

bunchr

A Ruby/Rake DSL for building and packaging software into omnibus-style packages
Ruby
86
star
4

dns_compare

Testing tool for DNS migrations. Compare data from a BIND zone file to data returned by a DNS server.
Python
61
star
5

puppet-graphite_event

A puppet report processor for sending event data to graphite whenever puppet modifies a resource on a host.
Ruby
38
star
6

puppet-newrelic

puppet module for installing the New Relic server monitor
Puppet
33
star
7

chef-handler-profiler

a simple Chef profiler for reporting how long each recipe took to execute
Ruby
32
star
8

git-flux

a Git workflow designed with "infrastructure as code repositories" in mind (EXPERIMENTAL!)
Shell
32
star
9

amqpcat

Netcat-like tool for reading and writing messages to AMQP message brokers
Ruby
30
star
10

spark-ping

a ping "GUI" for the command line that prints sparkline graphs
Ruby
30
star
11

jenkins-statsd-plugin

send results and durations from jenkins jobs to a statsd server
Java
29
star
12

go-init-sentinel

A minimal init system for containers capable of watching files for changes and sending signals for reload, shutdown, etc
Go
22
star
13

docker-htpc

my dockerized htpc apps
Shell
20
star
14

workstation-bootstrap

chef-solo recipes for bootstrapping my mac osx workstations
Ruby
20
star
15

yk-attest-verify

Verify and assert policy on YubiKey attestation certificates
Go
17
star
16

docker-tail

A pretty tail -f for docker logs from multiple containers
Shell
17
star
17

dotfiles

my dotfiles
Shell
16
star
18

gitosis-ng

Yet another gitosis fork with some new features allowing admins and users to manage the repos via simple commands (no longer active, use gitolite instead!!!)
Python
15
star
19

aws-cf-private-streaming-tools

Ruby CLI tools for creating and modifying Amazon Cloudfront Private Streaming Distrubitions and Origin-Access-IDs
Ruby
15
star
20

chef-openbsd

Chef LWRPs (package, service) for OpenBSD
Ruby
14
star
21

hudson_wrapper

Shell script for wrapping External Hudson jobs (eg: cron jobs) and posting their results to Hudson
Shell
12
star
22

kubits

a collection of small utilities for working with kubernetes clusters
Shell
11
star
23

certin

Go lib (and CLI) for quick creation of TLS keys and certificates for use in tests
Go
10
star
24

joemiller.me-intro-to-sensu

files related to 'intro to sensu' article on joemiller.me
Shell
10
star
25

taskhammer

Hammerspoon module ("Spoon") for running scripts from the macOS menu bar
Lua
6
star
26

sensu-tests

Integration test suite for Sensu CM and packages
Ruby
6
star
27

mac-to-vendor

Simple, curl'able service for resolving MAC addresses to vendor names
Ruby
6
star
28

xbmc-script-sort-movies-by-file-date

XBMC addon for sorting your Movie Library by the creation date from the movie files
Python
6
star
29

vault-gpg-token-helper

[DEPRECATED. See joemiller/vault-token-helper instead] 🗝A @hashicorp Vault token helper for encrypting tokens with GPG (+ yubikey)
Go
6
star
30

twitter-tools-wordpress

twitter-tools plugin for wordpress (this fork adds support for native Retweets)
PHP
5
star
31

gbookmarks-to-delicious

simple script to help import Google Bookmark's into Del.icio.us, including _all_ tag data
Ruby
4
star
32

vault-gcp-cloud-kms-pki

Fork of the Vault PKI Secrets plugin with support for CA keys backed by Google Cloud KMS
Go
4
star
33

groovy-statsdclient

A statsd client written in groovy
Groovy
4
star
34

bats-chef-handler

Similar to minitest-chef-handler, find and execute BATS tests at the end of a chef run. http://joemiller.me
Ruby
3
star
35

sensu-cli

command-line interface to the Sensu REST API
Ruby
3
star
36

chef-sensu_repo

chef recipes for managing sensu apt and yum repos
Ruby
3
star
37

go-jail

[experiment] simple wrapper for executing sandboxed processes using Seccomp and capabilities filters
Go
2
star
38

git-hooks

various git hooks
2
star
39

logstash-filter-hex_to_ascii

logstash plugin for converting hex-encoded ascii strings back to ascii (eg: auditd logs)
Ruby
2
star
40

goreleaser-gon-poc

experiment using goreleaser with gon for codesigning and notarizing macOS Go apps
HCL
2
star
41

dugar

Get the total size of images in a Google Artifact Registry docker repository.
Go
2
star
42

chef-vagrant

chef cookbook for installing vagrant and virtualbox
Ruby
1
star
43

openvpn-notifier

send pushover.net notification when openvpn clients connect
Go
1
star
44

simple-uptime-checker

WIP. simple http uptime checker experiment, implemented as aws lambdas
HCL
1
star
45

sinatra-template

a simple template for sinatra apps that I like to use. Your mileage may vary.
Ruby
1
star
46

chef-sensu_jenkins

chef recipes for managing sensu jenkins build/test server
Ruby
1
star
47

sensu-build-box

scripts for managing sensu build/CI box via chef-solo
Ruby
1
star
48

gcp-iam-lookup

Search Google Cloud IAM roles that contain specific permissions.
Go
1
star
49

prefixed-api-key

Go implementation of seamapi/prefixed-api-key
Go
1
star
50

r509-validity-cadb

A Validity::Checker for r509, implemented with an OpenSSL CA DB loader backend
Ruby
1
star
51

puppet-url-functions

custom functions for manipulating URLs in puppet manifests and templates
Ruby
1
star
52

suicide-sidecar

kubernetes sidecar to watch for file changes (such as secretVolumes) and trigger pod restarts
Shell
1
star
53

thin-benchmarks

some benchmarks with thin and sinatra
Shell
1
star
54

blog

blog source (hugo)
CSS
1
star
55

openssh-u2f

openssh docker image built with U2F support for testing out the new key type
Dockerfile
1
star