1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) <optionally add copywriters name>
5 ===================================
6 OPNFV Barometer User Guide
7 ===================================
13 Barometer collectd plugins description
14 ---------------------------------------
15 .. Describe the specific features and how it is realised in the scenario in a brief manner
16 .. to ensure the user understand the context for the user guide instructions to follow.
18 collectd is a daemon which collects system performance statistics periodically
19 and provides a variety of mechanisms to publish the collected metrics. It
20 supports more than 90 different input and output plugins. Input plugins
21 retrieve metrics and publish them to the collectd deamon, while output plugins
22 publish the data they receive to an end point. collectd also has infrastructure
23 to support thresholding and notification.
25 Barometer has enabled the following collectd plugins:
27 * *dpdkstat plugin*: A read plugin that retrieve stats from the DPDK extended
30 * *dpdkevents plugin*: A read plugin that retrieves DPDK link status and DPDK
31 forwarding cores liveliness status (DPDK Keep Alive).
33 * `ceilometer plugin`_: A write plugin that pushes the retrieved stats to
34 Ceilometer. It's capable of pushing any stats read through collectd to
35 Ceilometer, not just the DPDK stats.
37 * *hugepages plugin*: A read plugin that retrieves the number of available
38 and free hugepages on a platform as well as what is available in terms of
41 * *RDT plugin*: A read plugin that provides the last level cache utilitzation and
42 memory bandwidth utilization
44 * *Open vSwitch events Plugin*: A read plugin that retrieves events from OVS.
46 * *mcelog plugin*: A read plugin that uses mcelog client protocol to check for
47 memory Machine Check Exceptions and sends the stats for reported exceptions
49 All the plugins above are available on the collectd master, except for the
50 ceilometer plugin as it's a python based plugin and only C plugins are accepted
51 by the collectd community. The ceilometer plugin lives in the OpenStack
54 Other plugins under development or existing as a pull request into collectd master:
56 * *dpdkevents*: A read plugin that retrieves DPDK link status and DPDK
57 forwarding cores liveliness status (DPDK Keep Alive).
59 * *Open vSwitch stats Plugin*: A read plugin that retrieve flow and interface
62 * *SNMP Agent*: A write plugin that will act as a AgentX subagent that receives
63 and handles queries from SNMP master agent and returns the data collected
64 by read plugins. The SNMP Agent plugin handles requests only for OIDs
65 specified in configuration file. To handle SNMP queries the plugin gets data
66 from collectd and translates requested values from collectd's internal format
67 to SNMP format. Supports SNMP: get, getnext and walk requests.
69 * *Legacy/IPMI*: A read plugin that reports platform thermals, voltages,
70 fanspeed, current, flow, power etc. Also, the plugin monitors Intelligent
71 Platform Management Interface (IPMI) System Event Log (SEL) and sends the
73 **Plugins included in the Danube release:**
80 collectd capabilities and usage
81 ------------------------------------
82 .. Describe the specific capabilities and usage for <XYZ> feature.
83 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
85 **NOTE** Plugins included in the OPNFV D release will be built-in to the fuel
86 plugin and available in the /opt/opnfv directory on the fuel master. You don't
87 need to clone the barometer/collectd repos to use these, but you can configure
88 them as shown in the examples below. Please note, the collectd plugins in OPNFV
89 are configured with reasonable defaults, but can be overriden.
91 Building all Barometer upstreamed plugins from scratch
92 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93 The plugins that have been merged to the collectd master branch can all be
94 built and configured through the barometer repository.
96 **NOTE: sudo permissions are required to install collectd.**
98 **NOTE: These are instructions for Ubuntu 16.04.**
100 To build and install these dependencies, clone the barometer repo:
104 $ git clone https://gerrit.opnfv.org/gerrit/barometer
106 Install the build dependencies
110 $ ./src/install_build_deps.sh
112 To install collectd as a service and install all it's dependencies:
116 $ cd barometer/src && sudo make && sudo make install
118 This will install collectd as a service and the base install directory
121 Sample configuration files can be found in '/opt/collectd/etc/collectd.conf.d'
123 **Note**: Exec plugin requires non-root user to execute scripts. By default,
124 `collectd_exec` user is used. Barometer scripts do *not* create this user. It
125 needs to be manually added or exec plugin configuration has to be changed to use
126 other, existing user before starting collectd service.
128 Please note if you are using any Open vSwitch plugins you need to run:
133 $ sudo ovs-vsctl set-manager ptcp:6640
135 DPDK statistics plugin
136 ^^^^^^^^^^^^^^^^^^^^^^
137 Repo: https://github.com/collectd/collectd
141 Dependencies: DPDK (http://dpdk.org/)
143 To build and install DPDK to /usr please see:
144 https://github.com/collectd/collectd/blob/master/docs/BUILD.dpdkstat.md
146 Building and installing collectd:
150 $ git clone https://github.com/collectd/collectd.git
153 $ ./configure --enable-syslog --enable-logfile --enable-debug
158 This will install collectd to /opt/collectd
159 The collectd configuration file can be found at /opt/collectd/etc
160 To configure the dpdkstats plugin you need to modify the configuration file to
170 ProcessType "secondary"
173 EnabledPortMask 0xffff
174 PortName "interface1"
175 PortName "interface2"
178 For more information on the plugin parameters, please see:
179 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
181 Please also note that if you are not building and installing DPDK system-wide
182 you will need to specify the specific paths to the header files and libraries
183 using LIBDPDK_CPPFLAGS and LIBDPDK_LDFLAGS. You will also need to add the DPDK
184 library symbols to the shared library path using ldconfig. Note that this
185 update to the shared library path is not persistant (i.e. it will not survive a
189 ^^^^^^^^^^^^^^^^^^^^^^
190 Repo: https://github.com/collectd/collectd
194 Dependencies: DPDK (http://dpdk.org/)
196 To build and install DPDK to /usr please see:
197 https://github.com/collectd/collectd/blob/master/docs/BUILD.dpdkstat.md
199 Building and installing collectd:
203 $ git clone https://github.com/maryamtahhan/collectd.git
206 $ ./configure --enable-syslog --enable-logfile --enable-debug
210 This will install collectd to /opt/collectd
211 The collectd configuration file can be found at /opt/collectd/etc
212 To configure the dpdkevents plugin you need to modify the configuration file to
217 LoadPlugin dpdkevents
218 <Plugin "dpdkevents">
223 ProcessType "secondary"
226 <Event "link_status">
227 SendEventsOnUpdate true
228 EnabledPortMask 0xffff
229 PortName "interface1"
230 PortName "interface2"
231 SendNotification false
234 SendEventsOnUpdate true
236 KeepAliveShmName "/dpdk_keepalive_shm_name"
237 SendNotification false
241 For more information on the plugin parameters, please see:
242 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
243 Please also note that if you are not building and installing DPDK system-wide
244 you will need to specify the specific paths to the header files and libraries
245 using LIBDPDK_CPPFLAGS and LIBDPDK_LDFLAGS. You will also need to add the DPDK
246 library symbols to the shared library path using ldconfig. Note that this
247 update to the shared library path is not persistant (i.e. it will not survive a
252 $ ./configure LIBDPDK_CPPFLAGS="path to DPDK header files" LIBDPDK_LDFLAGS="path to DPDK libraries"
256 Repo: https://github.com/collectd/collectd
260 Dependencies: None, but assumes hugepages are configured.
262 To configure some hugepages:
266 sudo mkdir -p /mnt/huge
267 sudo mount -t hugetlbfs nodev /mnt/huge
268 sudo echo 14336 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
270 Building and installing collectd:
274 $ git clone https://github.com/collectd/collectd.git
277 $ ./configure --enable-syslog --enable-logfile --enable-hugepages --enable-debug
281 This will install collectd to /opt/collectd
282 The collectd configuration file can be found at /opt/collectd/etc
283 To configure the hugepages plugin you need to modify the configuration file to
294 ValuesPercentage false
297 For more information on the plugin parameters, please see:
298 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
302 Repo: https://github.com/collectd/collectd
308 * PQoS/Intel RDT library https://github.com/01org/intel-cmt-cat.git
311 Building and installing PQoS/Intel RDT library:
315 $ git clone https://github.com/01org/intel-cmt-cat.git
318 $ make install PREFIX=/usr
320 You will need to insert the msr kernel module:
326 Building and installing collectd:
330 $ git clone https://github.com/collectd/collectd.git
333 $ ./configure --enable-syslog --enable-logfile --with-libpqos=/usr/ --enable-debug
337 This will install collectd to /opt/collectd
338 The collectd configuration file can be found at /opt/collectd/etc
339 To configure the RDT plugin you need to modify the configuration file to
344 <LoadPlugin intel_rdt>
351 For more information on the plugin parameters, please see:
352 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
356 Repo: https://github.com/maryamtahhan/collectd
358 Branch: feat_ipmi_events, feat_ipmi_analog
360 Dependencies: OpenIPMI library
362 The IPMI plugin is already implemented in the latest collectd and sensors
363 like temperature, voltage, fanspeed, current are already supported there.
364 The list of supported IPMI sensors has been extended and sensors like flow,
365 power are supported now. Also, a System Event Log (SEL) notification feature
368 * The feat_ipmi_events branch includes new SEL feature support in collectd
369 IPMI plugin. If this feature is enabled, the collectd IPMI plugin will
370 dispatch notifications about new events in System Event Log.
372 * The feat_ipmi_analog branch includes the support of extended IPMI sensors in
373 collectd IPMI plugin.
375 On Ubuntu, install the dependencies:
379 $ sudo apt-get install libopenipmi-dev
381 Enable IPMI support in the kernel:
385 $ sudo modprobe ipmi_devintf
386 $ sudo modprobe ipmi_si
388 **Note**: If HW supports IPMI, the ``/dev/ipmi0`` character device will be
391 Clone and install the collectd IPMI plugin:
395 $ git clone https://github.com/maryamtahhan/collectd
397 $ git checkout $BRANCH
399 $ ./configure --enable-syslog --enable-logfile --enable-debug
403 Where $BRANCH is feat_ipmi_events or feat_ipmi_analog.
405 This will install collectd to default folder ``/opt/collectd``. The collectd
406 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``. To
407 configure the IPMI plugin you need to modify the file to include:
413 SELEnabled true # only feat_ipmi_events branch supports this
416 **Note**: By default, IPMI plugin will read all available analog sensor values,
417 dispatch the values to collectd and send SEL notifications.
419 For more information on the IPMI plugin parameters and SEL feature configuration,
421 https://github.com/maryamtahhan/collectd/blob/feat_ipmi_events/src/collectd.conf.pod
423 Extended analog sensors support doesn't require additional configuration. The usual
424 collectd IPMI documentation can be used:
426 - https://collectd.org/wiki/index.php/Plugin:IPMI
427 - https://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_ipmi
431 - https://www.kernel.org/doc/Documentation/IPMI.txt
432 - http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html
436 Repo: https://github.com/collectd/collectd
442 Start by installing mcelog. Note: The kernel has to have CONFIG_X86_MCE
443 enabled. For 32bit kernels you need at least a 2.6,30 kernel.
449 $ apt-get update && apt-get install mcelog
455 $ git clone git://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git
460 $ cp mcelog.service /etc/systemd/system/
461 $ systemctl enable mcelog.service
462 $ systemctl start mcelog.service
465 Verify you got a /dev/mcelog. You can verify the daemon is running completely
472 This should query the information in the running daemon. If it prints nothing
473 that is fine (no errors logged yet). More info @
474 http://www.mcelog.org/installation.html
476 Modify the mcelog configuration file "/etc/mcelog/mcelog.conf" to include or
481 socket-path = /var/run/mcelog-client
483 Clone and install the collectd mcelog plugin:
487 $ git clone https://github.com/maryamtahhan/collectd
489 $ git checkout feat_ras
491 $ ./configure --enable-syslog --enable-logfile --enable-debug
495 This will install collectd to /opt/collectd
496 The collectd configuration file can be found at /opt/collectd/etc
497 To configure the mcelog plugin you need to modify the configuration file to
506 McelogClientSocket "/var/run/mcelog-client"
509 For more information on the plugin parameters, please see:
510 https://github.com/maryamtahhan/collectd/blob/feat_ras/src/collectd.conf.pod
512 Simulating a Machine Check Exception can be done in one of 3 ways:
514 * Running $make test in the mcelog cloned directory - mcelog test suite
518 **mcelog test suite:**
520 It is always a good idea to test an error handling mechanism before it is
521 really needed. mcelog includes a test suite. The test suite relies on
522 mce-inject which needs to be installed and in $PATH.
524 You also need the mce-inject kernel module configured (with
525 CONFIG_X86_MCE_INJECT=y), compiled, installed and loaded:
529 $ modprobe mce-inject
531 Then you can run the mcelog test suite with
537 This will inject different classes of errors and check that the mcelog triggers
538 runs. There will be some kernel messages about page offlining attempts. The
539 test will also lose a few pages of memory in your system (not significant)
540 **Note this test will kill any running mcelog, which needs to be restarted
541 manually afterwards**.
544 A utility to inject corrected, uncorrected and fatal machine check exceptions
548 $ git clone https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git
551 $ modprobe mce-inject
553 Modify the test/corrected script to include the following:
558 STATUS 0xcc00008000010090
564 $ ./mce-inject < test/corrected
566 **Note: the uncorrected and fatal scripts under test will cause a platform reset.
567 Only the fatal script generates the memory errors**. In order to quickly
568 emulate uncorrected memory errors and avoid host reboot following test errors
569 from mce-test suite can be injected:
573 $ mce-inject mce-test/cases/coverage/soft-inj/recoverable_ucr/data/srao_mem_scrub
577 In addition an more in-depth test of the Linux kernel machine check facilities
578 can be done with the mce-test test suite. mce-test supports testing uncorrected
579 error handling, real error injection, handling of different soft offlining
580 cases, and other tests.
582 **Corrected memory error injection:**
584 To inject corrected memory errors:
586 * Remove sb_edac and edac_core kernel modules: rmmod sb_edac rmmod edac_core
587 * Insert einj module: modprobe einj param_extension=1
588 * Inject an error by specifying details (last command should be repeated at least two times):
592 $ APEI_IF=/sys/kernel/debug/apei/einj
593 $ echo 0x8 > $APEI_IF/error_type
594 $ echo 0x01f5591000 > $APEI_IF/param1
595 $ echo 0xfffffffffffff000 > $APEI_IF/param2
596 $ echo 1 > $APEI_IF/notrigger
597 $ echo 1 > $APEI_IF/error_inject
599 * Check the MCE statistic: mcelog --client. Check the mcelog log for injected error details: less /var/log/mcelog.
602 ^^^^^^^^^^^^^^^^^^^^^
603 OvS Events Repo: https://github.com/collectd/collectd
605 OvS Stats Repo: https://github.com/maryamtahhan/collectd
607 OvS Events Branch: master
609 OvS Stats Branch:feat_ovs_stats
611 OvS Events MIBs: The SNMP OVS interface link status is provided by standard
612 IF-MIB (http://www.net-snmp.org/docs/mibs/IF-MIB.txt)
614 Dependencies: Open vSwitch, Yet Another JSON Library (https://github.com/lloyd/yajl)
616 On Ubuntu, install the dependencies:
620 $ sudo apt-get install libyajl-dev openvswitch-switch
622 Start the Open vSwitch service:
626 $ sudo service openvswitch-switch start
628 configure the ovsdb-server manager:
632 $ sudo ovs-vsctl set-manager ptcp:6640
634 Clone and install the collectd ovs plugin:
640 $ git checkout $BRANCH
642 $ ./configure --enable-syslog --enable-logfile --enable-debug
646 where $REPO is one of the repos listed at the top of this section.
648 Where $BRANCH is master or feat_ovs_stats.
650 This will install collectd to /opt/collectd. The collectd configuration file
651 can be found at /opt/collectd/etc. To configure the OVS events plugin you
652 need to modify the configuration file to include:
656 <LoadPlugin ovs_events>
659 <Plugin "ovs_events">
661 Socket "/var/run/openvswitch/db.sock"
662 Interfaces "br0" "veth0"
663 SendNotification false
667 To configure the OVS stats plugin you need to modify the configuration file
672 <LoadPlugin ovs_stats>
678 Socket "/var/run/openvswitch/db.sock"
679 Bridges "br0" "br_ext"
682 For more information on the plugin parameters, please see:
683 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
685 https://github.com/maryamtahhan/collectd/blob/feat_ovs_stats/src/collectd.conf.pod
689 Repo: https://github.com/maryamtahhan/collectd/
693 Dependencies: NET-SNMP library
695 Start by installing net-snmp and dependencies.
701 $ apt-get install snmp snmp-mibs-downloader snmpd libsnmp-dev
702 $ systemctl start snmpd.service
706 Become root to install net-snmp dependencies
710 $ apt-get install libperl-dev
712 Clone and build net-snmp
716 $ git clone https://github.com/haad/net-snmp.git
718 $ ./configure --with-persistent-directory="/var/net-snmp" --with-systemd --enable-shared --prefix=/usr
727 Copy default configuration to persistent folder
731 $ cp EXAMPLE.conf /usr/share/snmp/snmpd.conf
733 Set library path and default MIB configuration
738 $ echo export LD_LIBRARY_PATH=/usr/lib >> .bashrc
739 $ net-snmp-config --default-mibdirs
740 $ net-snmp-config --snmpconfpath
742 Configure snmpd as a service
747 $ cp ./dist/snmpd.service /etc/systemd/system/
748 $ systemctl enable snmpd.service
749 $ systemctl start snmpd.service
751 Add the following line to snmpd.conf configuration file
752 "/usr/share/snmp/snmpd.conf" to make all OID tree visible for SNMP clients:
756 view systemonly included .1
758 To verify that SNMP is working you can get IF-MIB table using SNMP client
759 to view the list of Linux interfaces:
763 $ snmpwalk -v 2c -c public localhost IF-MIB::interfaces
765 Clone and install the collectd snmp_agent plugin:
769 $ git clone https://github.com/maryamtahhan/collectd
771 $ git checkout feat_snmp
773 $ ./configure --enable-syslog --enable-logfile --enable-debug --enable-snmp --with-libnetsnmp
777 This will install collectd to /opt/collectd
778 The collectd configuration file can be found at /opt/collectd/etc
779 **SNMP Agent plugin is a generic plugin and cannot work without configuration**.
780 To configure the snmp_agent plugin you need to modify the configuration file to
781 include OIDs mapped to collectd types. The following example maps scalar
782 memAvailReal OID to value represented as free memory type of memory plugin:
786 LoadPlugin snmp_agent
787 <Plugin "snmp_agent">
788 <Data "memAvailReal">
792 OIDs "1.3.6.1.4.1.2021.4.6.0"
796 For more information on the plugin parameters, please see:
797 https://github.com/maryamtahhan/collectd/blob/feat_snmp/src/collectd.conf.pod
799 For more details on AgentX subagent, please see:
800 http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/
802 Installing collectd as a service
803 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
804 **NOTE**: In an OPNFV installation, collectd is installed and configured as a
807 Collectd service scripts are available in the collectd/contrib directory.
808 To install collectd as a service:
812 $ sudo cp contrib/systemd.collectd.service /etc/systemd/system/
813 $ cd /etc/systemd/system/
814 $ sudo mv systemd.collectd.service collectd.service
815 $ sudo chmod +x collectd.service
817 Modify collectd.service
822 ExecStart=/opt/collectd/sbin/collectd
823 EnvironmentFile=-/opt/collectd/etc/
824 EnvironmentFile=-/opt/collectd/etc/
825 CapabilityBoundingSet=CAP_SETUID CAP_SETGID
831 $ sudo systemctl daemon-reload
832 $ sudo systemctl start collectd.service
833 $ sudo systemctl status collectd.service should show success
835 Additional useful plugins
836 ^^^^^^^^^^^^^^^^^^^^^^^^^^
838 * **Exec Plugin** : Can be used to show you when notifications are being
839 generated by calling a bash script that dumps notifications to file. (handy
840 for debug). Modify /opt/collectd/etc/collectd.conf:
846 # Exec "user:group" "/path/to/exec"
847 NotificationExec "user" "<path to barometer>/barometer/src/collectd/collectd_sample_configs/write_notification.sh"
850 write_notification.sh (just writes the notification passed from exec through
851 STDIN to a file (/tmp/notifications)):
856 rm -f /tmp/notifications
859 echo $x$y >> /tmp/notifications
862 output to /tmp/notifications should look like:
872 TypeInstance:link_status
873 uuid:f2aafeec-fa98-4e76-aec5-18ae9fc74589
875 linkstate of "br-ex" interface has been changed to "DOWN"
877 * **logfile plugin**: Can be used to log collectd activity. Modify
878 /opt/collectd/etc/collectd.conf to include:
885 File "/var/log/collectd.log"
891 Monitoring Interfaces and Openstack Support
892 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
893 .. Figure:: monitoring_interfaces.png
895 Monitoring Interfaces and Openstack Support
897 The figure above shows the DPDK L2 forwarding application running on a compute
898 node, sending and receiving traffic. collectd is also running on this compute
899 node retrieving the stats periodically from DPDK through the dpdkstat plugin
900 and publishing the retrieved stats to Ceilometer through the ceilometer plugin.
902 To see this demo in action please checkout: `Barometer OPNFV Summit demo`_
906 .. [1] https://collectd.org/wiki/index.php/Naming_schema
907 .. [2] https://github.com/collectd/collectd/blob/master/src/daemon/plugin.h
908 .. [3] https://collectd.org/wiki/index.php/Value_list_t
909 .. [4] https://collectd.org/wiki/index.php/Data_set
910 .. [5] https://collectd.org/documentation/manpages/types.db.5.shtml
911 .. [6] https://collectd.org/wiki/index.php/Data_source
912 .. [7] https://collectd.org/wiki/index.php/Meta_Data_Interface
914 .. _Barometer OPNFV Summit demo: https://prezi.com/kjv6o8ixs6se/software-fastpath-service-quality-metrics-demo/
915 .. _ceilometer plugin: https://github.com/openstack/collectd-ceilometer-plugin/tree/stable/mitaka