瀏覽代碼

Initial commit of edir-version.sh

Michael Honkoop 5 月之前
父節點
當前提交
7d6d8911d9
共有 1 個文件被更改,包括 19 次插入0 次删除
  1. 19 0
      edir-version.sh

+ 19 - 0
edir-version.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Version 0.1
+#
+# Initial release of localcheck to get version information of ndsd
+#
+
+# Check if ndsd is present on the system, if not then exit (nothing to do)
+# This assumes that you have exported the environment variables when installing eDirectory
+/usr/bin/which ndsd >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+    exit;
+fi
+
+# Execute command to retrieve information
+VersionInfo=$(ndsd --version)
+
+# Output formatted information to CheckMK
+echo "0 \"$(echo $VersionInfo | awk '{ print $2 }')\" - Binary Version $(echo $VersionInfo | awk '{ print $3 }'), DS Version $(echo $VersionInfo | awk '{ print $4 }')"