文档章节

Enabling (Almost All) Collectd Plugins on CentOS 6

一号男嘉宾
 一号男嘉宾
发布于 2016/10/08 13:52
字数 927
阅读 56
收藏 0
点赞 0
评论 0

Introduction

There are a variety of ways to extract system resource information from a Linux server. Some of these utilities are triggered by cron, such as sysstat, while others are based on a predefined check interval, such as Nagios. Others are meant to be used interactively, such as htop or vmstat.

collectd is another utility that gathers system metrics on a given system. It is written in C, giving it great performance. Its versatility, however, comes from the almost 100 plugins that is bundled with the daemon. These plugins include various read and write plugins. Some of the read plugins collect the standard Linux subsystem metrics, such as CPU, Disk, Memory and Network, while other read plugins are more specialized, such as reading Apache httpd or DNS metrics.

collectd gathers these metrics, but where are they stored? collectd has a handful of write plugins that allow you either store the metrics in local round-robin databases (RRDs) or externally to another collector, such as Graphite.

The collectd package in the EPEL 6 repository package is out of date. Often, users opt to compile collectd from source to obtain a newer, more recent version. The process of compiling collectd can be somewhat daunting at times because the more plugins that are available, the more dependencies are necessary.

The goal of this guide is to list the necessary packages for building collectd from source with most of the plugins enabled. These dependencies can all be found in the CentOS Base and EPEL repositories.

 

Prerequisites

Compiling any package from source requires a compiler. If you don't already have one installed, go ahead and install the GNU GCC compiler:

sudo yum install gcc

For this exercise, you will also need kernel and the C library header files:

sudo yum install kernel-headers glibc-headers

 

Downloading collectd

A link to the collectd source is hosted on the main page of the collectd website. Download and untar the the latest source tarball. At the time of this writing, version 5.5.0 is the latest stable version.

curl --progress https://collectd.org/files/collectd-5.5.0.tar.gz | tar xz

 

Configuring collectd

After downloading and extracting the source files, change to that directory:

cd collectd-5.5.0

This package can be configured, built and installed with the typical configure && make && make install sequence of commands.

Start by running the configure step so that we can have a look at the available plugins:

./configure

This command will output quite a bit to the screen, checking your system for the presence of various libraries, header files and binaries in the process. Have a look at the summary at the end, for example:

Configuration:
  Libraries:
    intel mic . . . . . . no (MicAccessApi not found)
    libaquaero5 . . . . . no (libaquaero5.h not found)
    libatasmart . . . . . no (atasmart.h not found)
    libcurl . . . . . . . no (curl-config failed)
    libdbi  . . . . . . . no (dbi/dbi.h not found)
    libesmtp  . . . . . . no (libesmtp not found)
    libganglia  . . . . . no (gm_protocol.h not found)
[...output truncated...]
  Modules:
    aggregation . . . . . yes
    amqp    . . . . . . . no
    apache  . . . . . . . no
    apcups  . . . . . . . yes
    apple_sensors . . . . no
    aquaero . . . . . . . no
    ascent  . . . . . . . no
    barometer . . . . . . no
[...output truncated...]

The summary at the end shows the various plugins and whether or not the configure step was able to locate the necessary prerequisites to build each plugin.

Even though the configure step was not able to find many libraries or modules, collectd will still compile successfully, albeit without these plugins. Often, you would like to enable several plugins at compile time, for example:

./configure --enable-java --enable-python

Without the appropriate package dependencies installed, the configure step will output the following line at the very end:

configure: error: "Some plugins are missing dependencies - see the summary
above for details"

Use the two tables below to install the appropriate RPM packages for the plugins you would like to enable.

 

Libaries

The following table shows the collectd libraries and their corresponding RPM package dependencies:

Library RPM Package(s)
libatasmart libatasmart-devel
libcurl libcurl-devel
libdbi libdbi-devel
libesmtp libesmtp-devel
libganglia ganglia-devel
libgcrypt libgcrypt-devel
libhal hal-devel
libhiredis hiredis-devel
libiptc iptables-devel
libjvm java-1.8.0-openjdk-devel
libldap openldap-devel
liblvm2app lvm2-devel
libmemcached libmemcached-devel
libmnl libmnl-devel
libmodbus libmodbus-devel
libmysql mysql-devel
libnetsnmp net-snmp-devel
libnotify libnotify-devel
libopenipmi OpenIPMI-devel
liboping liboping-devel
libpcap libpcap-devel
libperl perl-devel, perl-ExtUtils-Embed
libpq postgresql-devel
librabbitmq librabbitmq-devel
librrd rrdtool-devel
libsensors lm_sensors-devel
libstatgrab libstatgrab-devel
libudev libudev-devel
libupsclient nut-devel
libvarnish varnish-libs-devel
libvirt libvirt-devel
libxml2 libxml2-devel
libyajl yajl-devel
protobuf-c protobuf-c-devel
python python-devel

 

Modules

The following table shows the collectd modules and their corresponding RPM package dependencies:

Module RPM Package(s)
amqp librabbitmq-devel
apache libcurl-devel
bind libcurl-devel, libxml2-devel
ceph yajl-devel
curl libcurl-devel
curl_json libcurl-devel, yajl-devel
curl_xml libcurl-devel, libxml2-devel
dbi libdbi-devel
dns libpcap-devel
gmond ganglia-devel
ipmi OpenIPMI-devel
iptables iptables-devel
java java-1.8.0-openjdk-devel
log_logstash yajl-devel
lvm lvm2-devel
memcachec libmemcached-devel
mysql mysql-devel
netlink libmnl-devel
nginx libcurl-devel
notify_desktop libnotify-devel
notify_email libesmtp-devel
nut nut-devel
openldap openldap-devel
perl perl-devel, perl-ExtUtils-Embed
ping liboping-devel
postgresql postgresql-devel
python python-devel
redis hiredis-devel
rrdtool rrdtool-devel
smart libatasmart-devel, libudev-devel
snmp net-snmp-devel
varnish varnish-libs-devel
virt libvirt-devel, libxml2-devel
write_http libcurl-devel
write_redis hiredis-devel

 

Notes

Not all plugin dependencies were available from the CentOS Base and EPEL repositories. For these particular plugins, you would either have to:

  • configure another YUM repository that has the necessary RPMs
  • download and install the individual RPM from a third-party site
  • build your own RPM
  • compile the dependency from source

With regards to the java plugin, the 1.6.0 and 1.7.0 openjdk versions, in addition to the 1.8.0 version listed above, are able to satisfy the java dependency.

 

Conclusion

Once the plugin dependencies are sorted out, the make and make install steps typically go without a hitch. In a future post, I will outline how to build the collectd RPMs using the latest available version.

© 著作权归作者所有

共有 人打赏支持
一号男嘉宾
粉丝 132
博文 27
码字总数 40512
作品 0
成都
物理机性能监控―基于collectd插件编写

  【IT168 技术】目前在做一个对物理机的性能指标监控的项目。在业内实现方式主要有如下两种方案:   1、在物理机中部署agent程序,实现对数据指标的采集。此方案在采集数据和容错处理上...

it168网站 ⋅ 2016/11/01 ⋅ 0

聊聊 Statsd 和 Collectd 那点事!

StatsD 是由 Etsy 开发并发布的汇总和总结应用指标的一个简单的守护进程,近些年来发展迅速,已经变成了一个用于收集应用性能指标的统一的协议。 关于 Statsd 的使用已经有很多文章介绍过,所...

OneAPM蓝海讯通 ⋅ 2015/12/10 ⋅ 0

collectd 5.6.0 发布,系统监控和统计工具

collectd 5.6.0 发布了,主要更新如下: Build system: An option to to avoid building the DF plugin against XFS has been added. Thanks to Ruben Kerkhof. #1878 Build system: Autoco......

局长 ⋅ 2016/09/12 ⋅ 2

collectd 5.5.3 发布,系统监控和统计工具

collectd 5.5.3 发布了,这将是十二月份 5.7 发布之前 5.5.x的最后一个修正版。 主要更新如下: collectd: Write threads are stopped before shutdown callbacks are called. Thanks to Fl...

两味真火 ⋅ 2016/11/29 ⋅ 1

collectd 5.7.2 发布,系统监控和统计工具

collectd 5.7.2 发布了,collectd 是一个守护(daemon)进程,用来收集系统性能和提供各种存储方式来存储不同值的机制。比如以 RRD 文件形式。当系统运行和存储信息的时候,Collectd 会周期性统...

达尔文 ⋅ 2017/06/07 ⋅ 0

Graphite系统监控

Praphite学习文档 作者:perofu Email:perofu.com@gmail.com 版本:version:1.0 2014/04/26 一、简介: 1. Graphite是一个企业级的监控工具,可以在廉价机硬件上运行。 2.最初由Chris Davis...

perofu ⋅ 2014/05/04 ⋅ 8

centos 6.5 安装mysql

搭建前的准备 输入: rpm -qa grep mysql 查看数据库是否安装了数据库如果只出现这个:mysql-libs-5.1.73-8.el6_8.x86_64,可以不用管, 如果出现:mysql-server-5.1.73-8.el68.x8664 等等,...

守望_半吊子 ⋅ 05/03 ⋅ 0

Openstack instance monitor

上一篇讲解的是compute监控,这一篇则是关于instance的监控,当然扩展一下munin的插件也是可以监控instance的,为什么选择collect,collect官网在说到collect的优势时提到collect采用C编写,...

China_OS ⋅ 2013/01/27 ⋅ 0

在centOS上安装wireshark出错

[root@localhost Desktop]# yum install wireshark Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: centos.crazyfrogs.......

帅枫小明 ⋅ 2014/12/19 ⋅ 0

伍哥原创之安装RabbitMQ

测试环境:CentOS 6.2 首先用root身份登录测试环境 1,安装erlang (R15B01) 安装完成以后,执行erl看是否能打开eshell,用’halt().’退出,注意后面的点号,那是erlang的结束符。 如下: ...

alex.wu ⋅ 2012/08/06 ⋅ 0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

从 Confluence 5.3 及其早期版本中恢复空间

如果你需要从 Confluence 5.3 及其早期版本中的导出文件恢复到晚于 Confluence 5.3 的 Confluence 中的话。你可以使用临时的 Confluence 空间安装,然后将这个 Confluence 安装实例升级到你现...

honeymose ⋅ 14分钟前 ⋅ 0

用ZBLOG2.3博客写读书笔记网站能创造今日头条的辉煌吗?

最近两年,著名的自媒体网站今日头条可以说是火得一塌糊涂,虽然从目前来看也遇到了一点瓶颈,毕竟发展到了一定的规模,继续增长就更加难了,但如今的今日头条规模和流量已经非常大了。 我们...

原创小博客 ⋅ 今天 ⋅ 0

MyBatis四大核心概念

本文讲解 MyBatis 四大核心概念(SqlSessionFactoryBuilder、SqlSessionFactory、SqlSession、Mapper)。 MyBatis 作为互联网数据库映射工具界的“上古神器”,训有四大“神兽”,谓之:Sql...

waylau ⋅ 今天 ⋅ 0

以太坊java开发包web3j简介

web3j(org.web3j)是Java版本的以太坊JSON RPC接口协议封装实现,如果需要将你的Java应用或安卓应用接入以太坊,或者希望用java开发一个钱包应用,那么用web3j就对了。 web3j的功能相当完整...

汇智网教程 ⋅ 今天 ⋅ 0

2个线程交替打印100以内的数字

重点提示: 线程的本质上只是一个壳子,真正的逻辑其实在“竞态条件”中。 举个例子,比如本题中的打印,那么在竞态条件中,我只需要一个方法即可; 假如我的需求是2个线程,一个+1,一个-1,...

Germmy ⋅ 今天 ⋅ 0

Springboot2 之 Spring Data Redis 实现消息队列——发布/订阅模式

一般来说,消息队列有两种场景,一种是发布者订阅者模式,一种是生产者消费者模式,这里利用redis消息“发布/订阅”来简单实现订阅者模式。 实现之前先过过 redis 发布订阅的一些基础概念和操...

Simonton ⋅ 今天 ⋅ 0

error:Could not find gradle

一.更新Android Studio后打开Project,报如下错误: Error: Could not find com.android.tools.build:gradle:2.2.1. Searched in the following locations: file:/D:/software/android/andro......

Yao--靠自己 ⋅ 昨天 ⋅ 0

Spring boot 项目打包及引入本地jar包

Spring Boot 项目打包以及引入本地Jar包 [TOC] 上篇文章提到 Maven 项目添加本地jar包的三种方式 ,本篇文章记录下在实际项目中的应用。 spring boot 打包方式 我们知道,传统应用可以将程序...

Os_yxguang ⋅ 昨天 ⋅ 0

常见数据结构(二)-树(二叉树,红黑树,B树)

本文介绍数据结构中几种常见的树:二分查找树,2-3树,红黑树,B树 写在前面 本文所有图片均截图自coursera上普林斯顿的课程《Algorithms, Part I》中的Slides 相关命题的证明可参考《算法(第...

浮躁的码农 ⋅ 昨天 ⋅ 0

android -------- 混淆打包报错 (warning - InnerClass ...)

最近做Android混淆打包遇到一些问题,Android Sdutio 3.1 版本打包的 错误如下: Android studio warning - InnerClass annotations are missing corresponding EnclosingMember annotation......

切切歆语 ⋅ 昨天 ⋅ 0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部