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 retrieves 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 * `gnocchi plugin`_: A write plugin that pushes the retrieved stats to
34 Gnocchi. It's capable of pushing any stats read through collectd to
35 Gnocchi, not just the DPDK stats.
37 * `aodh plugin`_: A notification plugin that pushes events to Aodh, and
38 creates/updates alarms appropriately.
40 * *hugepages plugin*: A read plugin that retrieves the number of available
41 and free hugepages on a platform as well as what is available in terms of
44 * *Open vSwitch events Plugin*: A read plugin that retrieves events from OVS.
46 * *Open vSwitch stats Plugin*: A read plugin that retrieves flow and interface
49 * *mcelog plugin*: A read plugin that uses mcelog client protocol to check for
50 memory Machine Check Exceptions and sends the stats for reported exceptions.
52 * *PMU plugin*: A read plugin that provides performance counters data on
53 Intel CPUs using Linux perf interface.
55 * *RDT plugin*: A read plugin that provides the last level cache utilization and
56 memory bandwidth utilization.
58 * *virt*: A read plugin that uses virtualization API *libvirt* to gather
59 statistics about virtualized guests on a system directly from the hypervisor,
60 without a need to install collectd instance on the guest.
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 All the plugins above are available on the collectd master, except for the
70 Gnocchi and Aodh plugins as they are Python-based plugins and only C plugins
71 are accepted by the collectd community. The Gnocchi and Aodh plugins live in
72 the OpenStack repositories.
74 Other plugins existing as a pull request into collectd master:
76 * *Legacy/IPMI*: A read plugin that reports platform thermals, voltages,
77 fanspeed, current, flow, power etc. Also, the plugin monitors Intelligent
78 Platform Management Interface (IPMI) System Event Log (SEL) and sends the
79 appropriate notifications based on monitored SEL events.
81 * *PCIe AER*: A read plugin that monitors PCIe standard and advanced errors and
82 sends notifications about those errors.
85 Third party application in Barometer repository:
87 * *Open vSwitch PMD stats*: An aplication that retrieves PMD stats from OVS. It is run
90 **Plugins and application included in the Euphrates release:**
92 Write Plugins: aodh plugin, SNMP agent plugin, gnocchi plugin.
94 Read Plugins/application: Intel RDT plugin, virt plugin, Open vSwitch stats plugin,
95 Open vSwitch PMD stats application.
97 Collectd capabilities and usage
98 ------------------------------------
99 .. Describe the specific capabilities and usage for <XYZ> feature.
100 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
102 .. note:: Plugins included in the OPNFV E release will be built-in for Apex integration
103 and can be configured as shown in the examples below.
105 The collectd plugins in OPNFV are configured with reasonable defaults, but can
108 Building all Barometer upstreamed plugins from scratch
109 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110 The plugins that have been merged to the collectd master branch can all be
111 built and configured through the barometer repository.
114 * sudo permissions are required to install collectd.
115 * These instructions are for Centos 7.
117 To build all the upstream plugins, clone the barometer repo:
121 $ git clone https://gerrit.opnfv.org/gerrit/barometer
123 To install collectd as a service and install all it's dependencies:
127 $ cd barometer/systems && ./build_base_machine.sh
129 This will install collectd as a service and the base install directory
130 will be /opt/collectd.
132 Sample configuration files can be found in '/opt/collectd/etc/collectd.conf.d'
135 If you don't want to use one of the Barometer plugins, simply remove the
136 sample config file from '/opt/collectd/etc/collectd.conf.d'
138 If you plan on using the Exec plugin (for OVS_PMD_STATS or for executing scripts
139 on notification generation), the plugin requires a non-root user to execute scripts.
140 By default, `collectd_exec` user is used in the exec.conf provided in the sample
141 configurations directory under src/collectd in the Barometer repo. These scripts *DO NOT* create this user.
142 You need to create this user or modify the configuration in the sample configurations directory
143 under src/collectd to use another existing non root user before running build_base_machine.sh.
146 If you are using any Open vSwitch plugins you need to run:
150 $ sudo ovs-vsctl set-manager ptcp:6640
152 After this, you should be able to start collectd as a service
156 $ sudo systemctl status collectd
158 If you want to use granfana to display the metrics you collect, please see:
161 For more information on configuring and installing OpenStack plugins for
162 collectd, check out the `collectd-ceilometer-plugin GSG`_.
164 Below is the per plugin installation and configuration guide, if you only want
165 to install some/particular plugins.
169 Repo: https://github.com/collectd/collectd
173 Dependencies: DPDK (http://dpdk.org/)
175 .. note:: DPDK statistics plugin requires DPDK version 16.04 or later.
177 To build and install DPDK to /usr please see:
178 https://github.com/collectd/collectd/blob/master/docs/BUILD.dpdkstat.md
180 Building and installing collectd:
184 $ git clone https://github.com/collectd/collectd.git
187 $ ./configure --enable-syslog --enable-logfile --enable-debug
191 .. note:: If DPDK was installed in a non standard location you will need to
192 specify paths to the header files and libraries using *LIBDPDK_CPPFLAGS* and
193 *LIBDPDK_LDFLAGS*. You will also need to add the DPDK library symbols to the
194 shared library path using *ldconfig*. Note that this update to the shared
195 library path is not persistant (i.e. it will not survive a reboot).
197 Example of specifying custom paths to DPDK headers and libraries:
201 $ ./configure LIBDPDK_CPPFLAGS="path to DPDK header files" LIBDPDK_LDFLAGS="path to DPDK libraries"
203 This will install collectd to default folder ``/opt/collectd``. The collectd
204 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
205 To configure the dpdkstats plugin you need to modify the configuration file to
213 ProcessType "secondary"
215 EnabledPortMask 0xffff
216 PortName "interface1"
217 PortName "interface2"
221 To configure the dpdkevents plugin you need to modify the configuration file to
226 <LoadPlugin dpdkevents>
230 <Plugin "dpdkevents">
236 <Event "link_status">
237 SendEventsOnUpdate false
238 EnabledPortMask 0xffff
239 SendNotification true
242 SendEventsOnUpdate false
244 KeepAliveShmName "/dpdk_keepalive_shm_name"
245 SendNotification true
249 .. note:: Currently, the DPDK library doesn’t support API to de-initialize
250 the DPDK resources allocated on the initialization. It means, the collectd
251 plugin will not be able to release the allocated DPDK resources
252 (locks/memory/pci bindings etc.) correctly on collectd shutdown or reinitialize
253 the DPDK library if primary DPDK process is restarted. The only way to release
254 those resources is to terminate the process itself. For this reason, the plugin
255 forks off a separate collectd process. This child process becomes a secondary
256 DPDK process which can be run on specific CPU cores configured by user through
257 collectd configuration file (“Coremask” EAL configuration option, the
258 hexadecimal bitmask of the cores to run on).
260 For more information on the plugin parameters, please see:
261 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
263 .. note:: dpdkstat plugin initialization time depends on read interval. It
264 requires 5 read cycles to set up internal buffers and states, during that time
265 no statistics are submitted. Also, if plugin is running and the number of DPDK
266 ports is increased, internal buffers are resized. That requires 3 read cycles
267 and no port statistics are submitted during that time.
269 The Address-Space Layout Randomization (ASLR) security feature in Linux should be
270 disabled, in order for the same hugepage memory mappings to be present in all
271 DPDK multi-process applications.
277 $ sudo echo 0 > /proc/sys/kernel/randomize_va_space
279 To fully enable ASLR:
283 $ sudo echo 2 > /proc/sys/kernel/randomize_va_space
285 .. warning:: Disabling Address-Space Layout Randomization (ASLR) may have security
286 implications. It is recommended to be disabled only when absolutely necessary,
287 and only when all implications of this change have been understood.
289 For more information on multi-process support, please see:
290 http://dpdk.org/doc/guides/prog_guide/multi_proc_support.html
292 **DPDK stats plugin limitations:**
294 1. The DPDK primary process application should use the same version of DPDK
295 that collectd DPDK plugin is using;
297 2. L2 statistics are only supported;
299 3. The plugin has been tested on Intel NIC’s only.
301 **DPDK stats known issues:**
303 * DPDK port visibility
305 When network port controlled by Linux is bound to DPDK driver, the port
306 will not be available in the OS. It affects the SNMP write plugin as those
307 ports will not be present in standard IF-MIB. Thus, additional work is
308 required to be done to support DPDK ports and statistics.
312 Repo: https://github.com/collectd/collectd
316 Dependencies: None, but assumes hugepages are configured.
318 To configure some hugepages:
322 $ sudo mkdir -p /mnt/huge
323 $ sudo mount -t hugetlbfs nodev /mnt/huge
324 $ sudo echo 14336 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
326 Building and installing collectd:
330 $ git clone https://github.com/collectd/collectd.git
333 $ ./configure --enable-syslog --enable-logfile --enable-hugepages --enable-debug
337 This will install collectd to default folder ``/opt/collectd``. The collectd
338 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
339 To configure the hugepages plugin you need to modify the configuration file to
350 ValuesPercentage false
353 For more information on the plugin parameters, please see:
354 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
358 Repo: https://github.com/collectd/collectd
364 * PMU tools (jevents library) https://github.com/andikleen/pmu-tools
366 To be suitable for use in collectd plugin shared library *libjevents* should be
367 compiled as position-independent code. To do this add the following line to
368 *pmu-tools/jevents/Makefile*:
374 Building and installing *jevents* library:
378 $ git clone https://github.com/andikleen/pmu-tools.git
379 $ cd pmu-tools/jevents/
383 Building and installing collectd:
387 $ git clone https://github.com/collectd/collectd.git
390 $ ./configure --enable-syslog --enable-logfile --with-libjevents=/usr/local --enable-debug
394 This will install collectd to default folder ``/opt/collectd``. The collectd
395 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
396 To configure the PMU plugin you need to modify the configuration file to
401 <LoadPlugin intel_pmu>
405 ReportHardwareCacheEvents true
406 ReportKernelPMUEvents true
407 ReportSoftwareEvents true
410 For more information on the plugin parameters, please see:
411 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
415 The plugin opens file descriptors whose quantity depends on number of
416 monitored CPUs and number of monitored counters. Depending on configuration,
417 it might be required to increase the limit on the number of open file
418 descriptors allowed. This can be done using 'ulimit -n' command. If collectd
419 is executed as a service 'LimitNOFILE=' directive should be defined in
420 [Service] section of *collectd.service* file.
424 Repo: https://github.com/collectd/collectd
430 * PQoS/Intel RDT library https://github.com/01org/intel-cmt-cat.git
433 Building and installing PQoS/Intel RDT library:
437 $ git clone https://github.com/01org/intel-cmt-cat.git
440 $ make install PREFIX=/usr
442 You will need to insert the msr kernel module:
448 Building and installing collectd:
452 $ git clone https://github.com/collectd/collectd.git
455 $ ./configure --enable-syslog --enable-logfile --with-libpqos=/usr/ --enable-debug
459 This will install collectd to default folder ``/opt/collectd``. The collectd
460 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
461 To configure the RDT plugin you need to modify the configuration file to
466 <LoadPlugin intel_rdt>
473 For more information on the plugin parameters, please see:
474 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
478 Repo: https://github.com/maryamtahhan/collectd
480 Branch: feat_ipmi_events, feat_ipmi_analog
482 Dependencies: OpenIPMI library (http://openipmi.sourceforge.net/)
484 The IPMI plugin is already implemented in the latest collectd and sensors
485 like temperature, voltage, fanspeed, current are already supported there.
486 The list of supported IPMI sensors has been extended and sensors like flow,
487 power are supported now. Also, a System Event Log (SEL) notification feature
490 * The feat_ipmi_events branch includes new SEL feature support in collectd
491 IPMI plugin. If this feature is enabled, the collectd IPMI plugin will
492 dispatch notifications about new events in System Event Log.
494 * The feat_ipmi_analog branch includes the support of extended IPMI sensors in
495 collectd IPMI plugin.
497 **Install dependencies**
499 On Centos, install OpenIPMI library:
503 $ sudo yum install OpenIPMI ipmitool
505 Anyway, it's recommended to use the latest version of the OpenIPMI library as
506 it includes fixes of known issues which aren't included in standard OpenIPMI
507 library package. The latest version of the library can be found at
508 https://sourceforge.net/p/openipmi/code/ci/master/tree/. Steps to install the
509 library from sources are described below.
511 Remove old version of OpenIPMI library:
515 $ sudo yum remove OpenIPMI ipmitool
517 Download OpenIPMI library sources:
521 $ git clone https://git.code.sf.net/p/openipmi/code openipmi-code
524 Patch the OpenIPMI pkg-config file to provide correct compilation flags
525 for collectd IPMI plugin:
529 diff --git a/OpenIPMIpthread.pc.in b/OpenIPMIpthread.pc.in
530 index 59b52e5..fffa0d0 100644
531 --- a/OpenIPMIpthread.pc.in
532 +++ b/OpenIPMIpthread.pc.in
533 @@ -6,6 +6,6 @@ includedir=@includedir@
534 Name: OpenIPMIpthread
535 Description: Pthread OS handler for OpenIPMI
537 -Requires: OpenIPMI pthread
539 Libs: -L${libdir} -lOpenIPMIutils -lOpenIPMIpthread
540 -Cflags: -I${includedir}
541 +Cflags: -I${includedir} -pthread
543 Build and install OpenIPMI library:
547 $ autoreconf --install
548 $ ./configure --prefix=/usr
552 Enable IPMI support in the kernel:
556 $ sudo modprobe ipmi_devintf
557 $ sudo modprobe ipmi_si
560 If HW supports IPMI, the ``/dev/ipmi0`` character device will be
563 Clone and install the collectd IPMI plugin:
567 $ git clone https://github.com/maryamtahhan/collectd
569 $ git checkout $BRANCH
571 $ ./configure --enable-syslog --enable-logfile --enable-debug
575 Where $BRANCH is feat_ipmi_events or feat_ipmi_analog.
577 This will install collectd to default folder ``/opt/collectd``. The collectd
578 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
579 To configure the IPMI plugin you need to modify the file to include:
585 SELEnabled true # only feat_ipmi_events branch supports this
589 By default, IPMI plugin will read all available analog sensor values,
590 dispatch the values to collectd and send SEL notifications.
592 For more information on the IPMI plugin parameters and SEL feature configuration,
594 https://github.com/maryamtahhan/collectd/blob/feat_ipmi_events/src/collectd.conf.pod
596 Extended analog sensors support doesn't require additional configuration. The usual
597 collectd IPMI documentation can be used:
599 - https://collectd.org/wiki/index.php/Plugin:IPMI
600 - https://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_ipmi
604 - https://www.kernel.org/doc/Documentation/IPMI.txt
605 - http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html
609 Repo: https://github.com/collectd/collectd
615 Start by installing mcelog.
618 The kernel has to have CONFIG_X86_MCE enabled. For 32bit kernels you
619 need atleast a 2.6,30 kernel.
625 $ sudo yum install mcelog
631 $ git clone https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git
636 $ cp mcelog.service /etc/systemd/system/
637 $ systemctl enable mcelog.service
638 $ systemctl start mcelog.service
641 Verify you got a /dev/mcelog. You can verify the daemon is running completely
648 This should query the information in the running daemon. If it prints nothing
649 that is fine (no errors logged yet). More info @
650 http://www.mcelog.org/installation.html
652 Modify the mcelog configuration file "/etc/mcelog/mcelog.conf" to include or
657 socket-path = /var/run/mcelog-client
659 dimm-tracking-enabled = yes
660 dmi-prepopulate = yes
661 uc-error-threshold = 1 / 24h
662 ce-error-threshold = 10 / 24h
665 socket-tracking-enabled = yes
666 mem-uc-error-threshold = 100 / 24h
667 mem-ce-error-threshold = 100 / 24h
668 mem-ce-error-log = yes
671 memory-ce-threshold = 10 / 24h
673 memory-ce-action = soft
677 directory = /etc/mcelog
680 Clone and install the collectd mcelog plugin:
684 $ git clone https://github.com/maryamtahhan/collectd
687 $ ./configure --enable-syslog --enable-logfile --enable-debug
691 This will install collectd to default folder ``/opt/collectd``. The collectd
692 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
693 To configure the mcelog plugin you need to modify the configuration file to
702 McelogClientSocket "/var/run/mcelog-client"
705 For more information on the plugin parameters, please see:
706 https://github.com/maryamtahhan/collectd/blob/feat_ras/src/collectd.conf.pod
708 Simulating a Machine Check Exception can be done in one of 3 ways:
710 * Running $make test in the mcelog cloned directory - mcelog test suite
714 **mcelog test suite:**
716 It is always a good idea to test an error handling mechanism before it is
717 really needed. mcelog includes a test suite. The test suite relies on
718 mce-inject which needs to be installed and in $PATH.
720 You also need the mce-inject kernel module configured (with
721 CONFIG_X86_MCE_INJECT=y), compiled, installed and loaded:
725 $ modprobe mce-inject
727 Then you can run the mcelog test suite with
733 This will inject different classes of errors and check that the mcelog triggers
734 runs. There will be some kernel messages about page offlining attempts. The
735 test will also lose a few pages of memory in your system (not significant).
737 This test will kill any running mcelog, which needs to be restarted
742 A utility to inject corrected, uncorrected and fatal machine check exceptions
746 $ git clone https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git
749 $ modprobe mce-inject
751 Modify the test/corrected script to include the following:
756 STATUS 0xcc00008000010090
762 $ ./mce-inject < test/corrected
765 The uncorrected and fatal scripts under test will cause a platform reset.
766 Only the fatal script generates the memory errors**. In order to quickly
767 emulate uncorrected memory errors and avoid host reboot following test errors
768 from mce-test suite can be injected:
772 $ mce-inject mce-test/cases/coverage/soft-inj/recoverable_ucr/data/srao_mem_scrub
776 In addition a more in-depth test of the Linux kernel machine check facilities
777 can be done with the mce-test test suite. mce-test supports testing uncorrected
778 error handling, real error injection, handling of different soft offlining
779 cases, and other tests.
781 **Corrected memory error injection:**
783 To inject corrected memory errors:
785 * Remove sb_edac and edac_core kernel modules: rmmod sb_edac rmmod edac_core
786 * Insert einj module: modprobe einj param_extension=1
787 * Inject an error by specifying details (last command should be repeated at least two times):
791 $ APEI_IF=/sys/kernel/debug/apei/einj
792 $ echo 0x8 > $APEI_IF/error_type
793 $ echo 0x01f5591000 > $APEI_IF/param1
794 $ echo 0xfffffffffffff000 > $APEI_IF/param2
795 $ echo 1 > $APEI_IF/notrigger
796 $ echo 1 > $APEI_IF/error_inject
798 * Check the MCE statistic: mcelog --client. Check the mcelog log for injected error details: less /var/log/mcelog.
801 ^^^^^^^^^^^^^^^^^^^^^
802 OvS Plugins Repo: https://github.com/collectd/collectd
804 OvS Plugins Branch: master
806 OvS Events MIBs: The SNMP OVS interface link status is provided by standard
807 IF-MIB (http://www.net-snmp.org/docs/mibs/IF-MIB.txt)
809 Dependencies: Open vSwitch, Yet Another JSON Library (https://github.com/lloyd/yajl)
811 On Centos, install the dependencies and Open vSwitch:
815 $ sudo yum install yajl-devel
817 Steps to install Open vSwtich can be found at
818 http://docs.openvswitch.org/en/latest/intro/install/fedora/
820 Start the Open vSwitch service:
824 $ sudo service openvswitch-switch start
826 Configure the ovsdb-server manager:
830 $ sudo ovs-vsctl set-manager ptcp:6640
832 Clone and install the collectd ovs plugin:
838 $ git checkout master
840 $ ./configure --enable-syslog --enable-logfile --enable-debug
844 This will install collectd to default folder ``/opt/collectd``. The collectd
845 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
846 To configure the OVS events plugin you need to modify the configuration file to include:
850 <LoadPlugin ovs_events>
856 Socket "/var/run/openvswitch/db.sock"
857 Interfaces "br0" "veth0"
858 SendNotification true
861 To configure the OVS stats plugin you need to modify the configuration file
866 <LoadPlugin ovs_stats>
872 Socket "/var/run/openvswitch/db.sock"
876 For more information on the plugin parameters, please see:
877 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
881 Repo: https://gerrit.opnfv.org/gerrit/barometer
884 1. Open vSwitch dependencies are installed.
885 2. Open vSwitch service is running.
886 3. Ovsdb-server manager is configured.
887 You can refer `Open vSwitch Plugins`_ section above for each one of them.
889 OVS PMD stats application is run through the exec plugin.
891 To configure the OVS PMD stats application you need to modify the exec plugin configuration
900 Exec "user:group" "<path to ovs_pmd_stat.sh>"
903 .. note:: Exec plugin configuration has to be changed to use appropriate user before starting collectd service.
905 ovs_pmd_stat.sh calls the script for OVS PMD stats application with its argument:
909 sudo python /usr/local/src/ovs_pmd_stats.py" "--socket-pid-file"
910 "/var/run/openvswitch/ovs-vswitchd.pid"
914 Repo: https://github.com/maryamtahhan/collectd/
918 Dependencies: NET-SNMP library
920 Start by installing net-snmp and dependencies.
926 $ sudo yum install net-snmp net-snmp-libs net-snmp-utils net-snmp-devel
927 $ systemctl start snmpd.service
931 Clone and build net-snmp:
935 $ git clone https://github.com/haad/net-snmp.git
937 $ ./configure --with-persistent-directory="/var/net-snmp" --with-systemd --enable-shared --prefix=/usr
946 Copy default configuration to persistent folder:
950 $ cp EXAMPLE.conf /usr/share/snmp/snmpd.conf
952 Set library path and default MIB configuration:
957 $ echo export LD_LIBRARY_PATH=/usr/lib >> .bashrc
958 $ net-snmp-config --default-mibdirs
959 $ net-snmp-config --snmpconfpath
961 Configure snmpd as a service:
966 $ cp ./dist/snmpd.service /etc/systemd/system/
967 $ systemctl enable snmpd.service
968 $ systemctl start snmpd.service
970 Add the following line to snmpd.conf configuration file
971 "/usr/share/snmp/snmpd.conf" to make all OID tree visible for SNMP clients:
975 view systemonly included .1
977 To verify that SNMP is working you can get IF-MIB table using SNMP client
978 to view the list of Linux interfaces:
982 $ snmpwalk -v 2c -c public localhost IF-MIB::interfaces
984 Clone and install the collectd snmp_agent plugin:
988 $ git clone https://github.com/maryamtahhan/collectd
990 $ git checkout feat_snmp
992 $ ./configure --enable-syslog --enable-logfile --enable-debug --enable-snmp --with-libnetsnmp
996 This will install collectd to default folder ``/opt/collectd``. The collectd
997 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
999 **SNMP Agent plugin is a generic plugin and cannot work without configuration**.
1000 To configure the snmp_agent plugin you need to modify the configuration file to
1001 include OIDs mapped to collectd types. The following example maps scalar
1002 memAvailReal OID to value represented as free memory type of memory plugin:
1006 LoadPlugin snmp_agent
1007 <Plugin "snmp_agent">
1008 <Data "memAvailReal">
1012 OIDs "1.3.6.1.4.1.2021.4.6.0"
1018 * Object instance with Counter64 type is not supported in SNMPv1. When GetNext
1019 request is received, Counter64 type objects will be skipped. When Get
1020 request is received for Counter64 type object, the error will be returned.
1021 * Interfaces that are not visible to Linux like DPDK interfaces cannot be
1022 retreived using standard IF-MIB tables.
1024 For more information on the plugin parameters, please see:
1025 https://github.com/maryamtahhan/collectd/blob/feat_snmp/src/collectd.conf.pod
1027 For more details on AgentX subagent, please see:
1028 http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/
1032 Repo: https://github.com/maryamtahhan/collectd
1036 Dependencies: libvirt (https://libvirt.org/), libxml2
1038 On Centos, install the dependencies:
1042 $ sudo yum install libxml2-dev libpciaccess-devel yajl-devel device-mapper-devel
1046 libvirt version in package manager might be quite old and offer only limited
1047 functionality. Hence, building and installing libvirt from sources is recommended.
1048 Detailed instructions can bet found at:
1049 https://libvirt.org/compiling.html
1051 Certain metrics provided by the plugin have a requirement on a minimal version of
1052 the libvirt API. *File system information* statistics require a *Guest Agent (GA)*
1053 to be installed and configured in a VM. User must make sure that installed GA
1054 version supports retrieving file system information. Number of *Performance monitoring events*
1055 metrics depends on running libvirt daemon version.
1057 .. note:: Please keep in mind that RDT metrics (part of *Performance monitoring
1058 events*) have to be supported by hardware. For more details on hardware support,
1060 https://github.com/01org/intel-cmt-cat
1062 Additionally perf metrics **cannot** be collected if *Intel RDT* plugin is enabled.
1064 libvirt version can be checked with following commands:
1069 $ libvirtd --version
1071 .. table:: Extended statistics requirements
1073 +-------------------------------+--------------------------+-------------+
1074 | Statistic | Min. libvirt API version | Requires GA |
1075 +===============================+==========================+=============+
1076 | Domain reason | 0.9.2 | No |
1077 +-------------------------------+--------------------------+-------------+
1078 | Disk errors | 0.9.10 | No |
1079 +-------------------------------+--------------------------+-------------+
1080 | Job statistics | 1.2.9 | No |
1081 +-------------------------------+--------------------------+-------------+
1082 | File system information | 1.2.11 | Yes |
1083 +-------------------------------+--------------------------+-------------+
1084 | Performance monitoring events | 1.3.3 | No |
1085 +-------------------------------+--------------------------+-------------+
1087 Start libvirt daemon:
1091 $ systemctl start libvirtd
1093 Create domain (VM) XML configuration file. For more information on domain XML
1094 format and examples, please see:
1095 https://libvirt.org/formatdomain.html
1097 .. note:: Installing additional hypervisor dependencies might be required before
1098 deploying virtual machine.
1100 Create domain, based on created XML file:
1104 $ virsh define DOMAIN_CFG_FILE.xml
1110 $ virsh start DOMAIN_NAME
1112 Check if domain is running:
1118 Check list of available *Performance monitoring events* and their settings:
1122 $ virsh perf DOMAIN_NAME
1124 Enable or disable *Performance monitoring events* for domain:
1128 $ virsh perf DOMAIN_NAME [--enable | --disable] EVENT_NAME --live
1130 Clone and install the collectd virt plugin:
1137 $ ./configure --enable-syslog --enable-logfile --enable-debug
1141 Where ``$REPO`` is equal to information provided above.
1143 This will install collectd to ``/opt/collectd``. The collectd configuration file
1144 ``collectd.conf`` can be found at ``/opt/collectd/etc``.
1145 To load the virt plugin user needs to modify the configuration file to include:
1151 Additionally, user can specify plugin configuration parameters in this file,
1152 such as connection URL, domain name and much more. By default extended virt plugin
1153 statistics are disabled. They can be enabled with ``ExtraStats`` option.
1159 ExtraStats "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin"
1162 For more information on the plugin parameters, please see:
1163 https://github.com/maryamtahhan/collectd/blob/feat_libvirt_upstream/src/collectd.conf.pod
1165 Installing collectd as a service
1166 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1167 **NOTE**: In an OPNFV installation, collectd is installed and configured as a
1170 Collectd service scripts are available in the collectd/contrib directory.
1171 To install collectd as a service:
1175 $ sudo cp contrib/systemd.collectd.service /etc/systemd/system/
1176 $ cd /etc/systemd/system/
1177 $ sudo mv systemd.collectd.service collectd.service
1178 $ sudo chmod +x collectd.service
1180 Modify collectd.service
1185 ExecStart=/opt/collectd/sbin/collectd
1186 EnvironmentFile=-/opt/collectd/etc/
1187 EnvironmentFile=-/opt/collectd/etc/
1188 CapabilityBoundingSet=CAP_SETUID CAP_SETGID
1194 $ sudo systemctl daemon-reload
1195 $ sudo systemctl start collectd.service
1196 $ sudo systemctl status collectd.service should show success
1198 Additional useful plugins
1199 ^^^^^^^^^^^^^^^^^^^^^^^^^^
1201 * **Exec Plugin** : Can be used to show you when notifications are being
1202 generated by calling a bash script that dumps notifications to file. (handy
1203 for debug). Modify /opt/collectd/etc/collectd.conf:
1209 # Exec "user:group" "/path/to/exec"
1210 NotificationExec "user" "<path to barometer>/barometer/src/collectd/collectd_sample_configs/write_notification.sh"
1213 write_notification.sh (just writes the notification passed from exec through
1214 STDIN to a file (/tmp/notifications)):
1219 rm -f /tmp/notifications
1222 echo $x$y >> /tmp/notifications
1225 output to /tmp/notifications should look like:
1233 PluginInstance:br-ex
1235 TypeInstance:link_status
1236 uuid:f2aafeec-fa98-4e76-aec5-18ae9fc74589
1238 linkstate of "br-ex" interface has been changed to "DOWN"
1240 * **logfile plugin**: Can be used to log collectd activity. Modify
1241 /opt/collectd/etc/collectd.conf to include:
1248 File "/var/log/collectd.log"
1254 Monitoring Interfaces and Openstack Support
1255 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1256 .. Figure:: monitoring_interfaces.png
1258 Monitoring Interfaces and Openstack Support
1260 The figure above shows the DPDK L2 forwarding application running on a compute
1261 node, sending and receiving traffic. Collectd is also running on this compute
1262 node retrieving the stats periodically from DPDK through the dpdkstat plugin
1263 and publishing the retrieved stats to OpenStack through the
1264 collectd-ceilometer-plugin.
1266 To see this demo in action please checkout: `Barometer OPNFV Summit demo`_
1268 For more information on configuring and installing OpenStack plugins for
1269 collectd, check out the `collectd-ceilometer-plugin GSG`_.
1273 .. [1] https://collectd.org/wiki/index.php/Naming_schema
1274 .. [2] https://github.com/collectd/collectd/blob/master/src/daemon/plugin.h
1275 .. [3] https://collectd.org/wiki/index.php/Value_list_t
1276 .. [4] https://collectd.org/wiki/index.php/Data_set
1277 .. [5] https://collectd.org/documentation/manpages/types.db.5.shtml
1278 .. [6] https://collectd.org/wiki/index.php/Data_source
1279 .. [7] https://collectd.org/wiki/index.php/Meta_Data_Interface
1281 .. _Barometer OPNFV Summit demo: https://prezi.com/kjv6o8ixs6se/software-fastpath-service-quality-metrics-demo/
1282 .. _gnocchi plugin: https://github.com/openstack/collectd-ceilometer-plugin/tree/stable/ocata/
1283 .. _aodh plugin: https://github.com/openstack/collectd-ceilometer-plugin/tree/stable/ocata/
1284 .. _collectd-ceilometer-plugin GSG: https://github.com/openstack/collectd-ceilometer-plugin/blob/master/doc/source/GSG.rst
1285 .. _grafana guide: https://wiki.opnfv.org/display/fastpath/Installing+and+configuring+InfluxDB+and+Grafana+to+display+metrics+with+collectd