1
0

edir-version.sh 737 B

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