Module: check_mk
Branch: master
Commit: 091316cf59c22e518738b7eadcd58a1ae708827c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=091316cf59c22e…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Feb 12 10:18:13 2016 +0100
windows agent: mk_inventory now uses utf16 output
this was actually in the last commit, in this commit the code was only cleaned up
slightly
---
agents/windows/plugins/mk_inventory.vbs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/agents/windows/plugins/mk_inventory.vbs
b/agents/windows/plugins/mk_inventory.vbs
index 929bded..d11163c 100644
--- a/agents/windows/plugins/mk_inventory.vbs
+++ b/agents/windows/plugins/mk_inventory.vbs
@@ -10,8 +10,9 @@ exePaths = Array("")
regPaths =
Array("Software\Microsoft\Windows\CurrentVersion\Uninstall","Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall")
Set fso = CreateObject("Scripting.FileSystemObject")
-' request unicode stdout
-Set objStdout = fso.GetStandardStream(1, True)
+' request unicode stdout and add a bom so the agent knows we send utf-16
+Set objStdout = fso.GetStandardStream(1, True)
+objStdout.Write(chrW(&HFEFF))
Set objClass =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set wshShell = WScript.CreateObject( "WScript.Shell" )
remote_host = wshShell.ExpandEnvironmentStrings( "%REMOTE_HOST%" )
@@ -48,8 +49,6 @@ End If
' handle error message ourselves so this script can also be run directly, for
testing
On Error Resume Next
-'need a bom so the agent knows we send utf-16
-outPut(chrW(&HFEFF))
' create new timestamp file
' only allowed when script runs as administrator user