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 ===================================
9 Barometer collectd plugins description
10 ---------------------------------------
11 .. Describe the specific features and how it is realised in the scenario in a brief manner
12 .. to ensure the user understand the context for the user guide instructions to follow.
14 Collectd is a daemon which collects system performance statistics periodically
15 and provides a variety of mechanisms to publish the collected metrics. It
16 supports more than 90 different input and output plugins. Input plugins
17 retrieve metrics and publish them to the collectd deamon, while output plugins
18 publish the data they receive to an end point. collectd also has infrastructure
19 to support thresholding and notification.
21 Barometer has enabled the following collectd plugins:
23 * *dpdkstat plugin*: A read plugin that retrieves stats from the DPDK extended
26 * *dpdkevents plugin*: A read plugin that retrieves DPDK link status and DPDK
27 forwarding cores liveliness status (DPDK Keep Alive).
29 * `gnocchi plugin`_: A write plugin that pushes the retrieved stats to
30 Gnocchi. It's capable of pushing any stats read through collectd to
31 Gnocchi, not just the DPDK stats.
33 * `aodh plugin`_: A notification plugin that pushes events to Aodh, and
34 creates/updates alarms appropriately.
36 * *hugepages plugin*: A read plugin that retrieves the number of available
37 and free hugepages on a platform as well as what is available in terms of
40 * *Open vSwitch events Plugin*: A read plugin that retrieves events from OVS.
42 * *Open vSwitch stats Plugin*: A read plugin that retrieves flow and interface
45 * *mcelog plugin*: A read plugin that uses mcelog client protocol to check for
46 memory Machine Check Exceptions and sends the stats for reported exceptions.
48 * *PMU plugin*: A read plugin that provides performance counters data on
49 Intel CPUs using Linux perf interface.
51 * *RDT plugin*: A read plugin that provides the last level cache utilization and
52 memory bandwidth utilization.
54 * *virt*: A read plugin that uses virtualization API *libvirt* to gather
55 statistics about virtualized guests on a system directly from the hypervisor,
56 without a need to install collectd instance on the guest.
58 * *SNMP Agent*: A write plugin that will act as a AgentX subagent that receives
59 and handles queries from SNMP master agent and returns the data collected
60 by read plugins. The SNMP Agent plugin handles requests only for OIDs
61 specified in configuration file. To handle SNMP queries the plugin gets data
62 from collectd and translates requested values from collectd's internal format
63 to SNMP format. Supports SNMP: get, getnext and walk requests.
65 All the plugins above are available on the collectd master, except for the
66 Gnocchi and Aodh plugins as they are Python-based plugins and only C plugins
67 are accepted by the collectd community. The Gnocchi and Aodh plugins live in
68 the OpenStack repositories.
70 Other plugins existing as a pull request into collectd master:
72 * *Legacy/IPMI*: A read plugin that reports platform thermals, voltages,
73 fanspeed, current, flow, power etc. Also, the plugin monitors Intelligent
74 Platform Management Interface (IPMI) System Event Log (SEL) and sends the
75 appropriate notifications based on monitored SEL events.
77 * *PCIe AER*: A read plugin that monitors PCIe standard and advanced errors and
78 sends notifications about those errors.
81 Third party application in Barometer repository:
83 * *Open vSwitch PMD stats*: An aplication that retrieves PMD stats from OVS. It is run
86 **Plugins and application included in the Euphrates release:**
88 Write Plugins: aodh plugin, SNMP agent plugin, gnocchi plugin.
90 Read Plugins/application: Intel RDT plugin, virt plugin, Open vSwitch stats plugin,
91 Open vSwitch PMD stats application.
93 Collectd capabilities and usage
94 ------------------------------------
95 .. Describe the specific capabilities and usage for <XYZ> feature.
96 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
98 .. note:: Plugins included in the OPNFV E release will be built-in for Apex integration
99 and can be configured as shown in the examples below.
101 The collectd plugins in OPNFV are configured with reasonable defaults, but can
104 Building all Barometer upstreamed plugins from scratch
105 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106 The plugins that have been merged to the collectd master branch can all be
107 built and configured through the barometer repository.
110 * sudo permissions are required to install collectd.
111 * These instructions are for Centos 7.
113 To build all the upstream plugins, clone the barometer repo:
117 $ git clone https://gerrit.opnfv.org/gerrit/barometer
119 To install collectd as a service and install all it's dependencies:
123 $ cd barometer/systems && ./build_base_machine.sh
125 This will install collectd as a service and the base install directory
126 will be /opt/collectd.
128 Sample configuration files can be found in '/opt/collectd/etc/collectd.conf.d'
131 If you don't want to use one of the Barometer plugins, simply remove the
132 sample config file from '/opt/collectd/etc/collectd.conf.d'
134 If you plan on using the Exec plugin (for OVS_PMD_STATS or for executing scripts
135 on notification generation), the plugin requires a non-root user to execute scripts.
136 By default, `collectd_exec` user is used in the exec.conf provided in the sample
137 configurations directory under src/collectd in the Barometer repo. These scripts *DO NOT* create this user.
138 You need to create this user or modify the configuration in the sample configurations directory
139 under src/collectd to use another existing non root user before running build_base_machine.sh.
142 If you are using any Open vSwitch plugins you need to run:
146 $ sudo ovs-vsctl set-manager ptcp:6640
148 After this, you should be able to start collectd as a service
152 $ sudo systemctl status collectd
154 If you want to use granfana to display the metrics you collect, please see:
157 For more information on configuring and installing OpenStack plugins for
158 collectd, check out the `collectd-ceilometer-plugin GSG`_.
160 Below is the per plugin installation and configuration guide, if you only want
161 to install some/particular plugins.
165 Repo: https://github.com/collectd/collectd
169 Dependencies: DPDK (http://dpdk.org/)
171 .. note:: DPDK statistics plugin requires DPDK version 16.04 or later.
173 To build and install DPDK to /usr please see:
174 https://github.com/collectd/collectd/blob/master/docs/BUILD.dpdkstat.md
176 Building and installing collectd:
180 $ git clone https://github.com/collectd/collectd.git
183 $ ./configure --enable-syslog --enable-logfile --enable-debug
187 .. note:: If DPDK was installed in a non standard location you will need to
188 specify paths to the header files and libraries using *LIBDPDK_CPPFLAGS* and
189 *LIBDPDK_LDFLAGS*. You will also need to add the DPDK library symbols to the
190 shared library path using *ldconfig*. Note that this update to the shared
191 library path is not persistant (i.e. it will not survive a reboot).
193 Example of specifying custom paths to DPDK headers and libraries:
197 $ ./configure LIBDPDK_CPPFLAGS="path to DPDK header files" LIBDPDK_LDFLAGS="path to DPDK libraries"
199 This will install collectd to default folder ``/opt/collectd``. The collectd
200 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
201 To configure the dpdkstats plugin you need to modify the configuration file to
209 ProcessType "secondary"
211 EnabledPortMask 0xffff
212 PortName "interface1"
213 PortName "interface2"
217 To configure the dpdkevents plugin you need to modify the configuration file to
222 <LoadPlugin dpdkevents>
226 <Plugin "dpdkevents">
232 <Event "link_status">
233 SendEventsOnUpdate false
234 EnabledPortMask 0xffff
235 SendNotification true
238 SendEventsOnUpdate false
240 KeepAliveShmName "/dpdk_keepalive_shm_name"
241 SendNotification true
245 .. note:: Currently, the DPDK library doesn’t support API to de-initialize
246 the DPDK resources allocated on the initialization. It means, the collectd
247 plugin will not be able to release the allocated DPDK resources
248 (locks/memory/pci bindings etc.) correctly on collectd shutdown or reinitialize
249 the DPDK library if primary DPDK process is restarted. The only way to release
250 those resources is to terminate the process itself. For this reason, the plugin
251 forks off a separate collectd process. This child process becomes a secondary
252 DPDK process which can be run on specific CPU cores configured by user through
253 collectd configuration file (“Coremask” EAL configuration option, the
254 hexadecimal bitmask of the cores to run on).
256 For more information on the plugin parameters, please see:
257 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
259 .. note:: dpdkstat plugin initialization time depends on read interval. It
260 requires 5 read cycles to set up internal buffers and states, during that time
261 no statistics are submitted. Also, if plugin is running and the number of DPDK
262 ports is increased, internal buffers are resized. That requires 3 read cycles
263 and no port statistics are submitted during that time.
265 The Address-Space Layout Randomization (ASLR) security feature in Linux should be
266 disabled, in order for the same hugepage memory mappings to be present in all
267 DPDK multi-process applications.
273 $ sudo echo 0 > /proc/sys/kernel/randomize_va_space
275 To fully enable ASLR:
279 $ sudo echo 2 > /proc/sys/kernel/randomize_va_space
281 .. warning:: Disabling Address-Space Layout Randomization (ASLR) may have security
282 implications. It is recommended to be disabled only when absolutely necessary,
283 and only when all implications of this change have been understood.
285 For more information on multi-process support, please see:
286 http://dpdk.org/doc/guides/prog_guide/multi_proc_support.html
288 **DPDK stats plugin limitations:**
290 1. The DPDK primary process application should use the same version of DPDK
291 that collectd DPDK plugin is using;
293 2. L2 statistics are only supported;
295 3. The plugin has been tested on Intel NIC’s only.
297 **DPDK stats known issues:**
299 * DPDK port visibility
301 When network port controlled by Linux is bound to DPDK driver, the port
302 will not be available in the OS. It affects the SNMP write plugin as those
303 ports will not be present in standard IF-MIB. Thus, additional work is
304 required to be done to support DPDK ports and statistics.
308 Repo: https://github.com/collectd/collectd
312 Dependencies: None, but assumes hugepages are configured.
314 To configure some hugepages:
318 $ sudo mkdir -p /mnt/huge
319 $ sudo mount -t hugetlbfs nodev /mnt/huge
320 $ sudo bash -c "echo 14336 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages"
322 Building and installing collectd:
326 $ git clone https://github.com/collectd/collectd.git
329 $ ./configure --enable-syslog --enable-logfile --enable-hugepages --enable-debug
333 This will install collectd to default folder ``/opt/collectd``. The collectd
334 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
335 To configure the hugepages plugin you need to modify the configuration file to
346 ValuesPercentage false
349 For more information on the plugin parameters, please see:
350 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
354 Repo: https://github.com/collectd/collectd
360 * PMU tools (jevents library) https://github.com/andikleen/pmu-tools
362 To be suitable for use in collectd plugin shared library *libjevents* should be
363 compiled as position-independent code. To do this add the following line to
364 *pmu-tools/jevents/Makefile*:
370 Building and installing *jevents* library:
374 $ git clone https://github.com/andikleen/pmu-tools.git
375 $ cd pmu-tools/jevents/
379 Building and installing collectd:
383 $ git clone https://github.com/collectd/collectd.git
386 $ ./configure --enable-syslog --enable-logfile --with-libjevents=/usr/local --enable-debug
390 This will install collectd to default folder ``/opt/collectd``. The collectd
391 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
392 To configure the PMU plugin you need to modify the configuration file to
397 <LoadPlugin intel_pmu>
401 ReportHardwareCacheEvents true
402 ReportKernelPMUEvents true
403 ReportSoftwareEvents true
406 For more information on the plugin parameters, please see:
407 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
411 The plugin opens file descriptors whose quantity depends on number of
412 monitored CPUs and number of monitored counters. Depending on configuration,
413 it might be required to increase the limit on the number of open file
414 descriptors allowed. This can be done using 'ulimit -n' command. If collectd
415 is executed as a service 'LimitNOFILE=' directive should be defined in
416 [Service] section of *collectd.service* file.
420 Repo: https://github.com/collectd/collectd
426 * PQoS/Intel RDT library https://github.com/01org/intel-cmt-cat.git
429 Building and installing PQoS/Intel RDT library:
433 $ git clone https://github.com/01org/intel-cmt-cat.git
436 $ make install PREFIX=/usr
438 You will need to insert the msr kernel module:
444 Building and installing collectd:
448 $ git clone https://github.com/collectd/collectd.git
451 $ ./configure --enable-syslog --enable-logfile --with-libpqos=/usr/ --enable-debug
455 This will install collectd to default folder ``/opt/collectd``. The collectd
456 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
457 To configure the RDT plugin you need to modify the configuration file to
462 <LoadPlugin intel_rdt>
469 For more information on the plugin parameters, please see:
470 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
474 Repo: https://github.com/collectd/collectd
476 Branch: feat_ipmi_events, feat_ipmi_analog
478 Dependencies: OpenIPMI library (http://openipmi.sourceforge.net/)
480 The IPMI plugin is already implemented in the latest collectd and sensors
481 like temperature, voltage, fanspeed, current are already supported there.
482 The list of supported IPMI sensors has been extended and sensors like flow,
483 power are supported now. Also, a System Event Log (SEL) notification feature
486 * The feat_ipmi_events branch includes new SEL feature support in collectd
487 IPMI plugin. If this feature is enabled, the collectd IPMI plugin will
488 dispatch notifications about new events in System Event Log.
490 * The feat_ipmi_analog branch includes the support of extended IPMI sensors in
491 collectd IPMI plugin.
493 **Install dependencies**
495 On Centos, install OpenIPMI library:
499 $ sudo yum install OpenIPMI ipmitool
501 Anyway, it's recommended to use the latest version of the OpenIPMI library as
502 it includes fixes of known issues which aren't included in standard OpenIPMI
503 library package. The latest version of the library can be found at
504 https://sourceforge.net/p/openipmi/code/ci/master/tree/. Steps to install the
505 library from sources are described below.
507 Remove old version of OpenIPMI library:
511 $ sudo yum remove OpenIPMI ipmitool
513 Build and install OpenIPMI library:
517 $ git clone https://git.code.sf.net/p/openipmi/code openipmi-code
519 $ autoreconf --install
520 $ ./configure --prefix=/usr
524 Add the directory containing ``OpenIPMI*.pc`` files to the ``PKG_CONFIG_PATH``
525 environment variable:
529 export PKG_CONFIG_PATH=/usr/lib/pkgconfig
531 Enable IPMI support in the kernel:
535 $ sudo modprobe ipmi_devintf
536 $ sudo modprobe ipmi_si
539 If HW supports IPMI, the ``/dev/ipmi0`` character device will be
542 Clone and install the collectd IPMI plugin:
546 $ git clone https://github.com/collectd/collectd
549 $ ./configure --enable-syslog --enable-logfile --enable-debug
553 This will install collectd to default folder ``/opt/collectd``. The collectd
554 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
555 To configure the IPMI plugin you need to modify the file to include:
562 SELEnabled true # only feat_ipmi_events branch supports this
567 By default, IPMI plugin will read all available analog sensor values,
568 dispatch the values to collectd and send SEL notifications.
570 For more information on the IPMI plugin parameters and SEL feature configuration,
571 please see: https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
573 Extended analog sensors support doesn't require additional configuration. The usual
574 collectd IPMI documentation can be used:
576 - https://collectd.org/wiki/index.php/Plugin:IPMI
577 - https://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_ipmi
581 - https://www.kernel.org/doc/Documentation/IPMI.txt
582 - http://www.intel.com/content/www/us/en/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html
586 Repo: https://github.com/collectd/collectd
592 Start by installing mcelog.
595 The kernel has to have CONFIG_X86_MCE enabled. For 32bit kernels you
596 need atleast a 2.6,30 kernel.
602 $ sudo yum install mcelog
608 $ git clone https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git
613 $ cp mcelog.service /etc/systemd/system/
614 $ systemctl enable mcelog.service
615 $ systemctl start mcelog.service
618 Verify you got a /dev/mcelog. You can verify the daemon is running completely
625 This should query the information in the running daemon. If it prints nothing
626 that is fine (no errors logged yet). More info @
627 http://www.mcelog.org/installation.html
629 Modify the mcelog configuration file "/etc/mcelog/mcelog.conf" to include or
634 socket-path = /var/run/mcelog-client
636 dimm-tracking-enabled = yes
637 dmi-prepopulate = yes
638 uc-error-threshold = 1 / 24h
639 ce-error-threshold = 10 / 24h
642 socket-tracking-enabled = yes
643 mem-uc-error-threshold = 100 / 24h
644 mem-ce-error-threshold = 100 / 24h
645 mem-ce-error-log = yes
648 memory-ce-threshold = 10 / 24h
650 memory-ce-action = soft
654 directory = /etc/mcelog
657 Clone and install the collectd mcelog plugin:
661 $ git clone https://github.com/collectd/collectd
664 $ ./configure --enable-syslog --enable-logfile --enable-debug
668 This will install collectd to default folder ``/opt/collectd``. The collectd
669 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
670 To configure the mcelog plugin you need to modify the configuration file to
680 McelogClientSocket "/var/run/mcelog-client"
681 PersistentNotification false
683 #McelogLogfile "/var/log/mcelog"
686 For more information on the plugin parameters, please see:
687 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
689 Simulating a Machine Check Exception can be done in one of 3 ways:
691 * Running $make test in the mcelog cloned directory - mcelog test suite
695 **mcelog test suite:**
697 It is always a good idea to test an error handling mechanism before it is
698 really needed. mcelog includes a test suite. The test suite relies on
699 mce-inject which needs to be installed and in $PATH.
701 You also need the mce-inject kernel module configured (with
702 CONFIG_X86_MCE_INJECT=y), compiled, installed and loaded:
706 $ modprobe mce-inject
708 Then you can run the mcelog test suite with
714 This will inject different classes of errors and check that the mcelog triggers
715 runs. There will be some kernel messages about page offlining attempts. The
716 test will also lose a few pages of memory in your system (not significant).
719 This test will kill any running mcelog, which needs to be restarted
724 A utility to inject corrected, uncorrected and fatal machine check exceptions
728 $ git clone https://git.kernel.org/pub/scm/utils/cpu/mce/mce-inject.git
731 $ modprobe mce-inject
733 Modify the test/corrected script to include the following:
738 STATUS 0xcc00008000010090
744 $ ./mce-inject < test/corrected
747 The uncorrected and fatal scripts under test will cause a platform reset.
748 Only the fatal script generates the memory errors**. In order to quickly
749 emulate uncorrected memory errors and avoid host reboot following test errors
750 from mce-test suite can be injected:
754 $ mce-inject mce-test/cases/coverage/soft-inj/recoverable_ucr/data/srao_mem_scrub
758 In addition a more in-depth test of the Linux kernel machine check facilities
759 can be done with the mce-test test suite. mce-test supports testing uncorrected
760 error handling, real error injection, handling of different soft offlining
761 cases, and other tests.
763 **Corrected memory error injection:**
765 To inject corrected memory errors:
767 * Remove sb_edac and edac_core kernel modules: rmmod sb_edac rmmod edac_core
768 * Insert einj module: modprobe einj param_extension=1
769 * Inject an error by specifying details (last command should be repeated at least two times):
773 $ APEI_IF=/sys/kernel/debug/apei/einj
774 $ echo 0x8 > $APEI_IF/error_type
775 $ echo 0x01f5591000 > $APEI_IF/param1
776 $ echo 0xfffffffffffff000 > $APEI_IF/param2
777 $ echo 1 > $APEI_IF/notrigger
778 $ echo 1 > $APEI_IF/error_inject
780 * Check the MCE statistic: mcelog --client. Check the mcelog log for injected error details: less /var/log/mcelog.
783 ^^^^^^^^^^^^^^^^^^^^^
784 OvS Plugins Repo: https://github.com/collectd/collectd
786 OvS Plugins Branch: master
788 OvS Events MIBs: The SNMP OVS interface link status is provided by standard
789 IF-MIB (http://www.net-snmp.org/docs/mibs/IF-MIB.txt)
791 Dependencies: Open vSwitch, Yet Another JSON Library (https://github.com/lloyd/yajl)
793 On Centos, install the dependencies and Open vSwitch:
797 $ sudo yum install yajl-devel
799 Steps to install Open vSwtich can be found at
800 http://docs.openvswitch.org/en/latest/intro/install/fedora/
802 Start the Open vSwitch service:
806 $ sudo service openvswitch-switch start
808 Configure the ovsdb-server manager:
812 $ sudo ovs-vsctl set-manager ptcp:6640
814 Clone and install the collectd ovs plugin:
820 $ git checkout master
822 $ ./configure --enable-syslog --enable-logfile --enable-debug
826 This will install collectd to default folder ``/opt/collectd``. The collectd
827 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
828 To configure the OVS events plugin you need to modify the configuration file to include:
832 <LoadPlugin ovs_events>
838 Socket "/var/run/openvswitch/db.sock"
839 Interfaces "br0" "veth0"
840 SendNotification true
843 To configure the OVS stats plugin you need to modify the configuration file
848 <LoadPlugin ovs_stats>
854 Socket "/var/run/openvswitch/db.sock"
858 For more information on the plugin parameters, please see:
859 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
863 Repo: https://gerrit.opnfv.org/gerrit/barometer
866 1. Open vSwitch dependencies are installed.
867 2. Open vSwitch service is running.
868 3. Ovsdb-server manager is configured.
869 You can refer `Open vSwitch Plugins`_ section above for each one of them.
871 OVS PMD stats application is run through the exec plugin.
873 To configure the OVS PMD stats application you need to modify the exec plugin configuration
882 Exec "user:group" "<path to ovs_pmd_stat.sh>"
885 .. note:: Exec plugin configuration has to be changed to use appropriate user before starting collectd service.
887 ovs_pmd_stat.sh calls the script for OVS PMD stats application with its argument:
891 sudo python /usr/local/src/ovs_pmd_stats.py" "--socket-pid-file"
892 "/var/run/openvswitch/ovs-vswitchd.pid"
896 Repo: https://github.com/collectd/collectd
900 Dependencies: NET-SNMP library
902 Start by installing net-snmp and dependencies.
908 $ sudo yum install net-snmp net-snmp-libs net-snmp-utils net-snmp-devel
909 $ sudo systemctl start snmpd.service
911 go to the `snmp configuration`_ steps.
915 Clone and build net-snmp:
919 $ git clone https://github.com/haad/net-snmp.git
921 $ ./configure --with-persistent-directory="/var/net-snmp" --with-systemd --enable-shared --prefix=/usr
930 Copy default configuration to persistent folder:
934 $ cp EXAMPLE.conf /usr/share/snmp/snmpd.conf
936 Set library path and default MIB configuration:
941 $ echo export LD_LIBRARY_PATH=/usr/lib >> .bashrc
942 $ net-snmp-config --default-mibdirs
943 $ net-snmp-config --snmpconfpath
945 Configure snmpd as a service:
950 $ cp ./dist/snmpd.service /etc/systemd/system/
951 $ systemctl enable snmpd.service
952 $ systemctl start snmpd.service
954 .. _`snmp configuration`:
956 Add the following line to snmpd.conf configuration file
957 ``/etc/snmp/snmpd.conf`` to make all OID tree visible for SNMP clients:
961 view systemview included .1
963 To verify that SNMP is working you can get IF-MIB table using SNMP client
964 to view the list of Linux interfaces:
968 $ snmpwalk -v 2c -c public localhost IF-MIB::interfaces
970 Get the default MIB location:
974 $ net-snmp-config --default-mibdirs
975 /opt/stack/.snmp/mibs:/usr/share/snmp/mibs
977 Install Intel specific MIBs (if needed) into location received by
978 ``net-snmp-config`` command (e.g. ``/usr/share/snmp/mibs``).
982 $ git clone https://gerrit.opnfv.org/gerrit/barometer.git
983 $ sudo cp -f barometer/mibs/*.txt /usr/share/snmp/mibs/
984 $ sudo systemctl restart snmpd.service
986 Clone and install the collectd snmp_agent plugin:
991 $ git clone https://github.com/collectd/collectd
994 $ ./configure --enable-syslog --enable-logfile --enable-debug --enable-snmp --with-libnetsnmp
998 This will install collectd to default folder ``/opt/collectd``. The collectd
999 configuration file (``collectd.conf``) can be found at ``/opt/collectd/etc``.
1001 **SNMP Agent plugin is a generic plugin and cannot work without configuration**.
1002 To configure the snmp_agent plugin you need to modify the configuration file to
1003 include OIDs mapped to collectd types. The following example maps scalar
1004 memAvailReal OID to value represented as free memory type of memory plugin:
1008 LoadPlugin snmp_agent
1009 <Plugin "snmp_agent">
1010 <Data "memAvailReal">
1014 OIDs "1.3.6.1.4.1.2021.4.6.0"
1019 The ``snmpwalk`` command can be used to validate the collectd configuration:
1023 $ snmpwalk -v 2c -c public localhost 1.3.6.1.4.1.2021.4.6.0
1024 UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 135237632 kB
1029 * Object instance with Counter64 type is not supported in SNMPv1. When GetNext
1030 request is received, Counter64 type objects will be skipped. When Get
1031 request is received for Counter64 type object, the error will be returned.
1032 * Interfaces that are not visible to Linux like DPDK interfaces cannot be
1033 retreived using standard IF-MIB tables.
1035 For more information on the plugin parameters, please see:
1036 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
1038 For more details on AgentX subagent, please see:
1039 http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/
1045 Repo: https://github.com/collectd/collectd
1049 Dependencies: libvirt (https://libvirt.org/), libxml2
1051 On Centos, install the dependencies:
1055 $ sudo yum install libxml2-devel libpciaccess-devel yajl-devel device-mapper-devel
1059 .. note:: libvirt version in package manager might be quite old and offer only
1060 limited functionality. Hence, building and installing libvirt from sources
1061 is recommended. Detailed instructions can bet found at:
1062 https://libvirt.org/compiling.html
1066 $ sudo yum install libvirt-devel
1068 Certain metrics provided by the plugin have a requirement on a minimal version of
1069 the libvirt API. *File system information* statistics require a *Guest Agent (GA)*
1070 to be installed and configured in a VM. User must make sure that installed GA
1071 version supports retrieving file system information. Number of *Performance monitoring events*
1072 metrics depends on running libvirt daemon version.
1074 .. note:: Please keep in mind that RDT metrics (part of *Performance monitoring
1075 events*) have to be supported by hardware. For more details on hardware support,
1077 https://github.com/01org/intel-cmt-cat
1079 Additionally perf metrics **cannot** be collected if *Intel RDT* plugin is enabled.
1081 libvirt version can be checked with following commands:
1086 $ libvirtd --version
1088 .. table:: Extended statistics requirements
1090 +-------------------------------+--------------------------+-------------+
1091 | Statistic | Min. libvirt API version | Requires GA |
1092 +===============================+==========================+=============+
1093 | Domain reason | 0.9.2 | No |
1094 +-------------------------------+--------------------------+-------------+
1095 | Disk errors | 0.9.10 | No |
1096 +-------------------------------+--------------------------+-------------+
1097 | Job statistics | 1.2.9 | No |
1098 +-------------------------------+--------------------------+-------------+
1099 | File system information | 1.2.11 | Yes |
1100 +-------------------------------+--------------------------+-------------+
1101 | Performance monitoring events | 1.3.3 | No |
1102 +-------------------------------+--------------------------+-------------+
1104 Start libvirt daemon:
1108 $ systemctl start libvirtd
1110 Create domain (VM) XML configuration file. For more information on domain XML
1111 format and examples, please see:
1112 https://libvirt.org/formatdomain.html
1114 .. note:: Installing additional hypervisor dependencies might be required before
1115 deploying virtual machine.
1117 Create domain, based on created XML file:
1121 $ virsh define DOMAIN_CFG_FILE.xml
1127 $ virsh start DOMAIN_NAME
1129 Check if domain is running:
1135 Check list of available *Performance monitoring events* and their settings:
1139 $ virsh perf DOMAIN_NAME
1141 Enable or disable *Performance monitoring events* for domain:
1145 $ virsh perf DOMAIN_NAME [--enable | --disable] EVENT_NAME --live
1147 Clone and install the collectd virt plugin:
1154 $ ./configure --enable-syslog --enable-logfile --enable-debug
1158 Where ``$REPO`` is equal to information provided above.
1160 This will install collectd to ``/opt/collectd``. The collectd configuration file
1161 ``collectd.conf`` can be found at ``/opt/collectd/etc``.
1162 To load the virt plugin user needs to modify the configuration file to include:
1168 Additionally, user can specify plugin configuration parameters in this file,
1169 such as connection URL, domain name and much more. By default extended virt plugin
1170 statistics are disabled. They can be enabled with ``ExtraStats`` option.
1176 ExtraStats "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin"
1179 For more information on the plugin parameters, please see:
1180 https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod
1182 .. _install-collectd-as-a-service:
1184 Installing collectd as a service
1185 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1186 **NOTE**: In an OPNFV installation, collectd is installed and configured as a
1189 Collectd service scripts are available in the collectd/contrib directory.
1190 To install collectd as a service:
1194 $ sudo cp contrib/systemd.collectd.service /etc/systemd/system/
1195 $ cd /etc/systemd/system/
1196 $ sudo mv systemd.collectd.service collectd.service
1197 $ sudo chmod +x collectd.service
1199 Modify collectd.service
1204 ExecStart=/opt/collectd/sbin/collectd
1205 EnvironmentFile=-/opt/collectd/etc/
1206 EnvironmentFile=-/opt/collectd/etc/
1207 CapabilityBoundingSet=CAP_SETUID CAP_SETGID
1213 $ sudo systemctl daemon-reload
1214 $ sudo systemctl start collectd.service
1215 $ sudo systemctl status collectd.service should show success
1217 Additional useful plugins
1218 ^^^^^^^^^^^^^^^^^^^^^^^^^^
1220 **Exec Plugin** : Can be used to show you when notifications are being
1221 generated by calling a bash script that dumps notifications to file. (handy
1222 for debug). Modify /opt/collectd/etc/collectd.conf:
1228 # Exec "user:group" "/path/to/exec"
1229 NotificationExec "user" "<path to barometer>/barometer/src/collectd/collectd_sample_configs/write_notification.sh"
1232 write_notification.sh (just writes the notification passed from exec through
1233 STDIN to a file (/tmp/notifications)):
1238 rm -f /tmp/notifications
1241 echo $x$y >> /tmp/notifications
1244 output to /tmp/notifications should look like:
1252 PluginInstance:br-ex
1254 TypeInstance:link_status
1255 uuid:f2aafeec-fa98-4e76-aec5-18ae9fc74589
1257 linkstate of "br-ex" interface has been changed to "DOWN"
1259 * **logfile plugin**: Can be used to log collectd activity. Modify
1260 /opt/collectd/etc/collectd.conf to include:
1267 File "/var/log/collectd.log"
1273 Monitoring Interfaces and Openstack Support
1274 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1275 .. Figure:: monitoring_interfaces.png
1277 Monitoring Interfaces and Openstack Support
1279 The figure above shows the DPDK L2 forwarding application running on a compute
1280 node, sending and receiving traffic. Collectd is also running on this compute
1281 node retrieving the stats periodically from DPDK through the dpdkstat plugin
1282 and publishing the retrieved stats to OpenStack through the
1283 collectd-ceilometer-plugin.
1285 To see this demo in action please checkout: `Barometer OPNFV Summit demo`_
1287 For more information on configuring and installing OpenStack plugins for
1288 collectd, check out the `collectd-ceilometer-plugin GSG`_.
1292 * AAA – on top of collectd there secure agents like SNMP V3, Openstack agents
1293 etc. with their own AAA methods.
1295 * Collectd runs as a daemon with root permissions.
1297 * The `Exec plugin`_ allows the execution of external programs but counters the security
1300 * Ensuring that only one instance of the program is executed by collectd at any time
1301 * Forcing the plugin to check that custom programs are never executed with superuser
1304 * Protection of Data in flight:
1306 * It's recommend to use a minimum version of 4.7 of the Network plugin which provides
1307 the possibility to cryptographically sign or encrypt the network traffic.
1308 * Write Redis plugin or the Write MongoDB plugin are recommended to store the data.
1309 * For more information, please see: https://collectd.org/wiki/index.php?title=Networking_introduction
1311 * Known vulnerabilities include:
1313 * https://www.cvedetails.com/vulnerability-list/vendor_id-11242/Collectd.html
1315 * `CVE-2017-7401`_ fixed https://github.com/collectd/collectd/issues/2174 in Version 5.7.2.
1316 * `CVE-2016-6254`_ fixed https://mailman.verplant.org/pipermail/collectd/2016-July/006838.html
1318 * `CVE-2010-4336`_ fixed https://mailman.verplant.org/pipermail/collectd/2010-November/004277.html
1321 * http://www.cvedetails.com/product/20310/Collectd-Collectd.html?vendor_id=11242
1323 * It's recommended to only use collectd plugins from signed packages.
1327 .. [1] https://collectd.org/wiki/index.php/Naming_schema
1328 .. [2] https://github.com/collectd/collectd/blob/master/src/daemon/plugin.h
1329 .. [3] https://collectd.org/wiki/index.php/Value_list_t
1330 .. [4] https://collectd.org/wiki/index.php/Data_set
1331 .. [5] https://collectd.org/documentation/manpages/types.db.5.shtml
1332 .. [6] https://collectd.org/wiki/index.php/Data_source
1333 .. [7] https://collectd.org/wiki/index.php/Meta_Data_Interface
1335 .. _Barometer OPNFV Summit demo: https://prezi.com/kjv6o8ixs6se/software-fastpath-service-quality-metrics-demo/
1336 .. _gnocchi plugin: https://github.com/openstack/collectd-ceilometer-plugin/tree/stable/ocata/
1337 .. _aodh plugin: https://github.com/openstack/collectd-ceilometer-plugin/tree/stable/ocata/
1338 .. _collectd-ceilometer-plugin GSG: https://github.com/openstack/collectd-ceilometer-plugin/blob/master/doc/source/GSG.rst
1339 .. _grafana guide: https://wiki.opnfv.org/display/fastpath/Installing+and+configuring+InfluxDB+and+Grafana+to+display+metrics+with+collectd
1340 .. _CVE-2017-7401: https://www.cvedetails.com/cve/CVE-2017-7401/
1341 .. _CVE-2016-6254: https://www.cvedetails.com/cve/CVE-2016-6254/
1342 .. _CVE-2010-4336: https://www.cvedetails.com/cve/CVE-2010-4336/
1343 .. _Exec plugin: https://collectd.org/wiki/index.php/Plugin:Exec