Module: check_mk
Branch: master
Commit: 86195fe7c3c362388e3c63239a6dce62e9657356
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=86195fe7c3c362…
Author: Florian Heigl <floh(a)Klappstuhl.(none)>
Date: Fri Feb 25 09:55:13 2011 +0100
backend for new windows checks
---
agents/windows/plugins/windows_multipath.vbs | 25 +++++++++++++++++++++++++
agents/windows/plugins/windows_time.bat | 25 +++++++++++++++++++++++++
2 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/agents/windows/plugins/windows_multipath.vbs
b/agents/windows/plugins/windows_multipath.vbs
new file mode 100644
index 0000000..9cae99b
--- /dev/null
+++ b/agents/windows/plugins/windows_multipath.vbs
@@ -0,0 +1,25 @@
+' MPIO_PATH_INFORMATION.vbs
+' VBS WMI MPIO
+' Author: Torsten Haake
+' Date: 2011-02-15
+' -----------------------------------------------'
+Option Explicit
+Dim objWMIService, objItem, colItems, strComputer
+
+' On Error Resume Next
+strComputer = "."
+
+# added for check_mk parsing (fh(a)mathias-ketter.de)
+Wscript.Echo "<<<windows_multipath>>>"
+
+' WMI connection to Root WMI
+Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\WMI")
+Set colItems = objWMIService.ExecQuery("Select * from
+MPIO_PATH_INFORMATION")
+
+For Each objItem in colItems
+ Wscript.Echo objItem.NumberPaths
+Next
+
+WSCript.Quit
+
diff --git a/agents/windows/plugins/windows_time.bat
b/agents/windows/plugins/windows_time.bat
new file mode 100644
index 0000000..bd349be
--- /dev/null
+++ b/agents/windows/plugins/windows_time.bat
@@ -0,0 +1,25 @@
+@echo off
+
+REM Windows time checks
+REM <fh(a)mathias-kettner.de>
+REM
+REM
+
+REM Win2008
+set W2K8 = "Microsoft Windows [Version 6.0.6002]"
+
+
+echo "<<<windows_time>>>"
+
+REM only w2k8 / vista /win7 are able to report ntp status.
+if ver = "%W2K8%" w32tm /query /status
+
+REM win2003 can _test_ the ntp server using w32tm /once, but we don't want
+REM to test EVERY minute, it takes a few seconds and will hammer the NTP server.
+REM I very much recommend to monitor for w32time errors in eventlog instead.
+
+REM all others since W2K can at least report their primary SNTP or NTP server
+REM the MS-supplied timeserver is usually blocked in corporate networks, but
+REM windows will default to it.
+net time /querysntp
+