From: Matwey V. Kornilov Date: Wed, 5 Jan 2022 14:20:06 +0000 (+0300) Subject: Initial implementation for epics plugin X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75cb76e14912826c267397347b4ab28b080e730b;p=thirdparty%2Fcollectd.git Initial implementation for epics plugin EPICS is Experimental Physics and Industrial Control System. Reference: https://epics-controls.org/ Signed-off-by: Matwey V. Kornilov --- diff --git a/Makefile.am b/Makefile.am index 2d1cb823d..64c719c48 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1064,6 +1064,14 @@ entropy_la_SOURCES = src/entropy.c entropy_la_LDFLAGS = $(PLUGIN_LDFLAGS) endif +if BUILD_PLUGIN_EPICS +pkglib_LTLIBRARIES += epics.la +epics_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_EPICS_BASE_CFLAGS) +epics_la_SOURCES = src/epics.c +epics_la_LDFLAGS = $(PLUGIN_LDFLAGS) +epics_la_LIBADD = -lpthread $(BUILD_WITH_EPICS_BASE_LIBS) +endif + if BUILD_PLUGIN_EXEC pkglib_LTLIBRARIES += exec.la exec_la_SOURCES = src/exec.c diff --git a/README.md b/README.md index 32e9a4a4a..88b97162e 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,10 @@ Features - entropy Amount of entropy available to the system. + - epics + Collect data from EPICS message bus. + + - ethstat Network interface card statistics. diff --git a/configure.ac b/configure.ac index 96e196e84..652c3aea6 100644 --- a/configure.ac +++ b/configure.ac @@ -2079,6 +2079,35 @@ AC_SUBST([BUILD_WITH_CUDA_LIBS]) # }}} +# --with-epics-base {{{ +AC_ARG_WITH([epics-base], + [AS_HELP_STRING([--with-epics-base@<:@=PREFIX@:>@], [Path to epics-base.])], + [ + with_epics_base="$withval" + if test "x$withval" = "xno"; then + with_epics_base="no (disabled on command line)" + fi + ], + [with_epics_base="yes"] +) + +if test "x$with_epics_base" = "xyes"; then +PKG_CHECK_MODULES([EPICS_BASE], [epics-base], + [with_epics_base="yes"], + [with_epics_base="no (pkg-config could not find epics-base)"] +) +fi + +if test "x$with_epics_base" = "xyes"; then + BUILD_WITH_EPICS_BASE_CFLAGS="$EPICS_BASE_CFLAGS" + BUILD_WITH_EPICS_BASE_LIBS="$EPICS_BASE_LIBS -lca" +fi + +AC_SUBST([BUILD_WITH_EPICS_BASE_CFLAGS]) +AC_SUBST([BUILD_WITH_EPICS_BASE_LIBS]) + +# }}} + # --with-libaquaero5 {{{ AC_ARG_WITH([libaquaero5], [AS_HELP_STRING([--with-libaquaero5@<:@=PREFIX@:>@], [Path to aquatools-ng source code.])], @@ -6740,6 +6769,7 @@ plugin_dpdkevents="no" plugin_dpdkstat="no" plugin_dpdk_telemetry="no" plugin_entropy="no" +plugin_epics="no" plugin_ethstat="no" plugin_fhcount="no" plugin_fscache="no" @@ -7219,6 +7249,7 @@ AC_PLUGIN([dpdk_telemetry], [$plugin_dpdk_telemetry], [Metrics from DPDK AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics]) AC_PLUGIN([email], [yes], [EMail statistics]) AC_PLUGIN([entropy], [$plugin_entropy], [Entropy statistics]) +AC_PLUGIN([epics], [$with_epics_base], [EPICS CA plugin]) AC_PLUGIN([ethstat], [$plugin_ethstat], [Stats from NIC driver]) AC_PLUGIN([exec], [yes], [Execution of external programs]) AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics]) @@ -7552,6 +7583,7 @@ AC_MSG_RESULT([ YACC . . . . . . . . $YACC]) AC_MSG_RESULT([ YFLAGS . . . . . . . $YFLAGS]) AC_MSG_RESULT() AC_MSG_RESULT([ Libraries:]) +AC_MSG_RESULT([ epics . . . . . . . . $with_epics_base]) AC_MSG_RESULT([ intel mic . . . . . . $with_mic]) AC_MSG_RESULT([ libaquaero5 . . . . . $with_libaquaero5]) AC_MSG_RESULT([ libatasmart . . . . . $with_libatasmart]) @@ -7669,6 +7701,7 @@ AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd]) AC_MSG_RESULT([ email . . . . . . . . $enable_email]) AC_MSG_RESULT([ entropy . . . . . . . $enable_entropy]) AC_MSG_RESULT([ ethstat . . . . . . . $enable_ethstat]) +AC_MSG_RESULT([ epics . . . . . . . . $enable_epics]) AC_MSG_RESULT([ exec . . . . . . . . $enable_exec]) AC_MSG_RESULT([ fhcount . . . . . . . $enable_fhcount]) AC_MSG_RESULT([ filecount . . . . . . $enable_filecount]) diff --git a/src/collectd.conf.in b/src/collectd.conf.in index dc38189ec..c2aa004d5 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -127,6 +127,7 @@ #@BUILD_PLUGIN_DRBD_TRUE@LoadPlugin drbd #@BUILD_PLUGIN_EMAIL_TRUE@LoadPlugin email #@BUILD_PLUGIN_ENTROPY_TRUE@LoadPlugin entropy +#@BUILD_PLUGIN_ENTROPY_TRUE@LoadPlugin epics #@BUILD_PLUGIN_ETHSTAT_TRUE@LoadPlugin ethstat #@BUILD_PLUGIN_EXEC_TRUE@LoadPlugin exec #@BUILD_PLUGIN_FHCOUNT_TRUE@LoadPlugin fhcount @@ -737,6 +738,14 @@ # MaxConns 5 # +# +# +# Type "gauge" +# +# +# Label "Cavity1:Name" +# + # # Interface "eth0" # Map "rx_csum_offload_errors" "if_rx_errors" "checksum_offload" diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 9b7be761f..99bd12961 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -3318,6 +3318,51 @@ at most B<16384> to prevent typos and dumb mistakes. =back +=head2 Plugin C + +The I collects data from EPICS (Experimental Physics and +Industrial Control System) message bus. + +Note that in addition to the plugin configuration, the host OS has to be +configured to be part of the message bus: caRepeater daemon is up and running +and appropriate EPICS environment variables are set, if required. Consult EPICS +documentation for details. + +B + + + + Type "gauge" + + Label "Cavity1:Name" + + +B + +=over 4 + +=item EB IE + +The plugin configuration consists of multiple EBE blocks, +each per monitored EPICS Process Variable (PV). The variables are constantly +monitored and their values are latched once per I. + +=item B I + +This is mandatory option to specify internal collectd type for this particular +PV. PV data type announced by EPICS and the I specified here must be in a +reasonable agreement. + +=item B