From e2976138e14e43a1b13b0f76cac29e1c2db2c941 Mon Sep 17 00:00:00 2001 From: "root@atlantishq-michy-sheppy" Date: Mon, 22 Jun 2020 22:05:53 +0200 Subject: [PATCH] implement source plugin check --- check_source_plugins.sh | 20 ++++++++++++++++++++ commands.d/source-command.conf | 4 ++++ 2 files changed, 24 insertions(+) create mode 100755 check_source_plugins.sh diff --git a/check_source_plugins.sh b/check_source_plugins.sh new file mode 100755 index 0000000..6a93676 --- /dev/null +++ b/check_source_plugins.sh @@ -0,0 +1,20 @@ +#!/bin/bash +PLUGIN_NAME=Skillbird + +/usr/local/bin/insurgency_rcon sm plugins list Skillbird | grep $PLUGIN_NAME &>/dev/null +ins01=$? +/usr/local/bin/insurgency_small_rcon sm plugins list Skillbird | grep $PLUGIN_NAME &>/dev/null +ins02=$? + +if [ "$ins01" -ne "0" ]; then + echo "Plugin not loaded!? (ins01)" + exit 1; +fi + +if [ "$ins02" -ne "0" ]; then + echo "Plugin not loaded!? (ins02)" + exit 1; +fi + +echo "Plugin Loaded" +exit 0 diff --git a/commands.d/source-command.conf b/commands.d/source-command.conf index d12bb8f..24e1023 100644 --- a/commands.d/source-command.conf +++ b/commands.d/source-command.conf @@ -5,3 +5,7 @@ object CheckCommand "source-server" { "-p" = "$port$" } } + +object CheckCommand "source-plugins" { + command = [ "/etc/icinga2/monitoring-tools/check_source_plugins.sh" ] +}