From 2f45ccc2bb7502a5c1e3c3fbc35eac03e48d4d47 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 29 Apr 2015 17:20:49 +0200 Subject: [PATCH] Fixed diferent errors, tiquet: #2127 --- pandora_agents/win32/bin/util/cdromdrives.vbs | 6 ++++- pandora_agents/win32/bin/util/cpuinfo.vbs | 2 +- pandora_agents/win32/bin/util/diskdrives.vbs | 22 ++++++++++++++----- pandora_agents/win32/bin/util/ifaces.vbs | 10 ++++++++- pandora_agents/win32/bin/util/moboinfo.vbs | 4 ++++ pandora_agents/win32/bin/util/monitors.vbs | 4 ++++ pandora_agents/win32/bin/util/printers.vbs | 22 +++++++++++++------ pandora_agents/win32/bin/util/productID.vbs | 2 +- pandora_agents/win32/bin/util/raminfo.vbs | 8 +++++-- .../win32/bin/util/software_installed.vbs | 8 +++---- pandora_agents/win32/bin/util/userslogged.vbs | 9 ++++++-- .../win32/bin/util/videocardinfo.vbs | 8 +++++-- 12 files changed, 77 insertions(+), 28 deletions(-) diff --git a/pandora_agents/win32/bin/util/cdromdrives.vbs b/pandora_agents/win32/bin/util/cdromdrives.vbs index 8edd6a8172..fc73a2bd32 100644 --- a/pandora_agents/win32/bin/util/cdromdrives.vbs +++ b/pandora_agents/win32/bin/util/cdromdrives.vbs @@ -1,9 +1,13 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next 'WMI CD_ROM_drives_info Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" -Wscript.StdOut.WriteLine "CDROMs" +Wscript.StdOut.WriteLine "CDROM" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" diff --git a/pandora_agents/win32/bin/util/cpuinfo.vbs b/pandora_agents/win32/bin/util/cpuinfo.vbs index cd65e2dcfd..4255ec9b77 100644 --- a/pandora_agents/win32/bin/util/cpuinfo.vbs +++ b/pandora_agents/win32/bin/util/cpuinfo.vbs @@ -12,7 +12,7 @@ Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\ Set colCPUs = objWMIService.ExecQuery("Select name,maxclockspeed,caption from Win32_Processor") For Each cpu In colCPUs - Wscript.StdOut.WriteLine "" + Wscript.StdOut.WriteLine "" Next Wscript.StdOut.WriteLine "" diff --git a/pandora_agents/win32/bin/util/diskdrives.vbs b/pandora_agents/win32/bin/util/diskdrives.vbs index 3cba8eb106..57ec380b6e 100644 --- a/pandora_agents/win32/bin/util/diskdrives.vbs +++ b/pandora_agents/win32/bin/util/diskdrives.vbs @@ -1,21 +1,31 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next 'WMI disksinfo Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" -Wscript.StdOut.WriteLine "Disks" +Wscript.StdOut.WriteLine "HD" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") -Set colHDDs = objWMIService.ExecQuery("Select caption,size,serialnumber from win32_diskdrive") +Set colHDDs = objWMIService.ExecQuery("Select * from win32_diskdrive") For Each disco In colHDDs - Wscript.StdOut.WriteLine "" + If ((not IsNull(disco.size)) AND (disco.size > 0)) then + Wscript.StdOut.Write "" + End If Next Wscript.StdOut.WriteLine "" diff --git a/pandora_agents/win32/bin/util/ifaces.vbs b/pandora_agents/win32/bin/util/ifaces.vbs index 45be437a78..d08d23bc5e 100644 --- a/pandora_agents/win32/bin/util/ifaces.vbs +++ b/pandora_agents/win32/bin/util/ifaces.vbs @@ -1,3 +1,7 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next 'WMI real interfaces info ' exlusions: @@ -14,7 +18,11 @@ Wscript.StdOut.WriteLine "" strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") -Set colAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter Where not PNPDeviceID like 'ROOT%%' and not PNPDeviceID like 'SW%%'") +Set colAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter " & _ + "Where not PNPDeviceID like 'ROOT%%' " & _ + "and not PNPDeviceID like 'SW%%' " & _ + "and not ServiceName is null " & _ + "and not ServiceName like 'vwifimp' ") For Each iface In colAdapters ' return model MACAddress IPAddress diff --git a/pandora_agents/win32/bin/util/moboinfo.vbs b/pandora_agents/win32/bin/util/moboinfo.vbs index 74753c0db5..5557d894c0 100644 --- a/pandora_agents/win32/bin/util/moboinfo.vbs +++ b/pandora_agents/win32/bin/util/moboinfo.vbs @@ -1,3 +1,7 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next 'WMI mobo info diff --git a/pandora_agents/win32/bin/util/monitors.vbs b/pandora_agents/win32/bin/util/monitors.vbs index c767a5a992..7655d18328 100644 --- a/pandora_agents/win32/bin/util/monitors.vbs +++ b/pandora_agents/win32/bin/util/monitors.vbs @@ -1,3 +1,7 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next 'WMI monitorsinfo diff --git a/pandora_agents/win32/bin/util/printers.vbs b/pandora_agents/win32/bin/util/printers.vbs index 30c2d080ee..c664ca33b5 100644 --- a/pandora_agents/win32/bin/util/printers.vbs +++ b/pandora_agents/win32/bin/util/printers.vbs @@ -1,3 +1,7 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- On Error Resume Next 'WMI printers attached @@ -33,13 +37,17 @@ For Each objPrinter in colPrinters WScript.stdOut.Write "" end if diff --git a/pandora_agents/win32/bin/util/productID.vbs b/pandora_agents/win32/bin/util/productID.vbs index 65764d9f0d..f25376ef29 100644 --- a/pandora_agents/win32/bin/util/productID.vbs +++ b/pandora_agents/win32/bin/util/productID.vbs @@ -3,7 +3,7 @@ ' (c) 2015 Sancho Lerena ' This plugin extends agent inventory feature. Only enterprise version ' ---------------------------------------------------------------- - +on error resume next Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" diff --git a/pandora_agents/win32/bin/util/raminfo.vbs b/pandora_agents/win32/bin/util/raminfo.vbs index ee4e1ced98..8750346314 100644 --- a/pandora_agents/win32/bin/util/raminfo.vbs +++ b/pandora_agents/win32/bin/util/raminfo.vbs @@ -1,3 +1,7 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next 'WMI raminfo @@ -13,8 +17,8 @@ Set colRAMs = objWMIService.ExecQuery("Select deviceLocator,capacity,speed from For Each ram In colRAMs Wscript.StdOut.WriteLine "" Next diff --git a/pandora_agents/win32/bin/util/software_installed.vbs b/pandora_agents/win32/bin/util/software_installed.vbs index 39ee5fd946..4317a06732 100644 --- a/pandora_agents/win32/bin/util/software_installed.vbs +++ b/pandora_agents/win32/bin/util/software_installed.vbs @@ -1,10 +1,8 @@ -' -' Windows information retriever: Software Installed -' -' WMI/REGISTRY based +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) ' (c) 2015 Sancho Lerena ' (c) 2015 Borja Sanchez -'-------------------------------------------------------- +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next Class ObjectList diff --git a/pandora_agents/win32/bin/util/userslogged.vbs b/pandora_agents/win32/bin/util/userslogged.vbs index 5251f23573..fcf810015e 100644 --- a/pandora_agents/win32/bin/util/userslogged.vbs +++ b/pandora_agents/win32/bin/util/userslogged.vbs @@ -1,3 +1,7 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next ' Lista todos los usuarios del equipo que han iniciado procesos @@ -57,8 +61,9 @@ Wscript.StdOut.WriteLine "" For Each usuario in loggedUsers - Wscript.StdOut.WriteLine "" + Wscript.StdOut.WriteLine "" next diff --git a/pandora_agents/win32/bin/util/videocardinfo.vbs b/pandora_agents/win32/bin/util/videocardinfo.vbs index e7766c90ba..720389f4c7 100644 --- a/pandora_agents/win32/bin/util/videocardinfo.vbs +++ b/pandora_agents/win32/bin/util/videocardinfo.vbs @@ -1,9 +1,13 @@ +' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms) +' (c) 2015 Borja Sanchez +' This plugin extends agent inventory feature. Only enterprise version +' -------------------------------------------------------------------------- on error resume next 'WMI video_card_info Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" -Wscript.StdOut.WriteLine "VideoCards" +Wscript.StdOut.WriteLine "Video" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" @@ -13,7 +17,7 @@ Set colVideoCards = objWMIService.ExecQuery("Select caption,AdapterRAM,PNPDevice For Each vcard In colVideoCards Wscript.StdOut.WriteLine "" Next