mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2009-01-26 Ramon Novoa <rnovoa@artica.es>
* win32/modules/pandora_module.h, win32/modules/pandora_module_factory.cc, win32/modules/pandora_module.cc: Added support for async data types. * win32/modules/pandora_module_proc.cc: Removed unnecessary call to Pandora_Wmi::runProgram. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1398 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c23a3d0d01
commit
1f2dfedead
@ -1,3 +1,12 @@
|
|||||||
|
2009-01-26 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* win32/modules/pandora_module.h,
|
||||||
|
win32/modules/pandora_module_factory.cc,
|
||||||
|
win32/modules/pandora_module.cc: Added support for async data types.
|
||||||
|
|
||||||
|
* win32/modules/pandora_module_proc.cc: Removed unnecessary call
|
||||||
|
to Pandora_Wmi::runProgram.
|
||||||
|
|
||||||
2009-01-21 Ramon Novoa <rnovoa@artica.es>
|
2009-01-21 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* win32/bin/PandoraAgent.exe: Updated to r1371.
|
* win32/bin/PandoraAgent.exe: Updated to r1371.
|
||||||
|
@ -91,6 +91,12 @@ Pandora_Module::parseModuleTypeFromString (string type) {
|
|||||||
return TYPE_GENERIC_DATA_STRING;
|
return TYPE_GENERIC_DATA_STRING;
|
||||||
} else if (type == module_generic_proc_str) {
|
} else if (type == module_generic_proc_str) {
|
||||||
return TYPE_GENERIC_PROC;
|
return TYPE_GENERIC_PROC;
|
||||||
|
} else if (type == module_async_data_str) {
|
||||||
|
return TYPE_ASYNC_DATA;
|
||||||
|
} else if (type == module_async_proc_str) {
|
||||||
|
return TYPE_ASYNC_PROC;
|
||||||
|
} else if (type == module_async_string_str) {
|
||||||
|
return TYPE_ASYNC_STRING;
|
||||||
} else {
|
} else {
|
||||||
return TYPE_0;
|
return TYPE_0;
|
||||||
}
|
}
|
||||||
@ -214,7 +220,8 @@ string
|
|||||||
Pandora_Module::getDataOutput (Pandora_Data *data) {
|
Pandora_Module::getDataOutput (Pandora_Data *data) {
|
||||||
double value;
|
double value;
|
||||||
|
|
||||||
if (this->module_type == TYPE_GENERIC_DATA_STRING) {
|
if (this->module_type == TYPE_GENERIC_DATA_STRING ||
|
||||||
|
this->module_type == TYPE_ASYNC_STRING) {
|
||||||
return data->getValue ();
|
return data->getValue ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,13 +45,19 @@ namespace Pandora_Modules {
|
|||||||
TYPE_GENERIC_DATA_INC, /**< The value is an integer with
|
TYPE_GENERIC_DATA_INC, /**< The value is an integer with
|
||||||
* incremental diferences */
|
* incremental diferences */
|
||||||
TYPE_GENERIC_PROC, /**< The value is a 0 or a 1 */
|
TYPE_GENERIC_PROC, /**< The value is a 0 or a 1 */
|
||||||
TYPE_GENERIC_DATA_STRING /**< The value is a string */
|
TYPE_GENERIC_DATA_STRING, /**< The value is a string */
|
||||||
|
TYPE_ASYNC_DATA, /**< Asynchronous generic_data */
|
||||||
|
TYPE_ASYNC_PROC, /**< Asynchronous generic_proc */
|
||||||
|
TYPE_ASYNC_STRING /**< Asynchronous generic_data_string */
|
||||||
} Module_Type;
|
} Module_Type;
|
||||||
|
|
||||||
const string module_generic_data_str = "generic_data";
|
const string module_generic_data_str = "generic_data";
|
||||||
const string module_generic_data_inc_str = "generic_data_inc";
|
const string module_generic_data_inc_str = "generic_data_inc";
|
||||||
const string module_generic_proc_str = "generic_proc";
|
const string module_generic_proc_str = "generic_proc";
|
||||||
const string module_generic_data_string_str = "generic_data_string";
|
const string module_generic_data_string_str = "generic_data_string";
|
||||||
|
const string module_async_data_str = "async_data";
|
||||||
|
const string module_async_proc_str = "async_proc";
|
||||||
|
const string module_async_string_str = "async_string";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the kind of the module.
|
* Defines the kind of the module.
|
||||||
|
@ -295,11 +295,14 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
case TYPE_GENERIC_DATA:
|
case TYPE_GENERIC_DATA:
|
||||||
case TYPE_GENERIC_DATA_INC:
|
case TYPE_GENERIC_DATA_INC:
|
||||||
case TYPE_GENERIC_PROC:
|
case TYPE_GENERIC_PROC:
|
||||||
|
case TYPE_ASYNC_DATA:
|
||||||
|
case TYPE_ASYNC_PROC:
|
||||||
module->setType (module_type);
|
module->setType (module_type);
|
||||||
numeric = true;
|
numeric = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case TYPE_GENERIC_DATA_STRING:
|
case TYPE_GENERIC_DATA_STRING:
|
||||||
|
case TYPE_ASYNC_STRING:
|
||||||
module->setType (module_type);
|
module->setType (module_type);
|
||||||
numeric = false;
|
numeric = false;
|
||||||
|
|
||||||
|
@ -132,10 +132,6 @@ async_run (Pandora_Module_Proc *module) {
|
|||||||
Pandora_Windows_Service::getInstance ()->sendXml (modules);
|
Pandora_Windows_Service::getInstance ()->sendXml (modules);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == 0 && module->isWatchdog ()) {
|
|
||||||
Pandora_Wmi::runProgram (module->getStartCommand ());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free handles */
|
/* Free handles */
|
||||||
for (i = 0; i < nprocess; i++)
|
for (i = 0; i < nprocess; i++)
|
||||||
CloseHandle (processes[i]);
|
CloseHandle (processes[i]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user