ovs_stats: Implement OVS statistics plugin.
pkglib_LTLIBRARIES += chrony.la
chrony_la_SOURCES = src/chrony.c
chrony_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+chrony_la_LIBADD = -lm
endif
if BUILD_PLUGIN_CONNTRACK
dns_la_LIBADD = $(BUILD_WITH_LIBPCAP_LIBS)
endif
+if BUILD_PLUGIN_DPDKEVENTS
+pkglib_LTLIBRARIES += dpdkevents.la
+dpdkevents_la_SOURCES = src/dpdkevents.c src/utils_dpdk.c src/utils_dpdk.h
+dpdkevents_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDPDK_CPPFLAGS)
+dpdkevents_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBDPDK_LDFLAGS)
+dpdkevents_la_LIBADD = -ldpdk
+endif
+
if BUILD_PLUGIN_DPDKSTAT
pkglib_LTLIBRARIES += dpdkstat.la
dpdkstat_la_SOURCES = src/dpdkstat.c src/utils_dpdk.c src/utils_dpdk.h
ovs_events_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
ovs_events_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
ovs_events_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
+ endif
+
+ if BUILD_PLUGIN_OVS_STATS
+ pkglib_LTLIBRARIES += ovs_stats.la
+ ovs_stats_la_SOURCES = \
+ src/ovs_stats.c \
+ src/utils_ovs.c \
+ src/utils_ovs.h
+ ovs_stats_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
+ ovs_stats_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
+ ovs_stats_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
endif
if BUILD_PLUGIN_PERL
pkglib_LTLIBRARIES += unixsock.la
unixsock_la_SOURCES = src/unixsock.c
unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-unixsock_la_LIBS = libcmds.la
+unixsock_la_LIBADD = libcmds.la
endif
if BUILD_PLUGIN_UPTIME
)
if test "x$have_capability" = "xyes"; then
- AC_CHECK_LIB([cap], [cap_get_bound],
+ AC_CHECK_LIB([cap], [cap_get_proc],
[have_capability="yes"],
- [have_capability="no (cap_get_bound() not found)"]
+ [have_capability="no (cap_get_proc() not found)"]
)
fi
if test "x$have_capability" = "xyes"; then
- AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_bound() (-lcap).])
+ AC_DEFINE([HAVE_CAPABILITY], [1], [Define to 1 if you have cap_get_proc() (-lcap).])
fi
else
AC_ARG_WITH([libdpdk], [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])])
-if test "x$with_libdpdk" != "xno"
-then
- if test "x$LIBDPDK_CPPFLAGS" = "x"
- then
- LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
- fi
- SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
- AC_CHECK_HEADERS([rte_config.h],
- [with_libdpdk="yes"],
- [with_libdpdk="no (rte_config.h not found)"]
- )
- CPPFLAGS="$SAVE_CPPFLAGS"
+if test "x$with_libdpdk" != "xno"; then
+ if test "x$LIBDPDK_CPPFLAGS" = "x"; then
+ LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
+ fi
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
+ AC_CHECK_HEADERS([rte_config.h],
+ [
+ with_libdpdk="yes"
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM(
+ [[
+ #include <rte_version.h>
+ #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
+ #error "required DPDK >= 16.07"
+ #endif
+ ]],
+ [[
+ return 0;
+ ]]
+ )
+ ],
+ [dpdk_keepalive="yes"],
+ [dpdk_keepalive="no (DPDK version < 16.07)"]
+ )
+ ],
+ [with_libdpdk="no (rte_config.h not found)"]
+ )
+ CPPFLAGS="$SAVE_CPPFLAGS"
fi
-if test "x$with_libdpdk" = "xyes"
-then
- SAVE_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
- AC_CHECK_LIB([dpdk], [rte_eal_init],
- [with_libdpdk="yes"],
- [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
- )
- LDFLAGS="$SAVE_LDFLAGS"
+if test "x$with_libdpdk" = "xyes"; then
+ SAVE_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LIBDPDK_LDFLAGS $LDFLAGS"
+ AC_CHECK_LIB([dpdk], [rte_eal_init],
+ [with_libdpdk="yes"],
+ [with_libdpdk="no (symbol 'rte_eal_init' not found)"]
+ )
+ LDFLAGS="$SAVE_LDFLAGS"
fi
# }}}
fi
if test "x$with_libpqos" = "xyes"
then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_libpqos_cppflags"
+ AC_RUN_IFELSE([AC_LANG_PROGRAM(
+ [[#include <pqos.h>]],
+ [[return !(PQOS_VERSION >= 106)]])],
+ [with_libpqos="yes"], [with_libpqos="no (pqos library version 1.06 or higher is required)"])
+ CPPFLAGS="$SAVE_CPPFLAGS"
+fi
+if test "x$with_libpqos" = "xyes"
+then
BUILD_WITH_LIBPQOS_CPPFLAGS="$with_libpqos_cppflags"
BUILD_WITH_LIBPQOS_LDFLAGS="$with_libpqos_ldflags"
BUILD_WITH_LIBPQOS_LIBS="-lpqos"
[with_libupsclient="no (symbol upscli_connect not found)"]
)
+ AC_CHECK_LIB([upsclient], [upscli_init],
+ [AC_DEFINE([WITH_UPSCLIENT_27], [1], [At least version 2-7])],
+ []
+ )
+
LDFLAGS="$SAVE_LDFLAGS"
fi
plugin_df="no"
plugin_disk="no"
plugin_drbd="no"
+plugin_dpdkevents="no"
plugin_dpdkstat="no"
plugin_entropy="no"
plugin_ethstat="no"
plugin_nfs="no"
plugin_numa="no"
plugin_ovs_events="no"
+ plugin_ovs_stats="no"
plugin_perl="no"
plugin_pinba="no"
plugin_processes="no"
if test "x$with_libyajl" = "xyes" && test "x$with_libyajl2" = "xyes"; then
plugin_ovs_events="yes"
+ plugin_ovs_stats="yes"
fi
if test "x$with_libperl" = "xyes" && test "x$c_cv_have_perl_ithreads" = "xyes"; then
if test "x$with_libdpdk" = "xyes"
then
+ plugin_dpdkevents="$dpdk_keepalive"
plugin_dpdkstat="yes"
fi
AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
+AC_PLUGIN([dpdkevents], [$plugin_dpdkevents], [Events from DPDK])
AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats from DPDK])
AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
AC_PLUGIN([email], [yes], [EMail statistics])
AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics])
AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin])
AC_PLUGIN([ovs_events], [$plugin_ovs_events], [OVS events plugin])
+ AC_PLUGIN([ovs_stats], [$plugin_ovs_stats], [OVS statistics plugin])
AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter])
AC_PLUGIN([pf], [$have_net_pfvar_h], [BSD packet filter (PF) statistics])
# FIXME: Check for libevent, too.
AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
+AC_MSG_RESULT([ dpdkevents. . . . . . $enable_dpdkevents])
AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
AC_MSG_RESULT([ email . . . . . . . . $enable_email])
AC_MSG_RESULT([ openvpn . . . . . . . $enable_openvpn])
AC_MSG_RESULT([ oracle . . . . . . . $enable_oracle])
AC_MSG_RESULT([ ovs_events . . . . . $enable_ovs_events])
+ AC_MSG_RESULT([ ovs_stats . . . . . . $enable_ovs_stats])
AC_MSG_RESULT([ perl . . . . . . . . $enable_perl])
AC_MSG_RESULT([ pf . . . . . . . . . $enable_pf])
AC_MSG_RESULT([ pinba . . . . . . . . $enable_pinba])
#@BUILD_PLUGIN_DF_TRUE@LoadPlugin df
#@BUILD_PLUGIN_DISK_TRUE@LoadPlugin disk
#@BUILD_PLUGIN_DNS_TRUE@LoadPlugin dns
+#@BUILD_PLUGIN_DPDKEVENTS_TRUE@LoadPlugin dpdkevents
#@BUILD_PLUGIN_DPDKSTAT_TRUE@LoadPlugin dpdkstat
#@BUILD_PLUGIN_DRBD_TRUE@LoadPlugin drbd
#@BUILD_PLUGIN_EMAIL_TRUE@LoadPlugin email
#@BUILD_PLUGIN_OPENVPN_TRUE@LoadPlugin openvpn
#@BUILD_PLUGIN_ORACLE_TRUE@LoadPlugin oracle
#@BUILD_PLUGIN_OVS_EVENTS_TRUE@LoadPlugin ovs_events
+ #@BUILD_PLUGIN_OVS_STATS_TRUE@LoadPlugin ovs_stats
#@BUILD_PLUGIN_PERL_TRUE@LoadPlugin perl
#@BUILD_PLUGIN_PINBA_TRUE@LoadPlugin pinba
#@BUILD_PLUGIN_PING_TRUE@LoadPlugin ping
# SelectNumericQueryTypes true
#</Plugin>
+#<Plugin "dpdkevents">
+# <EAL>
+# Coremask "0x1"
+# MemoryChannels "4"
+# ProcessType "secondary"
+# FilePrefix "rte"
+# </EAL>
+# <Event "link_status">
+# SendEventsOnUpdate true
+# EnabledPortMask 0xffff
+# PortName "interface1"
+# PortName "interface2"
+# SendNotification false
+# </Event>
+# <Event "keep_alive">
+# SendEventsOnUpdate true
+# LCoreMask "0xf"
+# KeepAliveShmName "/dpdk_keepalive_shm_name"
+# SendNotification false
+# </Event>
+#</Plugin>
+
#<Plugin dpdkstat>
# <EAL>
# Coremask "0x2"
# ProcessType "secondary"
# FilePrefix "rte"
# </EAL>
+# SharedMemObj "dpdk_collectd_stats_0"
# EnabledPortMask 0xffff
# PortName "interface1"
# PortName "interface2"
#<Plugin nut>
# UPS "upsname@hostname:port"
+# ForceSSL true
+# VerifyPeer true
+# CAPath "/path/to/folder"
#</Plugin>
#<Plugin olsrd>
# Socket "/var/run/openvswitch/db.sock"
# Interfaces "br0" "veth0"
# SendNotification false
+# DispatchValues true
#</Plugin>
+ #<Plugin ovs_stats>
+ # Port "6640"
+ # Address "127.0.0.1"
+ # Socket "/var/run/openvswitch/db.sock"
+ # Bridges "br0" "br_ext"
+ #</Plugin>
+
#<Plugin perl>
# IncludeDir "/my/include/path"
# BaseName "Collectd::Plugins"
# InterfaceFormat name
# PluginInstanceFormat name
# Instances 1
+# ExtraStats "disk pcpu"
#</Plugin>
#<Plugin vmem>
=back
+=head2 Plugin C<dpdkevents>
+
+The I<dpdkevents plugin> collects events from DPDK such as link status of
+network ports and Keep Alive status of DPDK logical cores.
+In order to get Keep Alive events following requirements must be met:
+- DPDK >= 16.07
+- support for Keep Alive implemented in DPDK application. More details can
+be found here: http://dpdk.org/doc/guides/sample_app_ug/keep_alive.html
+
+B<Synopsis:>
+
+ <Plugin "dpdkevents">
+ <EAL>
+ Coremask "0x1"
+ MemoryChannels "4"
+ ProcessType "secondary"
+ FilePrefix "rte"
+ </EAL>
+ <Event "link_status">
+ SendEventsOnUpdate true
+ EnabledPortMask 0xffff
+ PortName "interface1"
+ PortName "interface2"
+ SendNotification false
+ </Event>
+ <Event "keep_alive">
+ SendEventsOnUpdate true
+ LCoreMask "0xf"
+ KeepAliveShmName "/dpdk_keepalive_shm_name"
+ SendNotification false
+ </Event>
+ </Plugin>
+
+B<Options:>
+
+
+=head3 The EAL block
+
+=over 5
+
+=item B<Coremask> I<Mask>
+
+=item B<Memorychannels> I<Channels>
+
+Number of memory channels per processor socket.
+
+=item B<ProcessType> I<type>
+
+The type of DPDK process instance.
+
+=item B<FilePrefix> I<File>
+
+The prefix text used for hugepage filenames. The filename will be set to
+/var/run/.<prefix>_config where prefix is what is passed in by the user.
+
+=back
+
+=head3 The Event block
+
+The B<Event> block defines configuration for specific event. It accepts a
+single argument which specifies the name of the event.
+
+=head4 Link Status event
+
+=over 5
+
+=item B<SendEventOnUpdate> I<true|false>
+
+If set to true link status value will be dispatched only when it is
+different from previously read value. This is an optional argument - default
+value is true.
+
+=item B<EnabledPortMask> I<Mask>
+
+A hexidecimal bit mask of the DPDK ports which should be enabled. A mask
+of 0x0 means that all ports will be disabled. A bitmask of all F's means
+that all ports will be enabled. This is an optional argument - by default
+all ports are enabled.
+
+=item B<PortName> I<Name>
+
+A string containing an optional name for the enabled DPDK ports. Each PortName
+option should contain only one port name; specify as many PortName options as
+desired. Default naming convention will be used if PortName is blank. If there
+are less PortName options than there are enabled ports, the default naming
+convention will be used for the additional ports.
+
+=item B<SendNotification> I<true|false>
+
+If set to true, link status notifications are sent, instead of link status
+being collected as a statistic. This is an optional argument - default
+value is false.
+
+=back
+
+=head4 Keep Alive event
+
+=over 5
+
+=item B<SendEventOnUpdate> I<true|false>
+
+If set to true keep alive value will be dispatched only when it is
+different from previously read value. This is an optional argument - default
+value is true.
+
+=item B<LCoreMask> I<Mask>
+
+An hexadecimal bit mask of the logical cores to monitor keep alive state.
+
+=item B<KeepAliveShmName> I<Name>
+
+Shared memory name identifier that is used by secondary process to monitor
+the keep alive cores state.
+
+=item B<SendNotification> I<true|false>
+
+If set to true, keep alive notifications are sent, instead of keep alive
+information being collected as a statistic. This is an optional
+argument - default value is false.
+
+=back
+
=head2 Plugin C<dpdkstat>
The I<dpdkstat plugin> collects information about DPDK interfaces using the
FilePrefix "rte"
SocketMemory "1024"
</EAL>
+ SharedMemObj "dpdk_collectd_stats_0"
EnabledPortMask 0xffff
PortName "interface1"
PortName "interface2"
=back
-=over 4
+=over 3
+
+=item B<SharedMemObj> I<Mask>
+A string containing the name of the shared memory object that should be used to
+share stats from the DPDK secondary process to the collectd dpdkstat plugin.
+Defaults to dpdk_collectd_stats if no other value is configured.
=item B<EnabledPortMask> I<Mask>
Monitor events are hardware dependant. Monitoring capabilities are detected on
plugin initialization and only supported events are monitored.
+B<Note:> I<intel_rdt> plugin is using model-specific registers (MSRs), which
+require an additional capability to be enabled if collectd is run as a service.
+Please refer to I<contrib/systemd.collectd.service> file for more details.
+
B<Synopsis:>
<Plugin "intel_rdt">
Add a UPS to collect data from. The format is identical to the one accepted by
L<upsc(8)>.
+=item B<ForceSSL> B<true>|B<false>
+
+Stops connections from falling back to unsecured if an SSL connection
+cannot be established. Defaults to false if undeclared.
+
+=item B<VerifyPeer> I<true>|I<false>
+
+If set to true, requires a CAPath be provided. Will use the CAPath to find
+certificates to use as Trusted Certificates to validate a upsd server certificate.
+If validation of the upsd server certificate fails, the connection will not be
+established. If ForceSSL is undeclared or set to false, setting VerifyPeer to true
+will override and set ForceSSL to true.
+
+=item B<CAPath> I/path/to/certs/folder
+
+If VerifyPeer is set to true, this is required. Otherwise this is ignored.
+The folder pointed at must contain certificate(s) named according to their hash.
+Ex: XXXXXXXX.Y where X is the hash value of a cert and Y is 0. If name collisions
+occur because two different certs have the same hash value, Y can be incremented
+in order to avoid conflict. To create a symbolic link to a certificate the following
+command can be used from within the directory where the cert resides:
+
+C<ln -s some.crt ./$(openssl x509 -hash -noout -in some.crt).0>
+
+Alternatively, the package openssl-perl provides a command C<c_rehash> that will
+generate links like the one described above for ALL certs in a given folder.
+Example usage:
+C<c_rehash /path/to/certs/folder>
+
=back
=head2 Plugin C<olsrd>
Socket "/var/run/openvswitch/db.sock"
Interfaces "br0" "veth0"
SendNotification false
+ DispatchValues true
</Plugin>
The plugin provides the following configuration options:
If set to true, OVS link notifications (interface status and OVS DB connection
terminate) are sent to collectd. Default value is false.
+=item B<DispatchValues> I<true|false>
+
+Dispatch the OVS DB interface link status value with configured plugin interval.
+Defaults to true. Please note, if B<SendNotification> and B<DispatchValues>
+options are false, no OVS information will be provided by the plugin.
+
=back
B<Note:> By default, the global interval setting is used within which to
simple divide the time by 1000 for example if the desired interval is 50ms, set
interval to 0.05.
+ =head2 Plugin C<ovs_stats>
+
+ The I<ovs_stats> plugin collects statistics of OVS connected interfaces.
+ This plugin uses OVSDB management protocol (RFC7047) monitor mechanism to get
+ statistics from OVSDB
+
+ B<Synopsis:>
+
+ <Plugin "ovs_stats">
+ Port 6640
+ Address "127.0.0.1"
+ Socket "/var/run/openvswitch/db.sock"
+ Bridges "br0" "br_ext"
+ </Plugin>
+
+ The plugin provides the following configuration options:
+
+ =over 4
+
+ =item B<Address> I<node>
+
+ The address of the OVS DB server JSON-RPC interface used by the plugin. To
+ enable the interface, OVS DB daemon should be running with C<--remote=ptcp:>
+ option. See L<ovsdb-server(1)> for more details. The option may be either
+ network hostname, IPv4 numbers-and-dots notation or IPv6 hexadecimal string
+ format. Defaults to B<'localhost'>.
+
+ =item B<Port> I<service>
+
+ TCP-port to connect to. Either a service name or a port number may be given.
+ Defaults to B<6640>.
+
+ =item B<Socket> I<path>
+
+ The UNIX domain socket path of OVS DB server JSON-RPC interface used by the
+ plugin. To enable the interface, the OVS DB daemon should be running with
+ C<--remote=punix:> option. See L<ovsdb-server(1)> for more details. If this
+ option is set, B<Address> and B<Port> options are ignored.
+
+ =item B<Bridges> [I<brname> ...]
+
+ List of OVS bridge names to be monitored by this plugin. If this option is
+ omitted or is empty then all OVS bridges will be monitored.
+
+ Default: empty (monitor all bridges)
+
+ =back
+
=head2 Plugin C<perl>
This plugin embeds a Perl-interpreter into collectd and provides an interface
and the sensible setting is a multiple of the B<ReadThreads> value.
If you are not sure, just use the default setting.
+=item B<ExtraStats> B<string>
+
+Report additional extra statistics. The default is no extra statistics, preserving
+the previous behaviour of the plugin. If unsure, leave the default. If enabled,
+allows the plugin to reported more detailed statistics about the behaviour of
+Virtual Machines. The argument is a space-separated list of selectors.
+Currently supported selectors are:
+B<disk> report extra statistics like number of flush operations and total
+service time for read, write and flush operations.
+B<pcpu> report the physical user/system cpu time consumed by the hypervisor, per-vm.
+
=back
=head2 Plugin C<vmem>