Skip to content

Commit

Permalink
capabilities plugin: new plugin to read static platform data
Browse files Browse the repository at this point in the history
Read decoded SMBIOS data from dmidecode and expose it through httpd.
Using libmicrohttpd and libjansson.

Change-Id: I7bcbb8a0747fbaaa3d5e4affe78b828ca0d8837d
Signed-off-by: Kamil Wiatrowski <kamilx.wiatrowski@intel.com>
  • Loading branch information
kwiatrox authored and dago committed Feb 25, 2020
1 parent d43d661 commit b934f15
Show file tree
Hide file tree
Showing 9 changed files with 1,105 additions and 2 deletions.
26 changes: 26 additions & 0 deletions Makefile.am
Expand Up @@ -757,6 +757,32 @@ buddyinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS)
buddyinfo_la_LIBADD = libignorelist.la
endif

if BUILD_PLUGIN_CAPABILITIES
pkglib_LTLIBRARIES += capabilities.la
capabilities_la_SOURCES = src/capabilities.c \
src/utils/dmi/dmi.c \
src/utils/dmi/dmi.h
capabilities_la_CPPFLAGS = $(AM_CPPFLAGS) \
$(BUILD_WITH_LIBMICROHTTPD_CPPFLAGS) $(BUILD_WITH_LIBJANSSON_CPPFLAGS)
capabilities_la_LDFLAGS = $(PLUGIN_LDFLAGS) \
$(BUILD_WITH_LIBMICROHTTPD_LDFLAGS) $(BUILD_WITH_LIBJANSSON_LDFLAGS)
capabilities_la_LIBADD = $(BUILD_WITH_LIBMICROHTTPD_LIBS) \
$(BUILD_WITH_LIBJANSSON_LIBS)

test_plugin_capabilities_SOURCES = \
src/capabilities_test.c \
src/daemon/configfile.c \
src/daemon/types_list.c
test_plugin_capabilities_CPPFLAGS = $(AM_CPPFLAGS) \
$(BUILD_WITH_LIBJANSSON_CPPFLAGS)
test_plugin_capabilities_LDFLAGS = $(PLUGIN_LDFLAGS) \
$(BUILD_WITH_LIBJANSSON_LDFLAGS)
test_plugin_capabilities_LDADD = liboconfig.la libplugin_mock.la \
$(BUILD_WITH_LIBJANSSON_LIBS)
check_PROGRAMS += test_plugin_capabilities
TESTS += test_plugin_capabilities
endif

if BUILD_PLUGIN_CEPH
pkglib_LTLIBRARIES += ceph.la
ceph_la_SOURCES = src/ceph.c
Expand Down
7 changes: 6 additions & 1 deletion README
Expand Up @@ -48,6 +48,10 @@ Features
- buddyinfo
Statistics from buddyinfo file about memory fragmentation.

- capabilities
Platform static capabilities decoded from SMBIOS using dmidecode.
<https://www.nongnu.org/dmidecode/>

- ceph
Statistics from the Ceph distributed storage system.

Expand Down Expand Up @@ -843,7 +847,8 @@ Prerequisites
<http://netfilter.org/>

* libjansson (optional)
Used by the `dpdk_telemetry` plugin.
Parse JSON data. This is used for the `capabilities' and `dpdk_telemetry` plugins.
<http://www.digip.org/jansson/>

* libjevents (optional)
The jevents library is used by the `intel_pmu' plugin to access the Linux
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Expand Up @@ -6425,6 +6425,7 @@ plugin_barometer="no"
plugin_battery="no"
plugin_bind="no"
plugin_buddyinfo="no"
plugin_capabilities="no"
plugin_ceph="no"
plugin_cgroups="no"
plugin_connectivity="no"
Expand Down Expand Up @@ -6559,6 +6560,10 @@ if test "x$ac_system" = "xLinux"; then
if test "x$have_pci_regs_h" = "xyes"; then
plugin_pcie_errors="yes"
fi
if test "x$with_libmicrohttpd" = "xyes" && test "x$with_libjansson" = "xyes"; then
plugin_capabilities="yes"
fi
fi
if test "x$ac_system" = "xOpenBSD"; then
Expand Down Expand Up @@ -6868,6 +6873,7 @@ AC_PLUGIN([barometer], [$plugin_barometer], [Barometer sensor
AC_PLUGIN([battery], [$plugin_battery], [Battery statistics])
AC_PLUGIN([bind], [$plugin_bind], [ISC Bind nameserver statistics])
AC_PLUGIN([buddyinfo], [$plugin_buddyinfo], [buddyinfo statistics])
AC_PLUGIN([capabilities], [$plugin_capabilities], [Platform static capabilities])
AC_PLUGIN([ceph], [$plugin_ceph], [Ceph daemon statistics])
AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting])
AC_PLUGIN([chrony], [yes], [Chrony statistics])
Expand Down Expand Up @@ -7306,6 +7312,7 @@ AC_MSG_RESULT([ barometer . . . . . . $enable_barometer])
AC_MSG_RESULT([ battery . . . . . . . $enable_battery])
AC_MSG_RESULT([ bind . . . . . . . . $enable_bind])
AC_MSG_RESULT([ buddyinfo . . . . . . $enable_buddyinfo])
AC_MSG_RESULT([ capabilities . . . . $enable_capabilities])
AC_MSG_RESULT([ ceph . . . . . . . . $enable_ceph])
AC_MSG_RESULT([ cgroups . . . . . . . $enable_cgroups])
AC_MSG_RESULT([ chrony. . . . . . . . $enable_chrony])
Expand Down

0 comments on commit b934f15

Please sign in to comment.