From 282369b6fd58a78e6a7c91f21b331363d4ed0fb3 Mon Sep 17 00:00:00 2001 From: Umar Farooq Date: Thu, 13 Jul 2017 12:20:56 +0200 Subject: Add Collectd as a Monitor Type A plugin for collectd is added to use collectd on compute as a monitor type. Monitor files are updated accordingly. The inspector now listens on all interfaces instead of only localhost to enable it to communicate with compute node. JIRA: DOCTOR-86 JIRA: DOCTOR-101 Change-Id: Idc834d428152e4687020eff7d8db36a652b1bf86 Signed-off-by: Umar Farooq --- tests/lib/monitor | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/lib/monitor (limited to 'tests/lib/monitor') diff --git a/tests/lib/monitor b/tests/lib/monitor new file mode 100644 index 00000000..6b804ec2 --- /dev/null +++ b/tests/lib/monitor @@ -0,0 +1,31 @@ +#!/bin/bash + +MONITOR_TYPE=${MONITOR_TYPE:-sample} + +function is_monitor_supported { + local monitor="$1" + [[ -f $TOP_DIR/lib/monitors/$monitor/$monitor ]] +} + +function is_monitor { + local monitor="$1" + [[ $monitor == $MONITOR_TYPE ]] +} + +function start_monitor { + start_monitor_$MONITOR_TYPE +} + +function stop_monitor { + stop_monitor_$MONITOR_TYPE +} + +function cleanup_monitor { + cleanup_monitor_$MONITOR_TYPE +} + +if ! is_monitor_supported $MONITOR_TYPE; then + die $LINENO "MONITOR_TYPE=$MONITOR_TYPE is not supported." +fi + +source $TOP_DIR/lib/monitors/$MONITOR_TYPE/$MONITOR_TYPE -- cgit 1.2.3-korg