diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8aeac8c836..97be62255a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-07-16 Sergio Martin + + * include/functions_modules.php: Added a function to get the + kind of a module (dataserver, networserver...) as a string + from the module id + 2012-07-16 Dario Rodriguez * operation/tree.php: Fixed a bug which shows agents with diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 9a18602436..5d92d4aab4 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -659,6 +659,38 @@ function modules_get_agentmodule_type ($id_agentmodule) { return (int) db_get_value ('id_tipo_modulo', 'tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule); } +/** + * Get the module kind (dataserver, networkserver...) of an agent module. + * + * @param int $id_agentmodule Agent module id. + * + * @return string Module kind of the given agent module. + */ +function modules_get_agentmodule_kind($id_agentmodule) { + $id_modulo = (int) db_get_value ('id_modulo', 'tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule); + + switch($id_modulo) { + case 1: + return 'dataserver'; + break; + case 2: + return 'networkserver'; + break; + case 4: + return 'pluginserver'; + break; + case 5: + return 'predictionserver'; + break; + case 6: + return 'wmiserver'; + break; + default: + return 'other'; + break; + } +} + /** * Get the unit of an agent module. *