8000 Add slurm plugin by pllopis · Pull Request #3037 · collectd/collectd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add slurm plugin #3037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ Oleg King <king2 at kaluga.ru>
Ondrej Zajicek <santiago at crfreenet.org>
- madwifi plugin.

Pablo Llopis <pablo.llopis at gmail.com>
- Slurm plugin
- RestoreAffinityPolicy in turbostat plugin

Patrik Weiskircher <weiskircher at inqnet.at>
- Contextswitch plugin.
- Forkrate counter in the processes plugin.
Expand Down
8 changes: 8 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,14 @@ sigrok_la_LDFLAGS = $(PLUGIN_LDFLAGS)
sigrok_la_LIBADD = $(LIBSIGROK_LIBS)
endif

if BUILD_PLUGIN_SLURM
pkglib_LTLIBRARIES += slurm.la
slurm_la_SOURCES = src/slurm.c
slurm_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSLURM_CFLAGS)
slurm_la_LDFLAGS = $(PLUGIN_LDFLAGS)
slurm_la_LIBADD = $(BUILD_WITH_LIBSLURM_LIBS)
endif

if BUILD_PLUGIN_SMART
if BUILD_WITH_LIBUDEV
pkglib_LTLIBRARIES += smart.la
Expand Down
8 changes: 8 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ Features
to have its measurements fed to collectd. This includes multimeters,
sound level meters, thermometers, and much more.

- slurm
Gathers per-partition node and job state information using libslurm,
as well as internal health statistics.

- smart
Collect SMART statistics, notably load cycle count, temperature
and bad sectors.
Expand Down Expand Up @@ -965,6 +969,10 @@ Prerequisites
libzip, and optionally (depending on which drivers are enabled) on
libusb, libftdi and libudev.

* libslurm (optional)
Used by the `slurm` plugin.
<https://slurm.schedmd.com/>

* libstatgrab (optional)
Used by various plugins to collect statistics on systems other than Linux
and/or Solaris.
Expand Down
80 changes: 80 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6352,6 +6352,83 @@ AC_DEFUN(
]
)# AC_PLUGIN(name, default, info)

# --with-libslurm {{{
AC_ARG_WITH([libslurm],
[AS_HELP_STRING([--with-libslurm@<:@=PREFIX@:>@], [Path to the libslurm library.])],
[
if test "x$withval" = "xno"; then
with_libslurm="no"
else if test "x$withval" = "xyes"; then
with_libslurm="use_pkgconfig"
else if test -d "$with_libslurm/lib"; then
AC_MSG_NOTICE([Not checking for libslurm: Manually configured])
with_libslurm_cflags="-I$withval/include"
with_libslurm_libs="-L$withval/lib -llibslurm"
with_libslurm="yes"
fi; fi; fi
],
[with_libslurm="use_pkgconfig"]
)

# configure using pkg-config
if test "x$with_libslurm" = "xuse_pkgconfig"; then
AC_MSG_NOTICE([Checking for libslurm using $PKG_CONFIG])
$PKG_CONFIG --exists 'slurm' 2>/dev/null
if test $? -ne 0; then
with_libslurm="no (pkg-config doesn't know libslurm)"
fi
fi

if test "x$with_libslurm" = "xuse_pkgconfig"; then
with_libslurm_cflags="`$PKG_CONFIG --cflags 'slurm'`"
if test $? -ne 0; then
with_libslurm="no ($PKG_CONFIG failed)"
fi

with_libslurm_libs="`$PKG_CONFIG --libs 'slurm'`"
if test $? -ne 0; then
with_libslurm="no ($PKG_CONFIG failed)"
fi
fi

if test "x$with_libslurm" = "xuse_pkgconfig"; then
with_libslurm="yes"
fi

if test "x$with_libslurm" = "xyes"; then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_libslurm_cflags"

AC_CHECK_HEADERS([slurm/slurm.h],
[with_libslurm="yes"],
[with_libslurm="no (slurm/slurm.h not found)"]
)

CPPFLAGS="$SAVE_CPPFLAGS"
fi

if test "x$with_libslurm" = "xyes"; then
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $with_libslurm_libs"

AC_CHECK_LIB([slurm], [slurm_load_jobs],
[with_libslurm="yes"],
[with_libslurm="no (symbol slurm_load_jobs not found)"]
)

LDFLAGS="$SAVE_LDFLAGS"
fi

if test "x$with_libslurm" = "xyes"; then
BUILD_WITH_LIBSLURM_CFLAGS="$with_libslurm_cflags"
BUILD_WITH_LIBSLURM_LIBS="$with_libslurm_libs"
fi

AC_SUBST([BUILD_WITH_LIBSLURM_CFLAGS])
AC_SUBST([BUILD_WITH_LIBSLURM_LIBS])
# }}}


m4_divert_once([HELP_ENABLE], [
collectd features:])
# FIXME: Remove these calls to `AC_COLLECTD' and then remove that macro.
Expand Down Expand Up @@ -6890,6 +6967,7 @@ AC_PLUGIN([rrdtool], [$with_librrd], [RRDTool output pl
AC_PLUGIN([sensors], [$with_libsensors], [lm_sensors statistics])
AC_PLUGIN([serial], [$plugin_serial], [serial port traffic])
AC_PLUGIN([sigrok], [$with_libsigrok], [sigrok acquisition sources])
AC_PLUGIN([slurm], [$with_libslurm], [SLURM jobs and nodes status])
AC_PLUGIN([smart], [$plugin_smart], [SMART statistics])
AC_PLUGIN([snmp], [$with_libnetsnmp], [SNMP querying plugin])
AC_PLUGIN([snmp_agent], [$with_libnetsnmpagent], [SNMP agent plugin])
Expand Down Expand Up @@ -7184,6 +7262,7 @@ AC_MSG_RESULT([ librrd . . . . . . . $with_librrd])
AC_MSG_RESULT([ libsensors . . . . . $with_libsensors])
AC_MSG_RESULT([ libsigrok . . . . . $with_libsigrok])
AC_MSG_RESULT([ libssl . . . . . . . $with_libssl])
AC_MSG_RESULT([ libslurm . . . . . . $with_libslurm])
AC_MSG_RESULT([ libstatgrab . . . . . $with_libstatgrab])
AC_MSG_RESULT([ libtokyotyrant . . . $with_libtokyotyrant])
AC_MSG_RESULT([ libudev . . . . . . . $with_libudev])
Expand Down Expand Up @@ -7316,6 +7395,7 @@ AC_MSG_RESULT([ rrdtool . . . . . . . $enable_rrdtool])
AC_MSG_RESULT([ sensors . . . . . . . $enable_sensors])
AC_MSG_RESULT([ serial . . . . . . . $enable_serial])
AC_MSG_RESULT([ sigrok . . . . . . . $enable_sigrok])
AC_MSG_RESULT([ slurm . . . . . . . . $enable_slurm])
AC_MSG_RESULT([ smart . . . . . . . . $enable_smart])
AC_MSG_RESULT([ snmp . . . . . . . . $enable_snmp])
AC_MSG_RESULT([ snmp_agent . . . . . $enable_snmp_agent])
Expand Down
1 change: 1 addition & 0 deletions src/collectd.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
#@BUILD_PLUGIN_SENSORS_TRUE@LoadPlugin sensors
#@BUILD_PLUGIN_SERIAL_TRUE@LoadPlugin serial
#@BUILD_PLUGIN_SIGROK_TRUE@LoadPlugin sigrok
#@BUILD_PLUGIN_SLURM_TRUE@LoadPlugin slurm
#@BUILD_PLUGIN_SMART_TRUE@LoadPlugin smart
#@BUILD_PLUGIN_SNMP_TRUE@LoadPlugin snmp
#@BUILD_PLUGIN_SNMP_AGENT_TRUE@LoadPlugin snmp_agent
Expand Down
10 changes: 10 additions & 0 deletions src/collectd.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -7902,6 +7902,16 @@ measurements are discarded.

=back

=head2 Plugin C<slurm>

This plugin collects per-partition SLURM node and job state information, as
well as internal health statistics.
It takes no options. It should run on a node that is capable of running the
I<sinfo> and I<squeue> commands, i.e. it has a running slurmd and a valid
slurm.conf.
Note that this plugin needs the B<Globals> option set to I<true> in order to
function properly.

=head2 Plugin C<smart>

The C<smart> plugin collects SMART information from physical
Expand Down
Loading
0