edir-version.sh 921 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. #
  3. # Version 0.1
  4. #
  5. # Initial release of localcheck to get version information of ndsd via bash
  6. # A similar check is available in this repository written in python (edir-version.py)
  7. #
  8. # This check should be placed in /usr/lib/check_mk_agent/local and made executable with `chmod +x edir-version.sh`
  9. # Check if ndsd is present on the system, if not then exit (nothing to do)
  10. # This assumes that you have exported the environment variables when installing eDirectory
  11. # (c) Michael Honkoop <mhonkoop@comsolve.nl>
  12. # License: GNU General Public License v2
  13. /usr/bin/which ndsd >/dev/null 2>&1
  14. if [ $? -ne 0 ]; then
  15. exit;
  16. fi
  17. # Execute command to retrieve information
  18. VersionInfo=$(ndsd --version)
  19. # Output formatted information to CheckMK
  20. echo "0 \"$(echo $VersionInfo | awk '{ print $2 }')\" - Binary Version $(echo $VersionInfo | awk '{ print $3 }'), DS Version $(echo $VersionInfo | awk '{ print $4 }')"