1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) OPNFV, Intel Corporation and others.
7 Barometer has enabled the following collectd plugins:
9 * dpdkstat plugin: A read plugin that retrieve stats from the DPDK extended
12 * `ceilometer plugin`_: A write plugin that pushes the retrieved stats to
13 Ceilometer. It's capable of pushing any stats read through collectd to
14 Ceilometer, not just the DPDK stats.
16 * hugepages plugin: A read plugin that retrieves the number of available
17 and free hugepages on a platform as well as what is available in terms of
20 * RDT plugin: A read plugin that provides the last level cache utilitzation and
21 memory bandwidth utilization
23 * Open vSwitch events Plugin: A read plugin that retrieves events from OVS.
25 * mcelog plugin: A read plugin that uses mcelog client protocol to check for
26 memory Machine Check Exceptions and sends the stats for reported exceptions
28 All the plugins above are available on the collectd master, except for the
29 ceilometer plugin as it's a python based plugin and only C plugins are accepted
30 by the collectd community. The ceilometer plugin lives in the OpenStack
33 Other plugins under development or existing as a pull request into collectd master:
35 * dpdkevents: A read plugin that retrieves DPDK link status and DPDK
36 forwarding cores liveliness status (DPDK Keep Alive).
38 * Open vSwitch stats Plugin: A read plugin that retrieve flow and interface
41 * SNMP write: A write plugin that will act as a SNMP subagent and will map
42 collectd metrics to relavent OIDs. Will only support SNMP: get, getnext and
45 * Legacy/IPMI: A read plugin that reports platform thermals, voltages,
46 fanspeed, current, flow, power etc. Also, the plugin monitors Intelligent
47 Platform Management Interface (IPMI) System Event Log (SEL) and sends the
48 collectd notification once a new record appears in the SEL.
50 Building collectd with the Barometer plugins and installing the dependencies
51 =============================================================================
53 All Upstreamed plugins
54 -----------------------
55 The plugins that have been merged to the collectd master branch can all be
56 built and configured through the barometer repository.
58 **Note**: sudo permissions are required to install collectd.
60 **Note**: These are instructions for Ubuntu 16.04.
62 To build and install these dependencies, clone the barometer repo:
66 $ git clone https://gerrit.opnfv.org/gerrit/barometer
68 Install the build dependencies
72 $ ./src/install_build_deps.sh
74 To install collectd as a service and install all it's dependencies:
78 $ cd barometer/src && sudo make && sudo make install
80 This will install collectd as a service and the base install directory
83 Sample configuration files can be found in '/opt/collectd/etc/collectd.conf.d'
85 Please note if you are using any Open vSwitch plugins you need to run:
89 $ sudo ovs-vsctl set-manager ptcp:6640
91 DPDK statistics plugin
92 -----------------------
93 Repo: https://github.com/collectd/collectd
97 Dependencies: DPDK (http://dpdk.org/)
99 To build and install DPDK to /usr please see:
100 https://github.com/collectd/collectd/blob/master/docs/BUILD.dpdkstat.md
102 Building and installing collectd:
106 $ git clone https://github.com/collectd/collectd.git
109 $ ./configure --enable-syslog --enable-logfile --enable-debug
114 This will install collectd to /opt/collectd
115 The collectd configuration file can be found at /opt/collectd/etc
116 To configure the hugepages plugin you need to modify the configuration file to
124 ProcessType "secondary"
126 EnabledPortMask 0xffff
129 For more information on the plugin parameters, please see:
130 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
132 Please note if you are configuring collectd with the **static DPDK library**
133 you must compile the DPDK library with the -fPIC flag:
137 $ make EXTRA_CFLAGS=-fPIC
139 You must also modify the configuration step when building collectd:
143 $ ./configure CFLAGS=" -lpthread -Wl,--whole-archive -Wl,-ldpdk -Wl,-lm -Wl,-lrt -Wl,-lpcap -Wl,-ldl -Wl,--no-whole-archive"
145 Please also note that if you are not building and installing DPDK system-wide
146 you will need to specify the specific paths to the header files and libraries
147 using LIBDPDK_CPPFLAGS and LIBDPDK_LDFLAGS. You will also need to add the DPDK
148 library symbols to the shared library path using ldconfig. Note that this
149 update to the shared library path is not persistant (i.e. it will not survive a
150 reboot). Pending a merge of https://github.com/collectd/collectd/pull/2073.
154 $ ./configure LIBDPDK_CPPFLAGS="path to DPDK header files" LIBDPDK_LDFLAGS="path to DPDK libraries"
159 Repo: https://github.com/collectd/collectd
163 Dependencies: None, but assumes hugepages are configured.
165 To configure some hugepages:
169 sudo mkdir -p /mnt/huge
170 sudo mount -t hugetlbfs nodev /mnt/huge
171 sudo echo 14336 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
173 Building and installing collectd:
177 $ git clone https://github.com/collectd/collectd.git
180 $ ./configure --enable-syslog --enable-logfile --enable-hugepages --enable-debug
184 This will install collectd to /opt/collectd
185 The collectd configuration file can be found at /opt/collectd/etc
186 To configure the hugepages plugin you need to modify the configuration file to
197 ValuesPercentage false
200 For more information on the plugin parameters, please see:
201 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
205 Repo: https://github.com/collectd/collectd
211 * PQoS/Intel RDT library https://github.com/01org/intel-cmt-cat.git
214 Building and installing PQoS/Intel RDT library:
218 $ git clone https://github.com/01org/intel-cmt-cat.git
221 $ make install PREFIX=/usr
223 You will need to insert the msr kernel module:
229 Building and installing collectd:
233 $ git clone https://github.com/collectd/collectd.git
236 $ ./configure --enable-syslog --enable-logfile --with-libpqos=/usr/ --enable-debug
240 This will install collectd to /opt/collectd
241 The collectd configuration file can be found at /opt/collectd/etc
242 To configure the RDT plugin you need to modify the configuration file to
247 <LoadPlugin intel_rdt>
254 For more information on the plugin parameters, please see:
255 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
259 Repo: https://github.com/maryamtahhan/collectd
261 Branch: feat_ipmi_events, feat_ipmi_analog
263 Dependencies: OpenIPMI library
265 The IPMI plugin is already implemented in the latest collectd and sensors
266 like temperature, voltage, fanspeed, current are already supported there.
267 The list of supported IPMI sensors has been extended and sensors like flow,
268 power are supported now. Also, a System Event Log (SEL) notification feature
271 * The feat_ipmi_events branch includes new SEL feature support in collectd
272 IPMI plugin. If this feature is enabled, the collectd IPMI plugin will
273 dispatch notifications about new events in System Event Log.
275 * The feat_ipmi_analog branch includes the support of extended IPMI sensors in
276 collectd IPMI plugin.
278 On Ubuntu, install the dependencies:
282 $ sudo apt-get install libopenipmi-dev
284 Enable IPMI support in the kernel:
288 $ sudo modprobe ipmi_devintf
289 $ sudo modprobe ipmi_si
291 **Note**: If HW supports IPMI, the ``/dev/ipmi0`` character device will be
294 Clone and install the collectd IPMI plugin:
298 $ git clone https://github.com/maryamtahhan/collectd
300 $ git checkout $BRANCH
302 $ ./configure --enable-syslog --enable-logfile --enable-debug
306 Where $BRANCH is feat_ipmi_events or feat_ipmi_analog.
308 This will install collectd to default folder ``/opt/collectd``. The collectd
309 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``. To
310 configure the IPMI plugin you need to modify the file to include:
316 SELEnabled true # only feat_ipmi_events branch supports this
319 **Note**: By default, IPMI plugin will read all available analog sensor values,
320 dispatch the values to collectd and send SEL notifications.
322 For more information on the IPMI plugin parameters and SEL feature configuration,
325 https://github.com/maryamtahhan/collectd/blob/feat_ipmi_events/src/collectd.conf.pod
327 Extended analog sensors support doesn't require addition configuration. The usual
328 collectd IPMI documentation can be used.
330 https://collectd.org/wiki/index.php/Plugin:IPMI
331 https://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_ipmi
335 https://www.kernel.org/doc/Documentation/IPMI.txt
336 http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html
340 Repo: https://github.com/collectd/collectd
346 Start by installing mcelog. Note: The kernel has to have CONFIG_X86_MCE
347 enabled. For 32bit kernels you need at least a 2.6,30 kernel.
353 $ apt-get update && apt-get install mcelog
359 $ git clone git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git
364 $ cp mcelog.service /etc/systemd/system/
365 $ systemctl enable mcelog.service
366 $ systemctl start mcelog.service
368 Verify you got a /dev/mcelog. You can verify the daemon is running completely
375 This should query the information in the running daemon. If it prints nothing
376 that is fine (no errors logged yet). More info @
377 http://www.mcelog.org/installation.html
379 Modify the mcelog configuration file "/etc/mcelog/mcelog.conf" to include or
384 socket-path = /var/run/mcelog-client
386 Clone and install the collectd mcelog plugin:
390 $ git clone https://github.com/maryamtahhan/collectd
392 $ git checkout feat_ras
394 $ ./configure --enable-syslog --enable-logfile --enable-debug
398 This will install collectd to /opt/collectd
399 The collectd configuration file can be found at /opt/collectd/etc
400 To configure the mcelog plugin you need to modify the configuration file to
409 McelogClientSocket "/var/run/mcelog-client"
412 For more information on the plugin parameters, please see:
413 https://github.com/maryamtahhan/collectd/blob/feat_ras/src/collectd.conf.pod
415 Simulating a Machine Check Exception can be done in one of 3 ways:
417 * Running $make test in the mcelog cloned directory - mcelog test suite
421 **mcelog test suite:**
423 It is always a good idea to test an error handling mechanism before it is
424 really needed. mcelog includes a test suite. The test suite relies on
425 mce-inject which needs to be installed and in $PATH.
427 You also need the mce-inject kernel module configured (with
428 CONFIG_X86_MCE_INJECT=y), compiled, installed and loaded:
432 $ modprobe mce-inject
434 Then you can run the mcelog test suite with
440 This will inject different classes of errors and check that the mcelog triggers
441 runs. There will be some kernel messages about page offlining attempts. The
442 test will also lose a few pages of memory in your system (not significant)
443 **Note this test will kill any running mcelog, which needs to be restarted
444 manually afterwards**.
448 A utility to inject corrected, uncorrected and fatal machine check exceptions
452 $ git clone https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git
455 $ modprobe mce-inject
457 Modify the test/corrected script to include the following:
462 STATUS 0xcc00008000010090
468 $ ./mce-inject < test/corrected
470 **Note: the uncorrected and fatal scripts under test will cause a platform reset.
471 Only the fatal script generates the memory errors**. In order to quickly
472 emulate uncorrected memory errors and avoid host reboot following test errors
473 from mce-test suite can be injected:
477 $ mce-inject mce-test/cases/coverage/soft-inj/recoverable_ucr/data/srao_mem_scrub
481 In addition an more in-depth test of the Linux kernel machine check facilities
482 can be done with the mce-test test suite. mce-test supports testing uncorrected
483 error handling, real error injection, handling of different soft offlining
484 cases, and other tests.
486 **Corrected memory error injection:**
488 To inject corrected memory errors:
490 * Remove sb_edac and edac_core kernel modules: rmmod sb_edac rmmod edac_core
491 * Insert einj module: modprobe einj param_extension=1
492 * Inject an error by specifying details (last command should be repeated at least two times):
496 $ APEI_IF=/sys/kernel/debug/apei/einj
497 $ echo 0x8 > $APEI_IF/error_type
498 $ echo 0x01f5591000 > $APEI_IF/param1
499 $ echo 0xfffffffffffff000 > $APEI_IF/param2
500 $ echo 1 > $APEI_IF/notrigger
501 $ echo 1 > $APEI_IF/error_inject
503 * Check the MCE statistic: mcelog --client. Check the mcelog log for injected error details: less /var/log/mcelog.
507 ---------------------
508 OvS Events Repo: https://github.com/collectd/collectd
510 OvS Stats Repo: https://github.com/maryamtahhan/collectd
512 OvS Events Branch: master
514 OvS Stats Branch:feat_ovs_stats
516 Dependencies: Open vSwitch, libyajl
518 On Ubuntu, install the dependencies:
522 $ sudo apt-get install libyajl-dev openvswitch-switch
524 Start the Open vSwitch service:
528 $ sudo service openvswitch-switch start
530 configure the ovsdb-server manager:
534 $ sudo ovs-vsctl set-manager ptcp:6640
536 Clone and install the collectd ovs plugin:
542 $ git checkout $BRANCH
544 $ ./configure --enable-syslog --enable-logfile --enable-debug
548 where $REPO is one of the repos listed at the top of this section.
550 Where $BRANCH is master or feat_ovs_stats.
552 This will install collectd to /opt/collectd. The collectd configuration file
553 can be found at /opt/collectd/etc. To configure the OVS events plugin you
554 need to modify the configuration file to include:
558 <LoadPlugin ovs_events>
561 <Plugin "ovs_events">
563 Socket "/var/run/openvswitch/db.sock"
564 Interfaces "br0" "veth0"
565 SendNotification false
568 To configure the OVS stats plugin you need to modify the configuration file
573 <LoadPlugin ovs_stats>
579 Socket "/var/run/openvswitch/db.sock"
580 Bridges "br0" "br_ext"
583 For more information on the plugin parameters, please see:
584 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
586 https://github.com/maryamtahhan/collectd/blob/feat_ovs_stats/src/collectd.conf.pod
588 Installing collectd as a service
589 --------------------------------
590 Collectd service scripts are available in the collectd/contrib directory.
591 To install collectd as a service:
595 $ sudo cp contrib/systemd.collectd.service /etc/systemd/system/
596 $ cd /etc/systemd/system/
597 $ sudo mv systemd.collectd.service collectd.service
598 $ sudo chmod +x collectd.service
600 Modify collectd.service
605 ExecStart=/opt/collectd/sbin/collectd
606 EnvironmentFile=-/opt/collectd/etc/
607 EnvironmentFile=-/opt/collectd/etc/
608 CapabilityBoundingSet=CAP_SETUID CAP_SETGID
614 $ sudo systemctl daemon-reload
615 $ sudo systemctl start collectd.service
616 $ sudo systemctl status collectd.service should show success
618 Additional useful plugins
619 --------------------------
624 Can be used to show you when notifications are being generated by calling a
625 bash script that dumps notifications to file. (handy for debug). Modify
626 /opt/collectd/etc/collectd.conf:
632 # Exec "user:group" "/path/to/exec"
633 NotificationExec "user" "<path to barometer>/barometer/src/collectd/collectd_sample_configs/write_notification.sh"
636 write_notification.sh (just writes the notification passed from exec through
637 STDIN to a file (/tmp/notifications)):
642 rm -f /tmp/notifications
645 echo $x$y >> /tmp/notifications
648 output to /tmp/notifications should look like:
658 TypeInstance:link_status
659 uuid:f2aafeec-fa98-4e76-aec5-18ae9fc74589
661 linkstate of "br-ex" interface has been changed to "DOWN"
665 Can be used to log collectd activity. Modify /opt/collectd/etc/collectd.conf to
673 File "/var/log/collectd.log"
678 Monitoring Interfaces and Openstack Support
679 -------------------------------------------
680 .. Figure:: monitoring_interfaces.png
682 Monitoring Interfaces and Openstack Support
684 The figure above shows the DPDK L2 forwarding application running on a compute
685 node, sending and receiving traffic. collectd is also running on this compute
686 node retrieving the stats periodically from DPDK through the dpdkstat plugin
687 and publishing the retrieved stats to Ceilometer through the ceilometer plugin.
689 To see this demo in action please checkout: `Barometer OPNFV Summit demo`_
693 .. [1] https://collectd.org/wiki/index.php/Naming_schema
694 .. [2] https://github.com/collectd/collectd/blob/master/src/daemon/plugin.h
695 .. [3] https://collectd.org/wiki/index.php/Value_list_t
696 .. [4] https://collectd.org/wiki/index.php/Data_set
697 .. [5] https://collectd.org/documentation/manpages/types.db.5.shtml
698 .. [6] https://collectd.org/wiki/index.php/Data_source
699 .. [7] https://collectd.org/wiki/index.php/Meta_Data_Interface
701 .. _Barometer OPNFV Summit demo: https://prezi.com/kjv6o8ixs6se/software-fastpath-service-quality-metrics-demo/
702 .. _ceilometer plugin: https://github.com/openstack/collectd-ceilometer-plugin/tree/stable/mitaka