| 12345678910111213141516171819202122232425262728293031 |
- #!/bin/bash
- #
- # (c) Michael Honkoop <mhonkoop@comsolve.nl>
- # License: GNU General Public License v2
- # Version 0.1 : Initial release
- # Version 0.2 : Updated structure and status reporting when prerequisites are not met.
- #
- SCRIPTVERSION= 0.2
- # A similar check is available in this repository written in python (edir-version.py)
- #
- # This check should be placed in /usr/lib/check_mk_agent/local and made executable with `chmod +x edir-version.sh`
- # Servicename to show in CheckMK
- SERVICE="ndsd"
- # Check if ndsd is present on the system, if not then report it.
- # This assumes that you have exported the environment variables when installing eDirectory
- if ! command -v "$SERVICE" >/dev/null 2>&1; then
- echo "3 \"$SERVICE\" - $SERVICE executable was not found."
- exit 0;
- 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 }')"
- exit 0;
|