mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Fixed problems with plugins
This commit is contained in:
parent
51cd55da10
commit
01a2383a3b
@ -1,9 +1,13 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
'WMI CD_ROM_drives_info
|
'WMI CD_ROM_drives_info
|
||||||
|
|
||||||
Wscript.StdOut.WriteLine "<inventory>"
|
Wscript.StdOut.WriteLine "<inventory>"
|
||||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||||
Wscript.StdOut.WriteLine "<name>CDROMs</name>"
|
Wscript.StdOut.WriteLine "<name>CDROM</name>"
|
||||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||||
Wscript.StdOut.WriteLine "<datalist>"
|
Wscript.StdOut.WriteLine "<datalist>"
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\
|
|||||||
Set colCPUs = objWMIService.ExecQuery("Select name,maxclockspeed,caption from Win32_Processor")
|
Set colCPUs = objWMIService.ExecQuery("Select name,maxclockspeed,caption from Win32_Processor")
|
||||||
|
|
||||||
For Each cpu In colCPUs
|
For Each cpu In colCPUs
|
||||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & cpu.name & ";" & cpu.maxclockspeed & ";" & cpu.caption & "]]></data>"
|
Wscript.StdOut.WriteLine "<data><![CDATA[" & cpu.name & ";" & cpu.maxclockspeed & " MHz;" & cpu.caption & "]]></data>"
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Wscript.StdOut.WriteLine "</datalist>"
|
Wscript.StdOut.WriteLine "</datalist>"
|
||||||
|
@ -1,21 +1,31 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
'WMI disksinfo
|
'WMI disksinfo
|
||||||
|
|
||||||
Wscript.StdOut.WriteLine "<inventory>"
|
Wscript.StdOut.WriteLine "<inventory>"
|
||||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||||
Wscript.StdOut.WriteLine "<name>Disks</name>"
|
Wscript.StdOut.WriteLine "<name>HD</name>"
|
||||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||||
Wscript.StdOut.WriteLine "<datalist>"
|
Wscript.StdOut.WriteLine "<datalist>"
|
||||||
|
|
||||||
strComputer = "."
|
strComputer = "."
|
||||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
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
|
For Each disco In colHDDs
|
||||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & disco.caption _
|
If ((not IsNull(disco.size)) AND (disco.size > 0)) then
|
||||||
& ";" & (disco.size/(1024*1024)) _
|
Wscript.StdOut.Write "<data><![CDATA[" & disco.caption _
|
||||||
& ";" & disco.serialnumber _
|
& ";" & Abs(Round((disco.size/(1024*1024*1024)),2)) & " GB"
|
||||||
& "]]></data>"
|
If (not IsNull(disco.serialnumber)) then
|
||||||
|
Wscript.StdOut.Write ";" & disco.serialnumber
|
||||||
|
Else
|
||||||
|
Wscript.StdOut.Write ";" & disco.signature
|
||||||
|
End If
|
||||||
|
Wscript.StdOut.WriteLine "]]></data>"
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Wscript.StdOut.WriteLine "</datalist>"
|
Wscript.StdOut.WriteLine "</datalist>"
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
'WMI real interfaces info
|
'WMI real interfaces info
|
||||||
' exlusions:
|
' exlusions:
|
||||||
@ -14,7 +18,11 @@ Wscript.StdOut.WriteLine "<datalist>"
|
|||||||
|
|
||||||
strComputer = "."
|
strComputer = "."
|
||||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
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
|
For Each iface In colAdapters
|
||||||
' return model MACAddress IPAddress
|
' return model MACAddress IPAddress
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
'WMI mobo info
|
'WMI mobo info
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
'WMI monitorsinfo
|
'WMI monitorsinfo
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
|
|
||||||
'WMI printers attached
|
'WMI printers attached
|
||||||
@ -33,6 +37,7 @@ For Each objPrinter in colPrinters
|
|||||||
WScript.stdOut.Write "<data><![CDATA[" & _
|
WScript.stdOut.Write "<data><![CDATA[" & _
|
||||||
objPrinter.DeviceID & ";" & _
|
objPrinter.DeviceID & ";" & _
|
||||||
objPrinter.DriverName & ";"
|
objPrinter.DriverName & ";"
|
||||||
|
If (objPrinter.Local) Then
|
||||||
Set colPorts = oWMI.ExecQuery("Select HostAddress from Win32_TCPIPPrinterPort where Name like '" & objPrinter.PortName & "'",,48)
|
Set colPorts = oWMI.ExecQuery("Select HostAddress from Win32_TCPIPPrinterPort where Name like '" & objPrinter.PortName & "'",,48)
|
||||||
For Each objPort in colPorts
|
For Each objPort in colPorts
|
||||||
tcp_port_exists = 1
|
tcp_port_exists = 1
|
||||||
@ -41,6 +46,9 @@ For Each objPrinter in colPrinters
|
|||||||
If (tcp_port_exists = 0) Then
|
If (tcp_port_exists = 0) Then
|
||||||
Wscript.stdOut.Write objPrinter.PortName
|
Wscript.stdOut.Write objPrinter.PortName
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
Wscript.stdOut.Write objPrinter.ServerName
|
||||||
|
End If
|
||||||
wscript.stdOut.WriteLine "]]></data>"
|
wscript.stdOut.WriteLine "]]></data>"
|
||||||
end if
|
end if
|
||||||
Next
|
Next
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
' (c) 2015 Sancho Lerena <slerena@artica.es>
|
' (c) 2015 Sancho Lerena <slerena@artica.es>
|
||||||
' This plugin extends agent inventory feature. Only enterprise version
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
' ----------------------------------------------------------------
|
' ----------------------------------------------------------------
|
||||||
|
on error resume next
|
||||||
|
|
||||||
Wscript.StdOut.WriteLine "<inventory>"
|
Wscript.StdOut.WriteLine "<inventory>"
|
||||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
'WMI raminfo
|
'WMI raminfo
|
||||||
|
|
||||||
@ -13,8 +17,8 @@ Set colRAMs = objWMIService.ExecQuery("Select deviceLocator,capacity,speed from
|
|||||||
|
|
||||||
For Each ram In colRAMs
|
For Each ram In colRAMs
|
||||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & ram.deviceLocator _
|
Wscript.StdOut.WriteLine "<data><![CDATA[" & ram.deviceLocator _
|
||||||
& ";" & (ram.capacity/(1024*1024)) _
|
& ";" & Abs(Round((ram.capacity/(1024*1024)),2)) & " MB" _
|
||||||
& ";" & ram.speed _
|
& ";" & ram.speed & " MHz"_
|
||||||
& "]]></data>"
|
& "]]></data>"
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
'
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
' Windows information retriever: Software Installed
|
|
||||||
'
|
|
||||||
' WMI/REGISTRY based
|
|
||||||
' (c) 2015 Sancho Lerena <slerena@artica.es>
|
' (c) 2015 Sancho Lerena <slerena@artica.es>
|
||||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
'--------------------------------------------------------
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
|
|
||||||
Class ObjectList
|
Class ObjectList
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
' Lista todos los usuarios del equipo que han iniciado procesos
|
' Lista todos los usuarios del equipo que han iniciado procesos
|
||||||
|
|
||||||
@ -57,7 +61,8 @@ Wscript.StdOut.WriteLine "<datalist>"
|
|||||||
|
|
||||||
|
|
||||||
For Each usuario in loggedUsers
|
For Each usuario in loggedUsers
|
||||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & usuario _
|
Wscript.StdOut.WriteLine "<data><![CDATA[" & split(usuario,"\")(0) _
|
||||||
|
& ";" & split(usuario,"\")(1) _
|
||||||
& "]]></data>"
|
& "]]></data>"
|
||||||
next
|
next
|
||||||
|
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
|
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||||
|
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||||
|
' This plugin extends agent inventory feature. Only enterprise version
|
||||||
|
' --------------------------------------------------------------------------
|
||||||
on error resume next
|
on error resume next
|
||||||
'WMI video_card_info
|
'WMI video_card_info
|
||||||
|
|
||||||
Wscript.StdOut.WriteLine "<inventory>"
|
Wscript.StdOut.WriteLine "<inventory>"
|
||||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||||
Wscript.StdOut.WriteLine "<name>VideoCards</name>"
|
Wscript.StdOut.WriteLine "<name>Video</name>"
|
||||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||||
Wscript.StdOut.WriteLine "<datalist>"
|
Wscript.StdOut.WriteLine "<datalist>"
|
||||||
|
|
||||||
@ -13,7 +17,7 @@ Set colVideoCards = objWMIService.ExecQuery("Select caption,AdapterRAM,PNPDevice
|
|||||||
|
|
||||||
For Each vcard In colVideoCards
|
For Each vcard In colVideoCards
|
||||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & vcard.caption _
|
Wscript.StdOut.WriteLine "<data><![CDATA[" & vcard.caption _
|
||||||
& ";" & (vcard.AdapterRAM/(1024*1024)) _
|
& ";" & Abs(Round(vcard.AdapterRAM/(1024*1024)),2) & " MB" _
|
||||||
& ";" & vcard.PNPDeviceID _
|
& ";" & vcard.PNPDeviceID _
|
||||||
& "]]></data>"
|
& "]]></data>"
|
||||||
Next
|
Next
|
||||||
|
Loading…
x
Reference in New Issue
Block a user