Skip to content

Commit

Permalink
Initial implementation for epics plugin for collectd 6.0
Browse files Browse the repository at this point in the history
EPICS is Experimental Physics and Industrial Control System.

Reference: https://epics-controls.org/

Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
  • Loading branch information
matwey committed Feb 28, 2024
1 parent 18b7775 commit cf6eff7
Show file tree
Hide file tree
Showing 6 changed files with 673 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,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
Expand Down
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ Features
- entropy
Amount of entropy available to the system.

- epics
Collect data from EPICS message bus.
<https://epics-controls.org>

- ethstat
Network interface card statistics.

Expand Down
32 changes: 32 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2138,6 +2138,34 @@ AC_SUBST([LEVEL_ZERO_CFLAGS])
AC_SUBST([LEVEL_ZERO_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.])],
Expand Down Expand Up @@ -6747,6 +6775,7 @@ plugin_dpdk_telemetry="no"
plugin_drbd="no"
plugin_email="yes"
plugin_entropy="no"
plugin_epics="no"
plugin_ethstat="no"
plugin_exec="yes"
plugin_fhcount="no"
Expand Down Expand Up @@ -7440,6 +7469,7 @@ AC_PLUGIN([dpdk_telemetry], [$plugin_dpdk_telemetry], [Metrics from DPDK
AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
AC_PLUGIN([email], [$plugin_email], [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], [$plugin_exec], [Execution of external programs])
AC_PLUGIN([fhcount], [$plugin_fhcount], [File handles statistics])
Expand Down Expand Up @@ -7773,6 +7803,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])
Expand Down Expand Up @@ -7889,6 +7920,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])
Expand Down
10 changes: 10 additions & 0 deletions src/collectd.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,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
Expand Down Expand Up @@ -733,6 +734,15 @@
# MaxConns 5
#</Plugin>

#<Plugin epics>
# <Family "cavity.temperature">
# Type "gauge"
# Unit "Cel"
# Label "Cavity1:Name"
# Metric "Cavity1:Temp"
# </Family>
#</Plugin>

#<Plugin ethstat>
# Interface "eth0"
# EthtoolExcludeMetrics "tx_packets"
Expand Down
45 changes: 45 additions & 0 deletions src/collectd.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -3312,6 +3312,51 @@ at most B<16384> to prevent typos and dumb mistakes.

=back

=head2 Plugin C<epics>

The I<epics plugin> 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<Synopsis:>

<Plugin epics>
<Variable "Cavity1:Temp">
Type "gauge"
</Variable>
Label "Cavity1:Name"
</Plugin>

B<Options:>

=over 4

=item E<lt>B<Variable> I<PVName>E<gt>

The plugin configuration consists of multiple E<lt>B<Variable>E<gt> blocks,
each per monitored EPICS Process Variable (PV). The variables are constantly
monitored and their values are latched once per I<global Interval>.

=item B<Type> I<Type>

This is mandatory option to specify internal collectd type for this particular
PV. PV data type announced by EPICS and the I<Type> specified here must be in a
reasonable agreement.

=item B<Label> I<PVName>

Additionally, string-typed PV can be monitored as a B<Label>. For instance,
this can potentially be useful for tracking an experiment ID. Note that in
addition to configuring B<Label> the appropriate label-avare collectd writing
plugin has to be enabled. For instance, I<write_prometheus plugin>,
I<write_influxdb_udp plugin>, or I<write_http plugin> with InfluxDB B<Format>.

=back

=head2 Plugin C<ethstat>

The I<ethstat plugin> collects information about network interface cards (NICs)
Expand Down

0 comments on commit cf6eff7

Please sign in to comment.