Module: check_mk
Branch: master
Commit: 33b62e6a9e9c20b541ccca35898103cb73feac34
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33b62e6a9e9c20…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Tue May 23 14:15:04 2017 +0200
4568 FIX mk_inventory.vbs: fixed getNetworkAdpater function to prevent errors caused by
null arrays
Change-Id: I1a0c3f109471019e3af4337c37ed34012d114ba8
---
.werks/4568 | 10 ++++++++++
agents/windows/plugins/mk_inventory.vbs | 14 ++++++++++----
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/.werks/4568 b/.werks/4568
new file mode 100644
index 0000000..054040f
--- /dev/null
+++ b/.werks/4568
@@ -0,0 +1,10 @@
+Title: mk_inventory.vbs: fixed getNetworkAdpater function to prevent errors caused by
null arrays
+Level: 2
+Component: inv
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1495541509
+Class: fix
+
+
diff --git a/agents/windows/plugins/mk_inventory.vbs
b/agents/windows/plugins/mk_inventory.vbs
index 6b5b7cc..df3990a 100644
--- a/agents/windows/plugins/mk_inventory.vbs
+++ b/agents/windows/plugins/mk_inventory.vbs
@@ -141,13 +141,19 @@ Sub getNetworkAdapter(arrVars)
For Each adapterCfg in AdapterConfigs
If entry.name = adapterCfg.Description Then
- outPut("Address: " & join(adapterCfg.IPAddress))
- outPut("Subnet: " & join(adapterCfg.IPSubnet))
- outPut("DefaultGateway: " &
join(adapterCfg.DefaultIPGateway))
+ If not isNull(adapterCfg.IPAddress) Then
+ outPut("Address: " & join(adapterCfg.IPAddress))
+ End If
+ If not isNull(adapterCfg.IPSubnet) Then
+ outPut("Subnet: " & join(adapterCfg.IPSubnet))
+ End If
+ If not isNull(adapterCfg.DefaultIPGateway) Then
+ outPut("DefaultGateway: " &
join(adapterCfg.DefaultIPGateway))
+ End If
End If
Next
End If
- Next
+ Next
End Sub
Sub RecurseForExecs(strFolderPath)