edir-version.py 534 B

12345678910111213141516171819
  1. #!/usr/bin/python
  2. #
  3. # Version 0.1
  4. #
  5. # Initial release of localcheck in python 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.py`
  8. import subprocess
  9. myexec = "ndsd"
  10. try:
  11. output = subprocess.check_output([myexec, "--version"])
  12. output_arr = output.split(' ')
  13. print("0 \"" + output_arr[1] + "\" - Binary Version: " + output_arr[2] + ", DS Version: " + output_arr[3])
  14. except subprocess.CalledProcessError as e:
  15. exit()