Skip to content

4.5.3 Sensor Plugin Build Install

lrrajesh edited this page Sep 14, 2016 · 1 revision

Considering the dynamic architecture of the udsensors plugins, it only has one dependency with the SenSys plugins library, which contains the symbols of the dataContainer class. Plugins can be installed in any location, and the path should be passed to the monitoring system by means of an MCA variable.

Build Plugin library

Assuming the monitoring system is installed in /opt/sensys, and using GNU g++ compiler, the following compilation command can be used:

g++ -O3 -fPIC -I/opt/sensys/include/openmpi/ -L/opt/sensys/lib/ -shared -rdynamic -lsensysplugins mysensor.cpp -o testplugin.so

The following Makefile example can be customized for convenience:

SENSORPLUGIN=myplugin
PLUGINPREFIX=libudplugins_
CXX=g++
SENSYSPATH=/opt/sensys
CXXFLAGS=-O3 -fPIC -I$(SENSYSPATH)/include/openmpi
LDFLAGS=-L$(SENSYSPATH)/lib -shared -rdynamic -lsensysplugins

all:
        $(CXX) $(CXXFLAGS) $(LDFLAGS) mysensor.cpp -o $(PLUGINPREFIX)$(SENSORPLUGIN).so

clean:
        -rm *.o
        -rm *.so

Loading plugins into the monitoring system

All of the user defined sensor plugins are being handled by a SenSys sensor plugin named udsensors. The sampling would be performed at the specified sample rate for that plugin, serially requesting the samples to each of the registered plugins.

The following MCA parameters are supported for udsensors:

  • use_progress_thread : Use a dedicated progress thread for udsensors sensors [default: false]. This is a thread for the whole udsensors handler, not for each of the user defined plugins.
  • sample_rate : Sample rate in seconds. As with every other sensor plugin, this sample rate is applicable if the handler is running on its own thread. If not, it will sample at the base sample rate.
  • collect_metrics : Enable metric collection for the udsensors plugin.
  • path : User-defined sensors path. By default, sensors would be searched in the installation path, within the lib/openmpi directory.

Assuming that user defined plugins and headers are located in the default path, the simplest way to start the daemon for sampling udsensors is:

sudo ./orcmd --omca sensor heartbeat,udsensors
Clone this wiki locally