Breaking the results in status information
Posted: Sat Dec 02, 2017 9:59 am
https://support.nagios.com/forum/viewto ... 07#p237307
Hi @mcapra, @mcapra,
I am following up from the previous thread. The link is attached above.
Is there a way I can do for a more presentable display on the received results of my software version.
As of now it appears in a single line.
Is that possible me to display as below?
I am reattaching the initial working vb script from the previous thread.
Hi @mcapra, @mcapra,
I am following up from the previous thread. The link is attached above.
Is there a way I can do for a more presentable display on the received results of my software version.
As of now it appears in a single line.
Code: Select all
Name= Service Pack 2 for SQL Server 2008 R2 (KB2630458) (64-bit), Version= 10.52.4000.0, Publisher= Microsoft Corporation Name= GDR 4042 for SQL Server 2008 R2 (KB3045313) (64-bit), Version= 10.52.4042.0, Publisher= Microsoft Corporation Name= System Center Endpoint Protection, Version= 4.10.209.0, Publisher= Microsoft Corporation Name= Microsoft SQL Server 2008 R2 (64-bit), Version= , Publisher= Microsoft Corporation Name= Microsoft SQL Server 2008 R2 (64-bit), Version= , Publisher= Microsoft CorporationCode: Select all
Name= Service Pack 2 for SQL Server 2008 R2 (KB2630458) (64-bit), Version= 10.52.4000.0, Publisher= Microsoft Corporation
Name= GDR 4042 for SQL Server 2008 R2 (KB3045313) (64-bit), Version= 10.52.4042.0, Publisher= Microsoft Corporation
Name= System Center Endpoint Protection, Version= 4.10.209.0, Publisher= Microsoft Corporation
Name= Microsoft SQL Server 2008 R2 (64-bit), Version= , Publisher= Microsoft Corporation
Name= Microsoft SQL Server 2008 R2 (64-bit), Version= , Publisher= Microsoft CorporationCode: Select all
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
Dim myString
For Each objSoftware in colSoftware
myString = myString & "Name= "
myString = myString & objSoftware.Name
myString = myString & ", Version= "
myString = myString & objSoftware.Version
myString = myString & ", Vendor= "
myString = myString & objSoftware.Vendor
myString = myString & objSoftware.Vendor
myString = myString & vbCr
Next
WScript.Echo myString