2010-04-21 Ramon Novoa <rnovoa@artica.es>
* main.cc: Updated headers after tinyxml removal.
* modules/pandora_module_list.cc,
modules/pandora_module_factory.cc: Added support for plugin modules.
* modules/pandora_module_exec.cc, modules/pandora_module.h,
modules/pandora_module.cc: Added the module_timeout configuration
token and replaced tinyxml related code.
* bin/pandora_agent.conf: Added a sample plugin module. Added the
group configuration token (was missing).
* modules/pandora_module_plugin.cc,
modules/pandora_module_plugin.h: Added to repository. Plugin module.
* bin/util/df.vbs, bin/util/ps.vbs: Added to repository. Sample
VBScript plugins.
* pandora_windows_service.cc, pandora_windows_service.h,
modules/pandora_module_inventory.cc, ssh/pandora_ssh_test.cc,
ftp/pandora_ftp_test.cc, modules/pandora_module_inventory.h: Replaced
tinyxml related code.
* tinyxml, tinyxml/tinyxmlerror.cpp, tinyxml/tinystr.h,
tinyxml/tinyxmlparser.cpp, tinyxml/tinyxml.cpp,
tinyxml/tinyxml.h, tinyxml/tinystr.cpp: Removed from repository. No
longer used.
* installer/pandora.mpi, pandora.cc: Updated build to RC1.
* Makefile.am: Updated sources. Removed tinyxml and added the plugin
module.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2584 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-21 22:00:31 +02:00
|
|
|
' df.vbs
|
|
|
|
' Returns free space for avaible drives.
|
|
|
|
' --------------------------------------
|
|
|
|
|
|
|
|
Option Explicit
|
|
|
|
On Error Resume Next
|
|
|
|
|
|
|
|
' Variables
|
|
|
|
Dim objWMIService, objItem, colItems, argc, argv, i
|
|
|
|
|
|
|
|
' Parse command line parameters
|
|
|
|
argc = Wscript.Arguments.Count
|
|
|
|
Set argv = CreateObject("Scripting.Dictionary")
|
|
|
|
For i = 0 To argc - 1
|
|
|
|
argv.Add Wscript.Arguments(i), i
|
|
|
|
Next
|
|
|
|
|
|
|
|
' Get drive information
|
|
|
|
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
|
|
|
|
Set colItems = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk")
|
|
|
|
|
|
|
|
For Each objItem in colItems
|
|
|
|
If argc = 0 Or argv.Exists(objItem.Name) Then
|
|
|
|
If objItem.FreeSpace <> "" Then
|
|
|
|
Wscript.StdOut.WriteLine "<module>"
|
|
|
|
Wscript.StdOut.WriteLine " <name><![CDATA[" & objItem.Name & "]]></name>"
|
|
|
|
Wscript.StdOut.WriteLine " <description><![CDATA[Drive " & objItem.Name & " free space in MB]]></description>"
|
|
|
|
Wscript.StdOut.WriteLine " <data><![CDATA[" & Int(objItem.FreeSpace /1048576) & "]]></data>"
|
2010-04-23 18:47:28 +02:00
|
|
|
Wscript.StdOut.WriteLine "</module>"
|
|
|
|
Wscript.StdOut.flush
|
2010-04-21 Ramon Novoa <rnovoa@artica.es>
* main.cc: Updated headers after tinyxml removal.
* modules/pandora_module_list.cc,
modules/pandora_module_factory.cc: Added support for plugin modules.
* modules/pandora_module_exec.cc, modules/pandora_module.h,
modules/pandora_module.cc: Added the module_timeout configuration
token and replaced tinyxml related code.
* bin/pandora_agent.conf: Added a sample plugin module. Added the
group configuration token (was missing).
* modules/pandora_module_plugin.cc,
modules/pandora_module_plugin.h: Added to repository. Plugin module.
* bin/util/df.vbs, bin/util/ps.vbs: Added to repository. Sample
VBScript plugins.
* pandora_windows_service.cc, pandora_windows_service.h,
modules/pandora_module_inventory.cc, ssh/pandora_ssh_test.cc,
ftp/pandora_ftp_test.cc, modules/pandora_module_inventory.h: Replaced
tinyxml related code.
* tinyxml, tinyxml/tinyxmlerror.cpp, tinyxml/tinystr.h,
tinyxml/tinyxmlparser.cpp, tinyxml/tinyxml.cpp,
tinyxml/tinyxml.h, tinyxml/tinystr.cpp: Removed from repository. No
longer used.
* installer/pandora.mpi, pandora.cc: Updated build to RC1.
* Makefile.am: Updated sources. Removed tinyxml and added the plugin
module.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2584 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-21 22:00:31 +02:00
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Next
|