#!/usr/bin/python # # Version 0.1 # # Initial release of localcheck in python to get version information of ndsd # # This check should be placed in /usr/lib/check_mk_agent/local and made executable with `chmod +x edir-version.py` import subprocess myexec = "ndsd" try: output = subprocess.check_output([myexec, "--version"]) output_arr = output.split(' ') print("0 \"" + output_arr[1] + "\" - Binary Version: " + output_arr[2] + ", DS Version: " + output_arr[3]) except subprocess.CalledProcessError as e: exit()