Module: check_mk
Branch: master
Commit: 6e0b0f4e90ad4390e774f6b2427afb857b4b3bef
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e0b0f4e90ad43…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 23 17:39:55 2015 +0100
mk_inventory.ps1" minor code cleanup
---
agents/windows/plugins/mk_inventory.ps1 | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/agents/windows/plugins/mk_inventory.ps1
b/agents/windows/plugins/mk_inventory.ps1
index 03299ca..0a11313 100644
--- a/agents/windows/plugins/mk_inventory.ps1
+++ b/agents/windows/plugins/mk_inventory.ps1
@@ -1,3 +1,7 @@
+# Configuration
+$delay = 14400 # execute agent only every $delay seconds
+$exe_paths = @("c:\Program Files (x86)")
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
write-output "" # workaround to prevent the byte order mark to be at the
beginning of the first section
$name = (Get-Item env:\Computername).Value
@@ -13,8 +17,6 @@ if (!$agent_dir) {
$timestamp = $agent_dir + "\timestamp."+ $remote_host
-# execute agent only every $delay seconds
-$delay = 14400
# does $timestamp exist?
If (Test-Path $timestamp){
@@ -87,8 +89,7 @@ foreach ($path in $paths) {
# Search exes
write-host "<<<win_exefiles:sep(124):persist($until)>>>"
-$paths = @("c:\Program Files (x86)")
-foreach ($item in $paths)
+foreach ($item in $exe_paths)
{
if ((Test-Path $item -pathType container))
{