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
|
|
|
' ps.vbs
|
|
|
|
' Returns the status of the given processes.
|
|
|
|
' -----------------------------------------
|
|
|
|
|
|
|
|
Option Explicit
|
|
|
|
'On Error Resume Next
|
|
|
|
|
|
|
|
' Variables
|
|
|
|
Dim objWMIService, objItem, colItems, argc, ps, i
|
|
|
|
|
|
|
|
' Get and hash process information
|
|
|
|
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
|
|
|
|
Set colItems = objWMIService.ExecQuery ("Select * from Win32_Process")
|
|
|
|
Set ps = CreateObject("Scripting.Dictionary")
|
|
|
|
For Each objItem in colItems
|
|
|
|
if Not ps.Exists(objItem.Name) Then
|
|
|
|
ps.Add objItem.Name, 1
|
|
|
|
End If
|
|
|
|
Next
|
|
|
|
|
|
|
|
' Parse command line parameters and check each process
|
|
|
|
argc = Wscript.Arguments.Count
|
|
|
|
For i = 0 To argc - 1
|
|
|
|
Wscript.StdOut.WriteLine "<module>"
|
|
|
|
Wscript.StdOut.WriteLine " <name><![CDATA[" & Wscript.Arguments(i) & "]]></name>"
|
|
|
|
Wscript.StdOut.WriteLine " <description><![CDATA[Process " & Wscript.Arguments(i) & " status]]></description>"
|
|
|
|
If argc = 0 Or ps.Exists(Wscript.Arguments(i)) Then
|
|
|
|
Wscript.StdOut.WriteLine " <data><![CDATA[" & 1 & "]]></data>"
|
|
|
|
Else
|
|
|
|
Wscript.StdOut.WriteLine " <data><![CDATA[" & 0 & "]]></data>"
|
|
|
|
End If
|
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
|
|
|
Next
|