2012-07-31 Sergio Martin <sergio.martin@artica.es>
* include/functions_api.php: Added API function to get the module data info from the agent conf file git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6833 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f5033d41a9
commit
b2d24c1a72
|
@ -1,3 +1,13 @@
|
||||||
|
2012-07-31 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* include/functions_api.php: Added API function to
|
||||||
|
get the module data info from the agent conf file
|
||||||
|
|
||||||
|
2012-07-31 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* include/functions_api.php: Change the API calls to
|
||||||
|
hooks
|
||||||
|
|
||||||
2012-07-31 Sergio Martin <sergio.martin@artica.es>
|
2012-07-31 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_api.php: Fix a unclosed key
|
* include/functions_api.php: Fix a unclosed key
|
||||||
|
|
|
@ -3220,9 +3220,9 @@ function api_set_add_module_in_conf($id_agent, $module_name, $configuration_data
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = config_agents_add_module_in_conf($id_agent, $new_configuration_data);
|
$result = enterprise_hook('config_agents_add_module_in_conf', array($id_agent, $new_configuration_data));
|
||||||
|
|
||||||
if($result) {
|
if($result && $result !== ENTERPRISE_NOT_HOOK) {
|
||||||
returnData('string', array('type' => 'string', 'data' => 'Successfully added module to conf.'));
|
returnData('string', array('type' => 'string', 'data' => 'Successfully added module to conf.'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3230,6 +3230,32 @@ function api_set_add_module_in_conf($id_agent, $module_name, $configuration_data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get module data configuration from agent configuration file
|
||||||
|
*
|
||||||
|
* @param string $id_agent Id of the agent
|
||||||
|
* @param string $module_name
|
||||||
|
* @param $thrash2 Don't use
|
||||||
|
* @param $thrash3 Don't use
|
||||||
|
*
|
||||||
|
* Call example:
|
||||||
|
*
|
||||||
|
* api.php?op=get&op2=module_from_conf&user=admin&pass=pandora&id=9043&id2=example_name
|
||||||
|
*
|
||||||
|
* @return string success or error message
|
||||||
|
*/
|
||||||
|
function api_get_module_from_conf($id_agent, $module_name, $thrash2, $thrash3) {
|
||||||
|
$result = enterprise_hook('config_agents_get_module_from_conf', array($id_agent, $module_name));
|
||||||
|
|
||||||
|
if($result !== ENTERPRISE_NOT_HOOK) {
|
||||||
|
returnData('string', array('type' => 'string', 'data' => $result));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
returnError('error_adding_module_conf', 'Error getting module from conf file.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete module data configuration from agent configuration file
|
* Delete module data configuration from agent configuration file
|
||||||
*
|
*
|
||||||
|
@ -3247,7 +3273,9 @@ function api_set_add_module_in_conf($id_agent, $module_name, $configuration_data
|
||||||
function api_set_delete_module_in_conf($id_agent, $module_name, $thrash2, $thrash3) {
|
function api_set_delete_module_in_conf($id_agent, $module_name, $thrash2, $thrash3) {
|
||||||
$result = config_agents_delete_module_in_conf($id_agent, $module_name);
|
$result = config_agents_delete_module_in_conf($id_agent, $module_name);
|
||||||
|
|
||||||
if($result) {
|
$result = enterprise_hook('config_agents_delete_module_in_conf', array($id_agent, $module_name));
|
||||||
|
|
||||||
|
if($result && $result !== ENTERPRISE_NOT_HOOK) {
|
||||||
returnData('string', array('type' => 'string', 'data' => 'Successfully deleted module from conf.'));
|
returnData('string', array('type' => 'string', 'data' => 'Successfully deleted module from conf.'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3286,10 +3314,10 @@ function api_set_update_module_in_conf($id_agent, $module_name, $configuration_d
|
||||||
echo "No change";
|
echo "No change";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = config_agents_update_module_in_conf($id_agent, $old_configuration_data, $new_configuration_data);
|
$result = enterprise_hook('config_agents_update_module_in_conf', array($id_agent, $old_configuration_data, $new_configuration_data));
|
||||||
|
|
||||||
if($result) {
|
if($result && $result !== ENTERPRISE_NOT_HOOK) {
|
||||||
returnData('string', array('type' => 'string', 'data' => 'Successfully updated module in conf.'));
|
returnData('string', array('type' => 'string', 'data' => 'Successfully updated module in conf.'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue