文档章节

Enabling (Almost All) Collectd Plugins on CentOS 6

一号男嘉宾
 一号男嘉宾
发布于 2016/10/08 13:52
字数 927
阅读 140
收藏 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.

一号男嘉宾
粉丝 129
博文 28
码字总数 40512
作品 0
成都
私信 提问
加载中
请先登录后再评论。
AngularJS 的UI增强指令集--AngularUI

Angular UI 顾名思义,AngularJS 的UI增强指令集,提供了IE、jQuery 兼容,以及一些常用 UI 组件。 包含的模块有: UI-Utils UI-Modules UI-Alias UI-Bootstrap NG-Grid UI-Router IDE Plug...

匿名
2012/12/24
4.2W
0
批量Linux系统管理--LazyManage

LazyManage适用于运维人员对centos(linux)系统平台服务器批量管理 基于dialog图形选择,expect验证输入密码,后台并发操作。 基本功能批量执行命令、传送文件、执行脚本,更多功能大家可根据需...

李权洲
2013/05/31
3.3K
0
iOS9系列专题6——iOS9其他适配注意点

iOS9适配注意点 一、后台定位类app适配点 在iOS8中,APP的定位服务apple就做了一些修改,需要用户申请相应的权限,并在info.plist文件中添加对应的键值。具体的做法在这篇博客中有详细的讲解...

珲少
2015/10/07
3.5K
3
Kubernetes网络分析-Container间通信

本文假设你已经搭建好了Kubernetes集群,那么请求是如何到达POD,然后被Container处理的。都是干货。 如果没听说过Kubernetes,不知道POD是什么,请先参考: http://www.infoq.com/cn/articl...

xue777hua
2015/10/09
4.4K
6
在Google使用Borg进行大规模集群的管理 5-6

使用效率 Borg的一个主要目的就是有效的利用Google的机器舰队,这可是一大笔财务投资:让效率提升几个百分点就能省下几百万美元。这一节讨论了和计算了一些Borg使用的技术和策略。 5.1 测度方...

难易
2015/10/14
1.7K
3

没有更多内容

加载失败,请刷新页面

加载更多

层次聚类与聚类树

聚类分析 在生态学研究当中,有些环境中的对象是连续(或者离散)的,而有些对象是不连续的,聚类的目的是识别在环境中不连续的对象子集,从而探索隐藏在数据背后的属性特征。聚类分析主要处...

SYSU星空
01/11
0
0
几个无聊但你可能忽略的C知识点

来源:公众号【编程珠玑】 作者:守望先生 ID:shouwangxiansheng C语言main函数的写法 标准中,只有下面两种写法: int main (void) { /**body**/ } 以及 int main (int argc, cha...

学以解忧
01/08
0
0
20个实战项目教你掌握OpenCV和图像处理,PDF开放下载

点击上方“小白学视觉”,选择加"星标"或“置顶” 重磅干货,第一时间送达 近期小白学视觉公众号推出了多篇OpenCV实战项目的文章,深受小伙伴们的喜爱。最近有小伙伴推荐,希望可以讲经典的项...

机器学习炼丹术
29分钟前
9
0
吃瓜!挂一个爬虫工作者

原本不打算撕逼的,可总感觉技术人员这么狗,不曝光他不合适。 此人微信号: YGMXMF 描述如下: 鉴于不可抗力因素,我删除了上篇文章! 此人想178买文章(早就关注了,当时没付费观看,现在要...

adminThorn
48分钟前
9
0
聊一聊一道关于线程池的面试题

网络上有这样一道关于线程池的面试题: 1. 高并发、任务执行时间短的业务怎样使用线程池? 2. 并发不高、任务执行时间长的业务怎样使用线程池? 3. 并发高、业务执行时间长的业务怎样使用线程...

黄小斜
今天
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部