Checkbox de recursividad en paradas programadas [ext:3243
This commit is contained in:
parent
a00eb51924
commit
64486bc896
|
@ -47,6 +47,10 @@ ui_print_page_header(
|
|||
true,
|
||||
$buttons);
|
||||
|
||||
//recursion group filter
|
||||
$recursion = get_parameter('recursion', $_POST['recursion']);
|
||||
|
||||
|
||||
//Initialize data
|
||||
$id_group = (int) get_parameter ('id_group');
|
||||
$name = (string) get_parameter ('name');
|
||||
|
@ -628,7 +632,7 @@ echo '</form>';
|
|||
|
||||
if ($id_downtime > 0) {
|
||||
|
||||
echo "<td valign=top>";
|
||||
echo "<td valign=top style='width:300px;padding-left:20px;'>";
|
||||
// Show available agents to include into downtime
|
||||
echo '<h4>' . __('Available agents') . ':</h4>';
|
||||
|
||||
|
@ -643,8 +647,31 @@ if ($id_downtime > 0) {
|
|||
}
|
||||
|
||||
$filter_cond = '';
|
||||
if ($filter_group > 0)
|
||||
$filter_cond = " AND id_grupo = $filter_group ";
|
||||
if ($filter_group > 0){
|
||||
if($recursion){
|
||||
$rg = groups_get_id_recursive($filter_group, true);
|
||||
$filter_cond .= " AND id_grupo IN (";
|
||||
|
||||
$i = 0;
|
||||
$len = count($rg);
|
||||
|
||||
foreach ($rg as $key) {
|
||||
|
||||
if ($i == $len - 1) {
|
||||
$filter_cond .= $key.")";
|
||||
}else{
|
||||
$i++;
|
||||
$filter_cond .= $key.",";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
$filter_cond = " AND id_grupo = $filter_group ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$sql = sprintf("SELECT tagente.id_agente, tagente.nombre
|
||||
FROM tagente
|
||||
WHERE tagente.id_agente NOT IN (
|
||||
|
@ -671,17 +698,19 @@ if ($id_downtime > 0) {
|
|||
$disabled_add_button = true;
|
||||
}
|
||||
|
||||
|
||||
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
|
||||
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;width:180px;max-width:180px;margin-right:15px;');
|
||||
|
||||
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'width:180px');
|
||||
|
||||
html_print_checkbox ("recursion", !$_POST['recursion'], $_POST['recursion'], false, false, '');
|
||||
echo __('Recursion') . ' ';
|
||||
echo "<br /><br />";
|
||||
html_print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false);
|
||||
echo "</form>";
|
||||
|
||||
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
|
||||
|
||||
echo html_print_select ($agents, "id_agents[]", '', '', '', 0, false, true, true, '', false, 'width: 180px;');
|
||||
echo html_print_select ($agents, "id_agents[]", -1, '', _("Any"), -2, false, true, true, '', false, 'width: 180px;');
|
||||
echo '<h4>' . __('Available modules:') .
|
||||
ui_print_help_tip (__('Only for type Quiet for downtimes.'), true) . '</h4>';
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.5 KiB |
|
@ -113,6 +113,7 @@ function configure_modules_form () {
|
|||
js_html_entity_decode (data["name"]));
|
||||
$("#textarea_description").attr ("value",
|
||||
js_html_entity_decode (data["description"]));
|
||||
$("#textarea_description").html(js_html_entity_decode (data["description"]));
|
||||
$("#textarea_configuration_data").val(configuration_data);
|
||||
$("#component_loading").hide ();
|
||||
$("#id_module_type").val(data["type"]);
|
||||
|
@ -246,7 +247,7 @@ function configure_modules_form () {
|
|||
flag_load_plugin_component = true;
|
||||
|
||||
$("#text-name").attr ("value", js_html_entity_decode (data["name"]));
|
||||
$("#textarea_description").attr ("value", js_html_entity_decode (data["description"]));
|
||||
$("#textarea_description").html (js_html_entity_decode (data["description"]));
|
||||
$("#id_module_type").val(data["type"]);
|
||||
$("#text-max").attr ("value", data["max"]);
|
||||
$("#text-min").attr ("value", data["min"]);
|
||||
|
@ -262,6 +263,10 @@ function configure_modules_form () {
|
|||
.attr ("value", js_html_entity_decode (data["tcp_send"]));
|
||||
$("#textarea_tcp_rcv")
|
||||
.attr ("value", js_html_entity_decode (data["tcp_rcv"]));
|
||||
$("#textarea_tcp_send")
|
||||
.html (js_html_entity_decode (data["tcp_send"]));
|
||||
$("#textarea_tcp_rcv")
|
||||
.html (js_html_entity_decode (data["tcp_rcv"]));
|
||||
$("#text-snmp_community")
|
||||
.attr ("value", js_html_entity_decode (data["snmp_community"]));
|
||||
$("#text-snmp_oid")
|
||||
|
|
|
@ -1248,12 +1248,13 @@ div.title_line {
|
|||
max-height: 26px;
|
||||
}
|
||||
#menu_tab_left li a, #menu_tab_left li span {
|
||||
/* text-transform: uppercase; */
|
||||
/*text-transform: uppercase; */
|
||||
padding: 0px 0px 0px 0px;
|
||||
color: #fff;
|
||||
font-size: 8.5pt;
|
||||
font-weight: normal;
|
||||
font-size: 9pt;
|
||||
line-height: 20px;
|
||||
letter-spacing:1px;
|
||||
font-family: verdana;
|
||||
}
|
||||
#menu_tab_left .mn li a {
|
||||
display: block;
|
||||
|
|
|
@ -46,6 +46,8 @@ else {
|
|||
}
|
||||
|
||||
$ag_freestring = get_parameter ('ag_freestring');
|
||||
$moduletype = (string) get_parameter ('moduletype');
|
||||
$datatype = (string) get_parameter ('datatype');
|
||||
$ag_modulename = (string) get_parameter ('ag_modulename');
|
||||
$refr = (int) get_parameter('refr', 0);
|
||||
$offset = (int) get_parameter ('offset', 0);
|
||||
|
@ -88,10 +90,10 @@ $user_groups = implode (',', array_keys (users_get_groups ()));
|
|||
|
||||
////////////////////////////////////
|
||||
// Begin Build SQL sentences
|
||||
$sql_from = ' FROM tagente, tagente_modulo, tagente_estado ';
|
||||
$sql_from = ' FROM ttipo_modulo,tagente, tagente_modulo, tagente_estado,tmodule ';
|
||||
|
||||
$sql_conditions_base = ' WHERE tagente.id_agente = tagente_modulo.id_agente
|
||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo';
|
||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_tipo_modulo = ttipo_modulo.id_tipo AND tmodule.id_module = tagente_modulo.id_modulo';
|
||||
|
||||
$sql_conditions = ' AND tagente_modulo.disabled = 0 AND tagente.disabled = 0';
|
||||
|
||||
|
@ -138,6 +140,16 @@ if ($ag_modulename != '') {
|
|||
$ag_modulename);
|
||||
}
|
||||
|
||||
|
||||
if ($datatype != '') {
|
||||
$sql_conditions .= sprintf (' AND ttipo_modulo.id_tipo =' .$datatype);
|
||||
}
|
||||
|
||||
if ($moduletype != '') {
|
||||
$sql_conditions .= sprintf (' AND tagente_modulo.id_modulo =' .$moduletype);
|
||||
}
|
||||
|
||||
|
||||
// Freestring selector
|
||||
if ($ag_freestring != '') {
|
||||
$sql_conditions .= sprintf (' AND (tagente.nombre LIKE \'%%%s%%\'
|
||||
|
@ -204,6 +216,7 @@ if ($tag_filter !== 0) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// Apply the module ACL with tags
|
||||
$sql_conditions_tags = '';
|
||||
|
||||
|
@ -328,6 +341,129 @@ else {
|
|||
$tag_filter, '', __('All'), '', true, false, true, '', false, 'width: 150px;');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$network_available = db_get_sql ("SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = 1"); //POSTGRESQL AND ORACLE COMPATIBLE
|
||||
$wmi_available = db_get_sql ("SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = 6"); //POSTGRESQL AND ORACLE COMPATIBLE
|
||||
$plugin_available = db_get_sql ("SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = 4"); //POSTGRESQL AND ORACLE COMPATIBLE
|
||||
$prediction_available = db_get_sql ("SELECT count(*)
|
||||
FROM tserver
|
||||
WHERE server_type = 5"); //POSTGRESQL AND ORACLE COMPATIBLE
|
||||
|
||||
// Development mode to use all servers
|
||||
if ($develop_bypass) {
|
||||
$network_available = 1;
|
||||
$wmi_available = 1;
|
||||
$plugin_available = 1;
|
||||
$prediction_available = 1;
|
||||
}
|
||||
|
||||
$typemodules = array ();
|
||||
$typemodules[1] = __('Data server module');
|
||||
if ($network_available)
|
||||
$typemodules[2] = __('Network server module');
|
||||
if ($plugin_available)
|
||||
$typemodules[4] = __('Plugin server module');
|
||||
if ($wmi_available)
|
||||
$typemodules[6] = __('WMI server module');
|
||||
if ($prediction_available)
|
||||
$typemodules[5] = __('Prediction server module');
|
||||
if (enterprise_installed()) {
|
||||
$typemodules[7] = __('Web server module');
|
||||
}
|
||||
|
||||
|
||||
$table->data[2][0] = '<span>'.__('Server type').'</span>';
|
||||
|
||||
$table->data[2][1] = html_print_select ($typemodules, 'moduletype',$moduletype, '', __('All'),'', true, false, true, '', false, 'width: 150px;');
|
||||
|
||||
|
||||
$table->data[2][2] = '<span id="datatypetittle" ';
|
||||
|
||||
if(!$_GET['sort']){
|
||||
$table->data[2][2] .= 'style="display:none"';
|
||||
}
|
||||
|
||||
$table->data[2][2] .= '>'.__('Data type').'</span>';
|
||||
|
||||
|
||||
$table->data[2][3] .='<div id="datatypebox">';
|
||||
|
||||
|
||||
switch ($moduletype)
|
||||
{
|
||||
case 1:
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria IN (6,7,8,0,1,2,-1) order by descripcion ');
|
||||
break;
|
||||
case 2:
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria between 3 and 5 ');
|
||||
break;
|
||||
case 4:
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria between 0 and 2 ');
|
||||
break;
|
||||
case 6:
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria between 0 and 2 ');
|
||||
break;
|
||||
case 7:
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria = 9');
|
||||
break;
|
||||
case 5:
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria = 0');
|
||||
break;
|
||||
case '':
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo');
|
||||
break;
|
||||
|
||||
}
|
||||
$a = db_get_all_rows_sql($sql);
|
||||
$table->data[2][3] .= '<select id="datatype" name="datatype" ';
|
||||
|
||||
if(!$_GET['sort']){
|
||||
$table->data[2][3] .= 'style="display:none"';
|
||||
}
|
||||
|
||||
$table->data[2][3] .= '>';
|
||||
|
||||
$table->data[2][3] .= '<option name="datatype" value="">'.__("All").'</option>';
|
||||
|
||||
|
||||
foreach ($a as $valor) {
|
||||
|
||||
$table->data[2][3] .= '<option name="datatype" value="'.$valor['id_tipo'].'" ';
|
||||
|
||||
if($valor['id_tipo'] == $datatype){
|
||||
$table->data[2][3] .= 'selected';
|
||||
}
|
||||
|
||||
$table->data[2][3] .= '>'.$valor['descripcion'].'</option>';
|
||||
}
|
||||
$table->data[2][3] .= '</select>';
|
||||
|
||||
|
||||
|
||||
|
||||
$table->data[2][3] .= '</div>';
|
||||
|
||||
|
||||
$table_custom_fields = new stdClass();
|
||||
$table_custom_fields->class = 'filters';
|
||||
$table_custom_fields->width = '100%';
|
||||
|
@ -364,13 +500,14 @@ foreach ($custom_fields as $custom_field) {
|
|||
$table_custom_fields->data[] = $row;
|
||||
}
|
||||
|
||||
|
||||
$filters = '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&ag_group=' .
|
||||
$ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . '&sort_field=' .
|
||||
$ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&moduletype=' . $moduletype . '&datatype=' . $datatype . '&status=' . $status . '&sort_field=' .
|
||||
$sortField . '&sort=' . $sort .'&pure=' . $config['pure'] . $ag_custom_fields_params . '">';
|
||||
if (is_metaconsole()) {
|
||||
$table->colspan[2][0] = 7;
|
||||
$table->cellstyle[2][0] = 'padding: 10px;';
|
||||
$table->data[2][0] = ui_toggle(
|
||||
$table->colspan[3][0] = 7;
|
||||
$table->cellstyle[3][0] = 'padding: 10px;';
|
||||
$table->data[3][0] = ui_toggle(
|
||||
html_print_table($table_custom_fields, true),
|
||||
__('Advanced Options'), '', true, true);
|
||||
|
||||
|
@ -379,9 +516,9 @@ if (is_metaconsole()) {
|
|||
ui_toggle($filters, __('Show Options'));
|
||||
}
|
||||
else {
|
||||
$table->colspan[2][0] = 7;
|
||||
$table->cellstyle[2][0] = 'padding-left: 10px;';
|
||||
$table->data[2][0] = ui_toggle(html_print_table($table_custom_fields,
|
||||
$table->colspan[3][0] = 7;
|
||||
$table->cellstyle[3][0] = 'padding-left: 10px;';
|
||||
$table->data[3][0] = ui_toggle(html_print_table($table_custom_fields,
|
||||
true), __('Agent custom fields'), '', true, true);
|
||||
|
||||
$filters .= html_print_table($table, true);
|
||||
|
@ -441,6 +578,22 @@ switch ($sortField) {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case 'moduletype':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
$selectTypeUp = $selected;
|
||||
$order = array(
|
||||
'field' => 'tagente_modulo.id_modulo',
|
||||
'order' => 'ASC');
|
||||
break;
|
||||
case 'down':
|
||||
$selectTypeDown = $selected;
|
||||
$order = array(
|
||||
'field' => 'tagente_modulo.id_modulo',
|
||||
'order' => 'DESC');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'module_name':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
|
@ -553,6 +706,7 @@ switch ($config['dbtype']) {
|
|||
WHERE ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo))
|
||||
AS tags,
|
||||
tagente_modulo.id_agente_modulo,
|
||||
tagente_modulo.id_modulo,
|
||||
tagente.intervalo AS agent_interval,
|
||||
tagente.nombre AS agent_name,
|
||||
tagente_modulo.nombre AS module_name,
|
||||
|
@ -599,6 +753,7 @@ switch ($config['dbtype']) {
|
|||
WHERE ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo))
|
||||
AS tags,
|
||||
tagente_modulo.id_agente_modulo,
|
||||
tagente_modulo.id_modulo,
|
||||
tagente.intervalo AS agent_interval,
|
||||
tagente.nombre AS agent_name,
|
||||
tagente_modulo.nombre AS module_name,
|
||||
|
@ -641,6 +796,7 @@ switch ($config['dbtype']) {
|
|||
WHERE ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo))
|
||||
AS tags,
|
||||
tagente_modulo.id_agente_modulo,
|
||||
tagente_modulo.id_modulo,
|
||||
tagente.intervalo AS agent_interval,
|
||||
tagente.nombre AS agent_name,
|
||||
tagente_modulo.nombre AS module_name,
|
||||
|
@ -772,34 +928,41 @@ if (!empty($result)) {
|
|||
|
||||
$table->head[1] = __('Agent');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[1] .=' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectAgentNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectAgentNameDown, 'alt' => 'down')) . '</a>';
|
||||
$table->head[1] .=' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectAgentNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&datatype='.$datatype . '&moduletype='.$moduletype . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=agent_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectAgentNameDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
|
||||
$table->head[2] = __('Type');
|
||||
$table->head[2] = __('Data Type');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[2] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTypeUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTypeDown, 'alt' => 'down')) . '</a>';
|
||||
$table->head[2] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTypeUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=type&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTypeDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
$table->align[2] = 'left';
|
||||
|
||||
$table->head[3] = __('Module name');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[3] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
||||
$table->head[3] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=module_name&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
|
||||
$table->head[4] = __('Server type');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[4] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=moduletype&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
|
||||
|
||||
$table->head[5] = __('Interval');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[5] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectIntervalUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectIntervalDown, 'alt' => 'down')) . '</a>';
|
||||
$table->head[5] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectIntervalUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=interval&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectIntervalDown, 'alt' => 'down')) . '</a>';
|
||||
$table->align[5] = 'left';
|
||||
}
|
||||
|
||||
$table->head[6] = __('Status');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[6] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
||||
$table->head[6] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=status&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
|
||||
$table->align[6] = 'left';
|
||||
|
@ -813,14 +976,14 @@ if (!empty($result)) {
|
|||
$table->head[9] = __('Data');
|
||||
$table->align[9] = 'left';
|
||||
if ( is_metaconsole() ) {
|
||||
$table->head[9] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=data&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=data&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
||||
$table->head[9] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=data&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectStatusUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=data&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectStatusDown, 'alt' => 'down')) . '</a>';
|
||||
}
|
||||
|
||||
$table->head[10] = __('Timestamp');
|
||||
if (!is_metaconsole()) {
|
||||
$table->head[10] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTimestampUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTimestampDown, 'alt' => 'down')) . '</a>';
|
||||
$table->head[10] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=up">' . html_print_image('images/sort_up.png', true, array('style' => $selectTimestampUp, 'alt' => 'up')) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&datatype='.$datatype . '&moduletype='.$moduletype . '&refr=' . $refr . '&modulegroup='.$modulegroup . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . $ag_custom_fields_params . '&sort_field=timestamp&sort=down">' . html_print_image('images/sort_down.png', true, array('style' => $selectTimestampDown, 'alt' => 'down')) . '</a>';
|
||||
$table->align[10] = 'left';
|
||||
}
|
||||
|
||||
|
@ -914,6 +1077,7 @@ if (!empty($result)) {
|
|||
$data[1] .= '</a></strong>';
|
||||
}
|
||||
|
||||
|
||||
$data[2] = html_print_image('images/' . modules_show_icon_type ($row['module_type']), true);
|
||||
if (check_acl ($config['id_user'], $row['id_group'], 'AW')) {
|
||||
$show_edit_icon = true;
|
||||
|
@ -959,7 +1123,8 @@ if (!empty($result)) {
|
|||
'title' => $row['tags'],
|
||||
'style' => 'width: 20px; margin-left: 3px;'));
|
||||
}
|
||||
|
||||
$data[4] = servers_show_type ($row['id_modulo']);
|
||||
|
||||
$data[5] = ($row['module_interval'] == 0) ?
|
||||
human_time_description_raw($row['agent_interval'])
|
||||
:
|
||||
|
@ -1211,7 +1376,27 @@ ui_require_javascript_file('pandora_modules');
|
|||
$('#tag_filter').css('display', 'none');
|
||||
$('#tag_td').css('display', 'none');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('#moduletype').click(function(){
|
||||
jQuery.get ("ajax.php",
|
||||
{
|
||||
"page": "general/subselect_data_module",
|
||||
"module":$('#moduletype').val()},
|
||||
function (data, status){
|
||||
$("#datatypetittle").show ();
|
||||
$("#datatypebox").hide ()
|
||||
.empty ()
|
||||
.append (data)
|
||||
.show ();
|
||||
},
|
||||
"html"
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#ag_group').change (function () {
|
||||
strict_user = $('#text-strict_user_hidden').val();
|
||||
|
|
|
@ -42,7 +42,7 @@ if (is_ajax ()) {
|
|||
$get_agentmodule_status_tooltip = (bool) get_parameter ("get_agentmodule_status_tooltip");
|
||||
$get_group_status_tooltip = (bool) get_parameter ("get_group_status_tooltip");
|
||||
$get_agent_id = (bool) get_parameter ("get_agent_id");
|
||||
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
if ($get_agents_group_json) {
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$recursion = (int) get_parameter ('recursion', 0);
|
||||
|
@ -382,7 +382,19 @@ if (is_ajax ()) {
|
|||
asort($result);
|
||||
}
|
||||
else {
|
||||
$sql = 'SELECT DISTINCT(nombre)
|
||||
|
||||
if(implode(',', $idAgents) < 0){
|
||||
|
||||
|
||||
$sql = 'SELECT DISTINCT(nombre) FROM tagente_modulo
|
||||
WHERE nombre IN (
|
||||
SELECT nombre
|
||||
FROM tagente_modulo
|
||||
GROUP BY nombre
|
||||
HAVING count(nombre) = (SELECT count(nombre) FROM tagente_modulo))';
|
||||
}
|
||||
else{
|
||||
$sql = 'SELECT DISTINCT(nombre)
|
||||
FROM tagente_modulo t1
|
||||
WHERE ' . $filter . '
|
||||
AND t1.delete_pending = 0
|
||||
|
@ -398,7 +410,7 @@ if (is_ajax ()) {
|
|||
}elseif ($selection_mode == 'unknown'){
|
||||
$sql .= 'AND t1.id_agente_modulo IN (SELECT id_agente_modulo FROM tagente_estado where estado = 3 OR estado = 4)';
|
||||
}
|
||||
|
||||
}
|
||||
$sql .= ' ORDER BY nombre';
|
||||
|
||||
$nameModules = db_get_all_rows_sql($sql);
|
||||
|
|
Loading…
Reference in New Issue