TeamViewer.tst: New test to check TeamViewer Host on OS X
authorAlexander Barton <alex@barton.de>
Thu, 28 Aug 2014 11:11:59 +0000 (13:11 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 28 Aug 2014 11:11:59 +0000 (13:11 +0200)
client/lib/tests/Darwin/TeamViewer.tst [new file with mode: 0644]

diff --git a/client/lib/tests/Darwin/TeamViewer.tst b/client/lib/tests/Darwin/TeamViewer.tst
new file mode 100644 (file)
index 0000000..016fbdb
--- /dev/null
@@ -0,0 +1,33 @@
+# NagCollect -- Nagios Data Collector for Passive Checks
+# Copyright (c)2010-2014 Alexander Barton, alex@barton.de
+
+# Check TeamViewer Host installation
+
+SERVICE="TV_p"
+
+v=9
+id=`defaults read /Library/Preferences/com.teamviewer.teamviewer9 ClientID 2>/dev/null`
+if [ -z "$id" ]; then
+       v=8
+       id=`defaults read /Library/Preferences/com.TeamViewer8.Settings ClientID 2>/dev/null`
+       if [ -z "$id" ]; then
+               v=7
+               id=`defaults read /Library/Preferences/com.TeamViewer7.Settings ClientID 2>/dev/null`
+               if [ -z "$id" ]; then
+                       v=6
+                       id=`defaults read /Library/Preferences/com.TeamViewer6.Settings ClientID 2>/dev/null`
+               fi
+       fi
+fi
+
+if [ -n "$id" ]; then
+       STATUS=4
+       TEXT="TeamViewer $v ID: $id"
+       killall -0 TeamViewerHost >/dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               STATUS=1
+               TEXT="$TEXT - TeamViewerHost seems not to be running?"
+       else
+               STATUS=0
+       fi
+fi