Mk_inventory doesn't work at Windows 10 hosts

Hi guys,
I’ve installed the current version of check_mk raw on ubuntu 19.10.
At my windows 10 clients, I installed the current agent version.
The default checks are performed and the results are displayed in wato.

I have to use the HW/SW Inventory, so i followed the guide in the official documentation.
https://checkmk.de/cms_inventory.html

Now the check is displayed in the services of the windows 10 host, but there are only 15 results in the inventory. I guess the mk_inventory.vbs doesn’t work.

When I execute the mk_inventory.vbs manually on the client there is an exception:
(215, 21) Msi API Error: ProductsEx,Product,UserSid,Contexts

C:\Program Files (x86)\checkmk\service\plugins>Cscript mk_inventory.vbs
Microsoft (R) Windows Script Host, Version 5.812
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

Failed to create time stamp: Der Pfad wurde nicht gefunden. (76)
<<<win_cpuinfo:sep(58):persist(1592313428)>>>
AddressWidth: 64
Architecture: 9
Caption: Intel64 Family 6 Model 142 Stepping 10
CurrentVoltage: 10
DeviceID: CPU0
L2CacheSize: 1024
L3CacheSize: 6144
Manufacturer: GenuineIntel
MaxClockSpeed: 1901
Name: Intel(R) Core™ i5-8350U CPU @ 1.70GHz
NumberOfCores: 4
NumberOfLogicalProcessors: 8
Status: OK
<<<win_os:sep(124):persist(1592313428)>>>
L25PBXA70ZK01|Microsoft Windows 10 Enterprise|10.0.19041|64-Bit|0|0|20200604151414.000000+120
<<<win_bios:sep(58):persist(1592313428)>>>
InstallDate:
ListOfLanguages: enUS jaJP
Manufacturer: FUJITSU // Insyde Software Corp.
Name: Version 1.12
PrimaryBIOS: Wahr
ReleaseDate: 20180619000000.000000+000
SerialNumber: DSAL065149
SMBIOSBIOSVersion: Version 1.12
SMBIOSMajorVersion: 3
SMBIOSMinorVersion: 0
<<<win_system:sep(58):persist(1592313428)>>>
HotSwappable:
InstallDate:
Manufacturer: FUJITSU
Model:
Name: Computergehäuse
PartNumber:
SerialNumber: DSAL065149
<<<win_computersystem:sep(58):persist(1592313428)>>>
InstallDate:
Manufacturer: FUJITSU
Model: LIFEBOOK U758
Name: L25PBXA70ZK01
<<<win_disks:sep(58):persist(1592313428)>>>
InterfaceType: IDE
Manufacturer: (Standardlaufwerke)
MediaType: Fixed hard disk media
Model: SAMSUNG MZNLN256HAJQ-00000
Name: \.\PHYSICALDRIVE0
SerialNumber: S3TSNA0M545093
Signature:
Size: 256052966400
<<<win_video:sep(58):persist(1592313428)>>>
AdapterCompatibility: Intel Corporation
AdapterRAM: 1073741824
Caption: Intel(R) UHD Graphics 620
DriverDate: 20190925000000.000000-000
DriverVersion: 26.20.100.7262
MaxMemorySupported:
Name: Intel(R) UHD Graphics 620
VideoMode:
VideoModeDescription: 2560 x 1440 x 4294967296 Farben
VideoProcessor: Intel(R) UHD Graphics Family
<<<win_networkadapter:sep(58):persist(1592313428)>>>
AdapterType: Ethernet 802.3
DeviceID: 1
MACAddress: D0:AB:D5:4B:CA:08
Name: Intel(R) Dual Band Wireless-AC 8265
NetworkAddresses:
ServiceName: Netwtw06
Speed: 120000000
Address: 192.12.3.157 fe80::f8e9:1a98:5aed:13bf
Subnet: 255.255.255.0 64
DefaultGateway: 192.12.3.1
AdapterType: Ethernet 802.3
DeviceID: 2
MACAddress: A0:66:10:C2:F4:B3
Name: Intel(R) Ethernet Connection (4) I219-LM
NetworkAddresses:
ServiceName: e1i65x64
Speed: 9223372036854775807
AdapterType: Ethernet 802.3
DeviceID: 3
MACAddress: D0:AB:D5:4B:CA:09
Name: Microsoft Wi-Fi Direct Virtual Adapter
NetworkAddresses:
ServiceName: vwifimp
Speed: 9223372036854775807
AdapterType: Drahtlos
DeviceID: 4
MACAddress: 9C:81:B9:40:59:53
Name: Generic Mobile Broadband Adapter
NetworkAddresses:
ServiceName: cxwmbclass
Speed: 0
AdapterType: Ethernet 802.3
DeviceID: 10
MACAddress: 3E:29:20:52:41:53
Name: WAN Miniport (IP)
NetworkAddresses:
ServiceName: NdisWan
Speed:
AdapterType: Ethernet 802.3
DeviceID: 11
MACAddress: 40:8F:20:52:41:53
Name: WAN Miniport (IPv6)
NetworkAddresses:
ServiceName: NdisWan
Speed:
AdapterType: Ethernet 802.3
DeviceID: 12
MACAddress: 42:EC:20:52:41:53
Name: WAN Miniport (Network Monitor)
NetworkAddresses:
ServiceName: NdisWan
Speed:
AdapterType: Ethernet 802.3
DeviceID: 13
MACAddress: D2:AB:D5:4B:CA:08
Name: Microsoft Wi-Fi Direct Virtual Adapter #2
NetworkAddresses:
ServiceName: vwifimp
Speed: 9223372036854775807
<<<win_ip_r:sep(124):persist(1592313428)>>>
indirect|0.0.0.0|0.0.0.0|192.12.3.1|Intel(R) Dual Band Wireless-AC 8265
direct|192.12.3.0|255.255.255.0|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|192.12.3.157|255.255.255.255|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|192.12.3.255|255.255.255.255|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|224.0.0.0|240.0.0.0|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|255.255.255.255|255.255.255.255|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
<<<win_wmi_software:sep(124):persist(1592313428)>>>
C:\Program Files (x86)\checkmk\service\plugins\mk_inventory.vbs(215, 21) Msi API Error: ProductsEx,Product,UserSid,Contexts

Someone an idea?

cheers
Philipp

Two:

  1. Delete or comment the WMI Software Section in the vbs and try anew - it works for me.
  2. Create a support request to Tribe to fix the inventory script so that it can be run on Win 10 clients correctly

Maybe there are more but i would use option 1 first ^^
If you’re super in vbs - fix the script yourself and publish the fix on github :slight_smile:
Code:
’ Installed Software
’ Call startSection(“win_wmi_software”,124,timeUntil)
’ swVars = Array( “ProductName”, “Publisher”, “VersionString”, “InstallDate”, “Language”)
’ Call SoftwareFromInstaller(swVars)

Some comment also from my side.
I would recommend to disable the WMI software section on all systems.
The quality of this data compared to the registry information is worse. The information is redundant to registry data.
I found no good use case for the WMI software information :slight_smile:

thank you for your reply! :slight_smile:

I comment out the WMI Section.
When I start manually the Script on the client the output seems to be okay with many items.

But in Check_MK there are still 15 items in the inventory. :frowning:

I deactivate the rule with "check once a day " which is default and in the vbs I changed the delay to 60s for testing.
I reinstalled the Agent too but it stays the same.

The timing setting is inside the script not a rule. You can only use a rule if you use the Enterprise edition and baked agents. Inside the mk_inventory.vbs you find the line delay = 14400 this is the interval the script is running on the Windows host. Every 4 hours.

I changed the delay in the inventory.vbs to 60 and restartet the service.
The rule that I mean is generatet by default is the normal check interval for this service and is called “Restrict HW/SW-Inventory to once a day” by default. I deactivate this rule, so the normal check intervall is 60s.

I don’t understand why the inventory.vbs output is okay, if I start this script manually on the monitored host:
C:\Program Files (x86)\checkmk\service\plugins>Cscript mk_inventory.vbs

<<<win_cpuinfo:sep(58):persist(1592386594)>>>
AddressWidth: 64
Architecture: 9
Caption: Intel64 Family 6 Model 142 Stepping 10
CurrentVoltage: 10
DeviceID: CPU0
L2CacheSize: 1024
L3CacheSize: 6144
Manufacturer: GenuineIntel
MaxClockSpeed: 1901
Name: Intel(R) Core™ i5-8350U CPU @ 1.70GHz
NumberOfCores: 4
NumberOfLogicalProcessors: 8
Status: OK
<<<win_os:sep(124):persist(1592386594)>>>
L25PBXA70ZK01|Microsoft Windows 10 Enterprise|10.0.19041|64-Bit|0|0|20200604151414.000000+120
<<<win_bios:sep(58):persist(1592386594)>>>
InstallDate:
ListOfLanguages: enUS jaJP
Manufacturer: FUJITSU // Insyde Software Corp.
Name: Version 1.12
PrimaryBIOS: Wahr
ReleaseDate: 20180619000000.000000+000
SerialNumber: DSAL065149
SMBIOSBIOSVersion: Version 1.12
SMBIOSMajorVersion: 3
SMBIOSMinorVersion: 0
<<<win_system:sep(58):persist(1592386594)>>>
HotSwappable:
InstallDate:
Manufacturer: FUJITSU
Model:
Name: Computergehäuse
PartNumber:
SerialNumber: DSAL065149
<<<win_computersystem:sep(58):persist(1592386594)>>>
InstallDate:
Manufacturer: FUJITSU
Model: LIFEBOOK U758
Name: L25PBXA70ZK01
<<<win_disks:sep(58):persist(1592386594)>>>
InterfaceType: IDE
Manufacturer: (Standardlaufwerke)
MediaType: Fixed hard disk media
Model: SAMSUNG MZNLN256HAJQ-00000
Name: \.\PHYSICALDRIVE0
SerialNumber: S3TSNA0M545093
Signature:
Size: 256052966400
<<<win_video:sep(58):persist(1592386594)>>>
AdapterCompatibility: Intel Corporation
AdapterRAM: 1073741824
Caption: Intel(R) UHD Graphics 620
DriverDate: 20190925000000.000000-000
DriverVersion: 26.20.100.7262
MaxMemorySupported:
Name: Intel(R) UHD Graphics 620
VideoMode:
VideoModeDescription: 2560 x 1440 x 4294967296 Farben
VideoProcessor: Intel(R) UHD Graphics Family
<<<win_networkadapter:sep(58):persist(1592386594)>>>
AdapterType: Ethernet 802.3
DeviceID: 1
MACAddress: D0:AB:D5:4B:CA:08
Name: Intel(R) Dual Band Wireless-AC 8265
NetworkAddresses:
ServiceName: Netwtw06
Speed: 240000000
Address: 192.12.3.157 fe80::f8e9:1a98:5aed:13bf
Subnet: 255.255.255.0 64
DefaultGateway: 192.12.3.1
AdapterType: Ethernet 802.3
DeviceID: 2
MACAddress: A0:66:10:C2:F4:B3
Name: Intel(R) Ethernet Connection (4) I219-LM
NetworkAddresses:
ServiceName: e1i65x64
Speed: 9223372036854775807
AdapterType: Ethernet 802.3
DeviceID: 3
MACAddress: D0:AB:D5:4B:CA:09
Name: Microsoft Wi-Fi Direct Virtual Adapter
NetworkAddresses:
ServiceName: vwifimp
Speed: 9223372036854775807
AdapterType: Drahtlos
DeviceID: 4
MACAddress: 9C:81:B9:40:59:53
Name: Generic Mobile Broadband Adapter
NetworkAddresses:
ServiceName: cxwmbclass
Speed: 0
AdapterType: Ethernet 802.3
DeviceID: 10
MACAddress: 3E:29:20:52:41:53
Name: WAN Miniport (IP)
NetworkAddresses:
ServiceName: NdisWan
Speed:
AdapterType: Ethernet 802.3
DeviceID: 11
MACAddress: 40:8F:20:52:41:53
Name: WAN Miniport (IPv6)
NetworkAddresses:
ServiceName: NdisWan
Speed:
AdapterType: Ethernet 802.3
DeviceID: 12
MACAddress: 42:EC:20:52:41:53
Name: WAN Miniport (Network Monitor)
NetworkAddresses:
ServiceName: NdisWan
Speed:
AdapterType: Ethernet 802.3
DeviceID: 13
MACAddress: D2:AB:D5:4B:CA:08
Name: Microsoft Wi-Fi Direct Virtual Adapter #2
NetworkAddresses:
ServiceName: vwifimp
Speed: 9223372036854775807
<<<win_ip_r:sep(124):persist(1592386594)>>>
indirect|0.0.0.0|0.0.0.0|192.12.3.1|Intel(R) Dual Band Wireless-AC 8265
direct|192.12.3.0|255.255.255.0|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|192.12.3.157|255.255.255.255|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|192.12.3.255|255.255.255.255|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|224.0.0.0|240.0.0.0|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
direct|255.255.255.255|255.255.255.255|0.0.0.0|Intel(R) Dual Band Wireless-AC 8265
<<<win_wmi_updates:sep(44):persist(1592386594)>>>

Node,Description,HotFixID,InstalledOn
L25PBXA70ZK01,Update,KB4552925,6/4/2020
L25PBXA70ZK01,Security Update,KB4537759,6/4/2020
L25PBXA70ZK01,Security Update,KB4557968,6/4/2020
L25PBXA70ZK01,Security Update,KB4560366,6/10/2020
L25PBXA70ZK01,Security Update,KB4561600,6/10/2020
L25PBXA70ZK01,Update,KB4557957,6/10/2020
<<<win_reg_uninstall:sep(124):persist(1592386594)>>>
Mozilla Firefox 77.0.1 (x64 de)|Mozilla|C:\Program Files\Mozilla Firefox|Mozilla Firefox 77.0.1 (x64 de)|77.0.1|||
Mozilla Maintenance Service|Mozilla||MozillaMaintenanceService|72.0.2|||
VLC media player|VideoLAN|C:\Program Files\VideoLAN\VLC|VLC media player|3.0.10|||
Realtek USB Audio|Realtek Semiconductor Corp.|C:\Program Files\Realtek\Audio\USB|{0A46A65D-89AC-464C-8026-3CD44960BD04}|6.3.9600.208|||
PuTTY release 0.73 (64-bit)|Simon Tatham||{44F7642C-AB7E-4468-B028-E8D08A0CBB0E}|0.73.0.0||20200128|1033
Bonjour|Apple Inc.|C:\Program Files (x86)\Bonjour|{56DDDFB8-7F79-4480-89D5-25E1F52AB28F}|3.1.0.1||20200615|1031
iTunes|Apple Inc.|C:\Program Files\iTunes|{B1C89128-5D3E-4873-B229-C3889F605511}|12.10.7.3||20200615|1031
Apple Mobile Device Support|Apple Inc.|C:\Program Files\Common Files\Apple\Mobile Device Support|{C788AE25-3D4E-4D18-811B-3219F778487E}|13.5.1.2||20200615|1033
Apple Application Support (64-Bit)|Apple Inc.|C:\Program Files\Common Files\Apple\Apple Application Support|{D39B163A-9E12-442C-95E9-33FA5746AB21}|8.5||20200615|1031
LibreOffice 6.4.4.2|The Document Foundation|C:\Program Files\LibreOffice|{F00C391B-6092-40E7-9ECD-144933865571}|6.4.4.2||20200526|1031
Notepad++ (32-bit x86)|Notepad++ Team||Notepad++|7.8.6|||
Robo 3T 1.3.1|3T Software Labs Ltd||Robo 3T 1.3.1|1.3.1|||
Check MK Agent 1.6|tribe29 GmbH||{03F932E4-B854-4380-ACEE-AD53EFD0B5B0}|1.6.0p13||20200617|1033
Apple Application Support (32-Bit)|Apple Inc.|C:\Program Files (x86)\Common Files\Apple\Apple Application Support|{11C4575B-4B32-44D2-A097-D59A00BA60DE}|8.5||20200615|1031
Apple Software Update|Apple Inc.|C:\Program Files (x86)\Apple Software Update|{A3985C05-7386-411F-A4BF-32A73F37EB44}|2.6.3.1||20200615|1031
Realtek High Definition Audio Driver|Realtek Semiconductor Corp.|C:\Program Files\Realtek\Audio\HDA|{F132AF7F-7BCA-4EDE-8A7C-958108FE7DBC}|6.0.1.8519|||
<<<win_exefiles:sep(124):persist(1592386594)>>>

But in check_mk the result is still not okay without software information:

On your monitoring server take a look at the folder “~/var/check_mk/persisted” there you should find the data transferred from your agent regarding inventory.
An later if the data is processed you should see files inside “~/var/check_mk/inventory”.

the persisted folder is empty

~/var/check_mk/persisted$ ls -l
total 0

Hi @firetux,
lookup in Inventory. CheckMK deletes the data from persisted once it has processed it.
I am still wondering which part of the agent output is processed in the normal Windows inventory- the WMI oder Reg Part. If CheckMK uses the WMI part in favor of the reg Part we have an explanation.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.