Nagios captures only a single line output from VB script
Posted: Mon Nov 06, 2017 3:48 pm
Hi Gurus,
I am quite new to scripting and Nagios. Kindly excuse if my sentence happen to make no sense. I am using currently using unlicensed version.
I need to passively capture software version from remote machines to XI server. I installed NSClient++ in the remote and sending my output to XI server via NCPA.
I tried using both WMI and VB script to pull the software versions. WMI does the job but Nagios displays only 32-bit software versions with a cut off 256 characters.
I followed the guide - https://support.nagios.com/kb/article.php?id=478 -- but only managed to change the output to 512 characters. I am not sure if this due to not licensed version.
VB script on the other hand runs with correct output on CMD but only displays a single line of information in Nagios Dashboard.
I need help to capture both 32bit and 64bit software version of my computer to be pushed passively to Nagios XI. Please help.
-------------------------------
Nagios XI Dashboard View
-------------------------------
I am quite new to scripting and Nagios. Kindly excuse if my sentence happen to make no sense. I am using currently using unlicensed version.
I need to passively capture software version from remote machines to XI server. I installed NSClient++ in the remote and sending my output to XI server via NCPA.
I tried using both WMI and VB script to pull the software versions. WMI does the job but Nagios displays only 32-bit software versions with a cut off 256 characters.
I followed the guide - https://support.nagios.com/kb/article.php?id=478 -- but only managed to change the output to 512 characters. I am not sure if this due to not licensed version.
VB script on the other hand runs with correct output on CMD but only displays a single line of information in Nagios Dashboard.
I need help to capture both 32bit and 64bit software version of my computer to be pushed passively to Nagios XI. Please help.
Code: Select all
-----------------
NSClient.ini file
-----------------
[/settings/scheduler/schedules]
WMI Check = checkWMI "Query=Select Name,Version from Win32_Product"
VBS Check = versioncheck
[/settings/external scripts/scripts]
versioncheck = cscript.exe //T:30 //NoLogo scripts\\versioncheck.vbsCode: Select all
----------
VB Script
----------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
For Each objSoftware in colSoftware
Wscript.Echo "Name= " & objSoftware.Name & ", " & "Version= " & objSoftware.Version & ", " & "Vendor= " & objSoftware.Vendor
NextNagios XI Dashboard View
-------------------------------
Code: Select all
Service-------Status--------- Status Information
VBS Check-----Ok------------Name= Microsoft Application Error Reporting, Version= 12.0.6015.5000, Vendor= Microsoft CorporationCode: Select all
WMI Check----Ok-------------Name=Microsoft Application Error ReportingVersion=12.0.6015.5000Name=Microsoft Access database engine 2010 (English)Version=14.0.7015.1000Name=VisualGPSVersion=4.2.105Name=MicrosoftAntimalwareVersion=3.0.8402.2Name=Microsoft Security ClientVersion=2.1.1116.0Name=Microsoft
.NETFramework 4.5Version=4.5.50709Name=WellSyncNVersion=8.2.0Name=SQL Server 2008 R2 SP2 Database Engine ServicesVersion=10.52.4000.0Name=Microsoft SQL Server 2008 R2 RsFx DriverVersion=10.52.4000.0Name=Microsoft Forefront Endpoint Prot