mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
Merge remote-tracking branch 'origin/develop' into new-vc-line-element
Conflicts: pandora_console/install.php
This commit is contained in:
commit
0dabab11cf
@ -20,8 +20,14 @@ echo "Test if you has the tools for to make the packages."
|
|||||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
if [ $? = 1 ]
|
if [ $? = 1 ]
|
||||||
then
|
then
|
||||||
echo "No found \"dpkg-deb\" aplication, please install."
|
if [ "$DPKG_DEB" == "" ]; then
|
||||||
exit 1
|
echo "No found \"dpkg-deb\" aplication, please install."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ">> Using dockerized version of dpkg-deb: "
|
||||||
|
echo " $DPKG_DEB"
|
||||||
|
USE_DOCKER_APP=1
|
||||||
else
|
else
|
||||||
echo "Found \"dpkg-debs\"."
|
echo "Found \"dpkg-debs\"."
|
||||||
fi
|
fi
|
||||||
@ -122,8 +128,12 @@ do
|
|||||||
done
|
done
|
||||||
echo "END"
|
echo "END"
|
||||||
|
|
||||||
echo "Make the package \"Pandorafms console\"."
|
echo "Make the package \"Pandorafms agent\"."
|
||||||
dpkg-deb --build temp_package
|
if [ "$USE_DOCKER_APP" == "1" ]; then
|
||||||
|
eval $DPKG_DEB --build temp_package
|
||||||
|
else
|
||||||
|
dpkg-deb --build temp_package
|
||||||
|
fi
|
||||||
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb
|
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb
|
||||||
|
|
||||||
echo "Delete the \"temp_package\" temp dir for job."
|
echo "Delete the \"temp_package\" temp dir for job."
|
||||||
|
@ -18,7 +18,8 @@ Packager: Sancho Lerena <slerena@artica.es>
|
|||||||
Prefix: /usr/share
|
Prefix: /usr/share
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
|
#PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
|
||||||
|
Requires(pre,preun):/usr/bin/sed /usr/bin/grep /usr/sbin/useradd
|
||||||
Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
|
Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
|
||||||
AutoReq: 0
|
AutoReq: 0
|
||||||
Provides: %{name}-%{version}
|
Provides: %{name}-%{version}
|
||||||
|
3432
pandora_agents/win32/bin/util/curl-ca-bundle.crt
Normal file
3432
pandora_agents/win32/bin/util/curl-ca-bundle.crt
Normal file
File diff suppressed because it is too large
Load Diff
@ -44,8 +44,15 @@ then
|
|||||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
if [ $? = 1 ]
|
if [ $? = 1 ]
|
||||||
then
|
then
|
||||||
echo "No found \"dpkg-deb\" aplication, please install."
|
if [ "$DPKG_DEB" == "" ]; then
|
||||||
exit 1
|
echo "No found \"dpkg-deb\" aplication, please install."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ">> Using dockerized version of dpkg-deb: "
|
||||||
|
echo " $DPKG_DEB"
|
||||||
|
# Use dockerized app.
|
||||||
|
USE_DOCKER_APP=1
|
||||||
else
|
else
|
||||||
echo "Found \"dpkg-debs\"."
|
echo "Found \"dpkg-debs\"."
|
||||||
fi
|
fi
|
||||||
@ -70,15 +77,15 @@ then
|
|||||||
else
|
else
|
||||||
echo "Found \"fakeroot\"."
|
echo "Found \"fakeroot\"."
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null
|
whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null
|
||||||
if [ $? = 1 ]
|
if [ $? = 1 ]
|
||||||
then
|
then
|
||||||
echo " \"dpkg-buildpackage\" aplication not found, please install."
|
echo " \"dpkg-buildpackage\" aplication not found, please install."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Found \"dpkg-buildpackage\"."
|
echo "Found \"dpkg-buildpackage\"."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
@ -141,7 +148,11 @@ then
|
|||||||
echo "END"
|
echo "END"
|
||||||
|
|
||||||
echo "Make the package \"Pandorafms console\"."
|
echo "Make the package \"Pandorafms console\"."
|
||||||
dpkg-deb --build temp_package
|
if [ "$USE_DOCKER_APP" == "1" ]; then
|
||||||
|
eval $DPKG_DEB --build temp_package
|
||||||
|
else
|
||||||
|
dpkg-deb --build temp_package
|
||||||
|
fi
|
||||||
mv temp_package.deb pandorafms.console_$pandora_version.deb
|
mv temp_package.deb pandorafms.console_$pandora_version.deb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -4,5 +4,6 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_module_units', '{"bytes
|
|||||||
ALTER TABLE `tserver` ADD COLUMN `port` int(5) unsigned NOT NULL default 0;
|
ALTER TABLE `tserver` ADD COLUMN `port` int(5) unsigned NOT NULL default 0;
|
||||||
ALTER TABLE `tmap` ADD COLUMN `id_group_map` INT(10) UNSIGNED NOT NULL default 0;
|
ALTER TABLE `tmap` ADD COLUMN `id_group_map` INT(10) UNSIGNED NOT NULL default 0;
|
||||||
ALTER TABLE `tevent_filter` MODIFY `severity` TEXT NOT NULL;
|
ALTER TABLE `tevent_filter` MODIFY `severity` TEXT NOT NULL;
|
||||||
|
ALTER TABLE `treport_content_item` ADD `id_agent_module_failover` int(10) unsigned NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
@ -2437,6 +2437,21 @@ CREATE TABLE `tagent_repository` (
|
|||||||
ON UPDATE CASCADE ON DELETE CASCADE
|
ON UPDATE CASCADE ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
-- Table `treport_content_item`
|
||||||
|
-- ----------------------------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `treport_content_item` (
|
||||||
|
`id` INTEGER UNSIGNED NOT NULL auto_increment,
|
||||||
|
`id_report_content` INTEGER UNSIGNED NOT NULL,
|
||||||
|
`id_agent_module` int(10) unsigned NOT NULL,
|
||||||
|
`id_agent_module_failover` int(10) unsigned NOT NULL DEFAULT 0,
|
||||||
|
`server_name` text,
|
||||||
|
`operation` text,
|
||||||
|
PRIMARY KEY(`id`),
|
||||||
|
FOREIGN KEY (`id_report_content`) REFERENCES treport_content(`id_rc`)
|
||||||
|
ON UPDATE CASCADE ON DELETE CASCADE
|
||||||
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- ----------------------------------------------------------------------
|
-- ----------------------------------------------------------------------
|
||||||
-- Table `tdeployment_hosts`
|
-- Table `tdeployment_hosts`
|
||||||
-- ----------------------------------------------------------------------
|
-- ----------------------------------------------------------------------
|
||||||
|
@ -703,8 +703,7 @@ if ($config['menu_type'] == 'classic') {
|
|||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#result_order').html(data);
|
$('#result_order').html(data);
|
||||||
console.log(data);
|
},
|
||||||
},
|
|
||||||
error: function (data) {
|
error: function (data) {
|
||||||
console.error("Fatal error in AJAX call to interpreter order", data)
|
console.error("Fatal error in AJAX call to interpreter order", data)
|
||||||
}
|
}
|
||||||
|
@ -628,6 +628,8 @@ switch ($action) {
|
|||||||
$unknown_checks = $item['unknown_checks'];
|
$unknown_checks = $item['unknown_checks'];
|
||||||
$agent_max_value = $item['agent_max_value'];
|
$agent_max_value = $item['agent_max_value'];
|
||||||
$agent_min_value = $item['agent_min_value'];
|
$agent_min_value = $item['agent_min_value'];
|
||||||
|
$failover_mode = $item['failover_mode'];
|
||||||
|
$failover_type = $item['failover_type'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group_report':
|
case 'group_report':
|
||||||
@ -3263,6 +3265,13 @@ function print_General_list($width, $action, $idItem=null, $type='general')
|
|||||||
$meta = false;
|
$meta = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$failover_mode = db_get_value(
|
||||||
|
'failover_mode',
|
||||||
|
'treport_content',
|
||||||
|
'id_rc',
|
||||||
|
$idItem
|
||||||
|
);
|
||||||
|
|
||||||
$operation = [
|
$operation = [
|
||||||
'avg' => __('rate'),
|
'avg' => __('rate'),
|
||||||
'max' => __('max'),
|
'max' => __('max'),
|
||||||
@ -3284,6 +3293,18 @@ function print_General_list($width, $action, $idItem=null, $type='general')
|
|||||||
<th class="header" scope="col">
|
<th class="header" scope="col">
|
||||||
<?php echo __('Module'); ?>
|
<?php echo __('Module'); ?>
|
||||||
</th>
|
</th>
|
||||||
|
<?php
|
||||||
|
if ($failover_mode) {
|
||||||
|
?>
|
||||||
|
<th class="header" scope="col">
|
||||||
|
<?php echo __('Agent Failover'); ?>
|
||||||
|
</th>
|
||||||
|
<th class="header" scope="col">
|
||||||
|
<?php echo __('Module Failover'); ?>
|
||||||
|
</th>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
<th class="header" scope="col">
|
<th class="header" scope="col">
|
||||||
<?php echo __('Action'); ?>
|
<?php echo __('Action'); ?>
|
||||||
</th>
|
</th>
|
||||||
@ -3365,19 +3386,50 @@ function print_General_list($width, $action, $idItem=null, $type='general')
|
|||||||
['id_agente_modulo' => $item['id_agent_module']]
|
['id_agente_modulo' => $item['id_agent_module']]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (isset($item['id_agent_module_failover']) === true
|
||||||
|
&& $item['id_agent_module_failover'] !== 0
|
||||||
|
) {
|
||||||
|
$idAgentFailover = db_get_value_filter(
|
||||||
|
'id_agente',
|
||||||
|
'tagente_modulo',
|
||||||
|
['id_agente_modulo' => $item['id_agent_module_failover']]
|
||||||
|
);
|
||||||
|
$nameAgentFailover = agents_get_alias(
|
||||||
|
$idAgentFailover
|
||||||
|
);
|
||||||
|
|
||||||
|
$nameModuleFailover = db_get_value_filter(
|
||||||
|
'nombre',
|
||||||
|
'tagente_modulo',
|
||||||
|
['id_agente_modulo' => $item['id_agent_module_failover']]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$server_name_element = '';
|
$server_name_element = '';
|
||||||
if ($meta && $server_name != '') {
|
if ($meta && $server_name != '') {
|
||||||
$server_name_element .= ' ('.$server_name.')';
|
$server_name_element .= ' ('.$server_name.')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type == 'availability') {
|
if ($type == 'availability') {
|
||||||
echo '<tr id="general_'.$item['id'].'" style="" class="datos">
|
if ($failover_mode) {
|
||||||
<td>'.printSmallFont($nameAgent).$server_name_element.'</td>
|
echo '<tr id="general_'.$item['id'].'" style="" class="datos">
|
||||||
<td>'.printSmallFont($nameModule).'</td>
|
<td>'.printSmallFont($nameAgent).$server_name_element.'</td>
|
||||||
<td style="text-align: center;">
|
<td>'.printSmallFont($nameModule).'</td>
|
||||||
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/cross.png', true).'</a>
|
<td>'.printSmallFont($nameAgentFailover).$server_name_element.'</td>
|
||||||
</td>
|
<td>'.printSmallFont($nameModuleFailover).'</td>
|
||||||
</tr>';
|
<td style="text-align: center;">
|
||||||
|
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/cross.png', true).'</a>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
} else {
|
||||||
|
echo '<tr id="general_'.$item['id'].'" style="" class="datos">
|
||||||
|
<td>'.printSmallFont($nameAgent).$server_name_element.'</td>
|
||||||
|
<td>'.printSmallFont($nameModule).'</td>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/cross.png', true).'</a>
|
||||||
|
</td>
|
||||||
|
</tr>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo '<tr id="general_'.$item['id'].'" style="" class="datos">
|
echo '<tr id="general_'.$item['id'].'" style="" class="datos">
|
||||||
<td>'.printSmallFont($nameAgent).$server_name_element.'</td>
|
<td>'.printSmallFont($nameAgent).$server_name_element.'</td>
|
||||||
@ -3403,6 +3455,15 @@ function print_General_list($width, $action, $idItem=null, $type='general')
|
|||||||
<td class="agent_name"></td>
|
<td class="agent_name"></td>
|
||||||
<td class="module_name"></td>
|
<td class="module_name"></td>
|
||||||
<?php
|
<?php
|
||||||
|
if ($type == 'availability'
|
||||||
|
&& $failover_mode
|
||||||
|
) {
|
||||||
|
?>
|
||||||
|
<td class="agent_name_failover"></td>
|
||||||
|
<td class="module_name_failover"></td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
if ($type != 'availability') {
|
if ($type != 'availability') {
|
||||||
?>
|
?>
|
||||||
<td class="operation_name"></td>
|
<td class="operation_name"></td>
|
||||||
@ -3456,6 +3517,43 @@ function print_General_list($width, $action, $idItem=null, $type='general')
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
|
if ($type == 'availability' && $failover_mode) {
|
||||||
|
?>
|
||||||
|
<td class="sla_list_agent_failover_col">
|
||||||
|
<input id="hidden-id_agent_failover" name="id_agent_failover" value="" type="hidden">
|
||||||
|
<input id="hidden-server_name_failover" name="server_name_failover" value="" type="hidden">
|
||||||
|
<?php
|
||||||
|
$params = [];
|
||||||
|
$params['show_helptip'] = true;
|
||||||
|
$params['input_name'] = 'agent_failover';
|
||||||
|
$params['value'] = '';
|
||||||
|
$params['use_hidden_input_idagent'] = true;
|
||||||
|
$params['hidden_input_idagent_id'] = 'hidden-id_agent_failover';
|
||||||
|
$params['javascript_is_function_select'] = true;
|
||||||
|
$params['selectbox_id'] = 'id_agent_module_failover';
|
||||||
|
$params['add_none_module'] = false;
|
||||||
|
if ($meta) {
|
||||||
|
$params['use_input_id_server'] = true;
|
||||||
|
$params['input_id_server_id'] = 'hidden-id_server';
|
||||||
|
$params['disabled_javascript_on_blur_function'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_print_agent_autocomplete_input($params);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td class="sla_list_module_failover_col">
|
||||||
|
<select id="id_agent_module_failover" name="id_agent_module_failover" disabled="disabled" style="max-width: 180px">
|
||||||
|
<option value="0">
|
||||||
|
<?php
|
||||||
|
echo __('Select an Agent first');
|
||||||
|
?>
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
if ($type !== 'availability') {
|
if ($type !== 'availability') {
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
@ -4495,6 +4593,10 @@ function addGeneralRow() {
|
|||||||
var idAgent = $("input[name=id_agent_general]").val();
|
var idAgent = $("input[name=id_agent_general]").val();
|
||||||
var serverId = $("input[name=id_server]").val();
|
var serverId = $("input[name=id_server]").val();
|
||||||
var idModule = $("#id_agent_module_general").val();
|
var idModule = $("#id_agent_module_general").val();
|
||||||
|
var nameAgentFailover = $("input[name=agent_failover]").val();
|
||||||
|
var idModuleFailover = $("#id_agent_module_failover").val();
|
||||||
|
var nameModuleFailover = $("#id_agent_module_failover :selected").text();
|
||||||
|
|
||||||
var operation;
|
var operation;
|
||||||
if ($("#id_operation_module_general").length) {
|
if ($("#id_operation_module_general").length) {
|
||||||
operation = $("#id_operation_module_general").val();
|
operation = $("#id_operation_module_general").val();
|
||||||
@ -4580,10 +4682,63 @@ function addGeneralRow() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (nameAgentFailover != '') {
|
||||||
|
//Truncate nameAgentFailover
|
||||||
|
var params = [];
|
||||||
|
params.push("truncate_text=1");
|
||||||
|
params.push("text=" + nameAgentFailover);
|
||||||
|
params.push("page=include/ajax/reporting.ajax");
|
||||||
|
jQuery.ajax ({
|
||||||
|
data: params.join ("&"),
|
||||||
|
type: 'POST',
|
||||||
|
url: action=
|
||||||
|
<?php
|
||||||
|
echo '"'.ui_get_full_url(
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
).'"';
|
||||||
|
?>
|
||||||
|
+ "/ajax.php",
|
||||||
|
async: false,
|
||||||
|
timeout: 10000,
|
||||||
|
success: function (data) {
|
||||||
|
nameAgentFailover = data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Truncate nameModuleFailover
|
||||||
|
var params = [];
|
||||||
|
params.push("truncate_text=1");
|
||||||
|
params.push("text=" + nameModuleFailover);
|
||||||
|
params.push("page=include/ajax/reporting.ajax");
|
||||||
|
jQuery.ajax ({
|
||||||
|
data: params.join ("&"),
|
||||||
|
type: 'POST',
|
||||||
|
url: action=
|
||||||
|
<?php
|
||||||
|
echo '"'.ui_get_full_url(
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
).'"';
|
||||||
|
?>
|
||||||
|
+ "/ajax.php",
|
||||||
|
async: false,
|
||||||
|
timeout: 10000,
|
||||||
|
success: function (data) {
|
||||||
|
nameModuleFailover = data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var params = [];
|
var params = [];
|
||||||
params.push("add_general=1");
|
params.push("add_general=1");
|
||||||
params.push("id=" + $("input[name=id_item]").val());
|
params.push("id=" + $("input[name=id_item]").val());
|
||||||
params.push("id_module=" + idModule);
|
params.push("id_module=" + idModule);
|
||||||
|
params.push("id_module_failover=" + idModuleFailover);
|
||||||
params.push("id_server=" + serverId);
|
params.push("id_server=" + serverId);
|
||||||
params.push("operation=" + operation);
|
params.push("operation=" + operation);
|
||||||
params.push("id_agent=" + idAgent);
|
params.push("id_agent=" + idAgent);
|
||||||
@ -4610,6 +4765,8 @@ function addGeneralRow() {
|
|||||||
$("#row", row).attr('id', 'general_' + data['id']);
|
$("#row", row).attr('id', 'general_' + data['id']);
|
||||||
$(".agent_name", row).html(nameAgent);
|
$(".agent_name", row).html(nameAgent);
|
||||||
$(".module_name", row).html(nameModule);
|
$(".module_name", row).html(nameModule);
|
||||||
|
$(".agent_name_failover", row).html(nameAgentFailover);
|
||||||
|
$(".module_name_failover", row).html(nameModuleFailover);
|
||||||
$(".operation_name", row).html(nameOperation);
|
$(".operation_name", row).html(nameOperation);
|
||||||
$(".delete_button", row).attr(
|
$(".delete_button", row).attr(
|
||||||
'href',
|
'href',
|
||||||
@ -4624,6 +4781,15 @@ function addGeneralRow() {
|
|||||||
$("#id_operation_module_general").val('avg');
|
$("#id_operation_module_general").val('avg');
|
||||||
$("#id_agent_module_general").empty();
|
$("#id_agent_module_general").empty();
|
||||||
$("#id_agent_module_general").attr('disabled', 'true');
|
$("#id_agent_module_general").attr('disabled', 'true');
|
||||||
|
|
||||||
|
$("input[name=id_agent_failover]").val('');
|
||||||
|
$("input[name=agent_failover]").val('');
|
||||||
|
$("#id_agent_module_failover").empty();
|
||||||
|
$("#id_agent_module_failover").attr('disabled', 'true');
|
||||||
|
$("#id_agent_module_failover").append(
|
||||||
|
$("<option></option>")
|
||||||
|
.attr ("value", 0)
|
||||||
|
.html ($("#module_sla_text").html()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -5111,6 +5277,12 @@ function chooseType() {
|
|||||||
$("#row_select_fields3").hide();
|
$("#row_select_fields3").hide();
|
||||||
}
|
}
|
||||||
$("#row_historical_db_check").hide();
|
$("#row_historical_db_check").hide();
|
||||||
|
|
||||||
|
$("#row_failover_mode").show();
|
||||||
|
var failover_checked = $("input[name='failover_mode']").prop("checked");
|
||||||
|
if(failover_checked){
|
||||||
|
$("#row_failover_type").show();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group_report':
|
case 'group_report':
|
||||||
|
@ -1609,6 +1609,14 @@ switch ($action) {
|
|||||||
$values['agent_min_value'] = get_parameter(
|
$values['agent_min_value'] = get_parameter(
|
||||||
'agent_min_value'
|
'agent_min_value'
|
||||||
);
|
);
|
||||||
|
$values['failover_mode'] = get_parameter(
|
||||||
|
'failover_mode',
|
||||||
|
0
|
||||||
|
);
|
||||||
|
$values['failover_type'] = get_parameter(
|
||||||
|
'failover_type',
|
||||||
|
REPORT_FAILOVER_TYPE_NORMAL
|
||||||
|
);
|
||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -111,6 +111,7 @@ if ($add_general) {
|
|||||||
$id_module = get_parameter('id_module', 0);
|
$id_module = get_parameter('id_module', 0);
|
||||||
$id_server = (int) get_parameter('id_server', 0);
|
$id_server = (int) get_parameter('id_server', 0);
|
||||||
$operation = get_parameter('operation', '');
|
$operation = get_parameter('operation', '');
|
||||||
|
$id_module_failover = (int) get_parameter('id_module_failover', 0);
|
||||||
|
|
||||||
$include_enterprise = enterprise_include('include/functions_metaconsole.php');
|
$include_enterprise = enterprise_include('include/functions_metaconsole.php');
|
||||||
|
|
||||||
@ -126,10 +127,11 @@ if ($add_general) {
|
|||||||
$result = db_process_sql_insert(
|
$result = db_process_sql_insert(
|
||||||
'treport_content_item',
|
'treport_content_item',
|
||||||
[
|
[
|
||||||
'id_report_content' => $id,
|
'id_report_content' => $id,
|
||||||
'id_agent_module' => $id_module,
|
'id_agent_module' => $id_module,
|
||||||
'server_name' => $connection['server_name'],
|
'server_name' => $connection['server_name'],
|
||||||
'operation' => $operation,
|
'operation' => $operation,
|
||||||
|
'id_agent_module_failover' => $id_module_failover,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -6256,27 +6256,6 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||||||
$return['kind_availability'] = 'module';
|
$return['kind_availability'] = 'module';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($content['subitems'])) {
|
|
||||||
if (is_metaconsole()) {
|
|
||||||
metaconsole_restore_db();
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = sprintf(
|
|
||||||
'
|
|
||||||
SELECT id_agent_module,
|
|
||||||
server_name, operation
|
|
||||||
FROM treport_content_item
|
|
||||||
WHERE id_report_content = %d',
|
|
||||||
$content['id_rc']
|
|
||||||
);
|
|
||||||
|
|
||||||
$items = db_process_sql($sql);
|
|
||||||
} else {
|
|
||||||
$items = $content['subitems'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = [];
|
|
||||||
|
|
||||||
$avg = 0;
|
$avg = 0;
|
||||||
$min = null;
|
$min = null;
|
||||||
$min_text = '';
|
$min_text = '';
|
||||||
@ -6284,180 +6263,241 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||||||
$max_text = '';
|
$max_text = '';
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
|
||||||
$style = io_safe_output($content['style']);
|
if ($content['failover_mode']) {
|
||||||
if ($style['hide_notinit_agents']) {
|
$availability_graph_data = reporting_availability_graph($report, $content, false, true);
|
||||||
$aux_id_agents = $agents;
|
$data = $availability_graph_data['data'];
|
||||||
$i = 0;
|
|
||||||
foreach ($items as $item) {
|
foreach ($data as $key => $item_data) {
|
||||||
$utimestamp = db_get_value('utimestamp', 'tagente_datos', 'id_agente_modulo', $item['id_agent_module'], true);
|
$percent_ok = $item_data['sla_value'];
|
||||||
if (($utimestamp === false) || (intval($utimestamp) > intval($datetime_to))) {
|
$data[$key]['SLA'] = $percent_ok;
|
||||||
unset($items[$i]);
|
|
||||||
|
if ($item_data['failover'] != 'result') {
|
||||||
|
$data[$key]['availability_item'] = $item_data['module'];
|
||||||
|
$text = $item_data['agent'].' ('.$item_data['module'].')';
|
||||||
|
$avg = ((($avg * $count) + $percent_ok) / ($count + 1));
|
||||||
|
if (is_null($min)) {
|
||||||
|
$min = $percent_ok;
|
||||||
|
$min_text = $text;
|
||||||
|
} else {
|
||||||
|
if ($min > $percent_ok) {
|
||||||
|
$min = $percent_ok;
|
||||||
|
$min_text = $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_null($max)) {
|
||||||
|
$max = $percent_ok;
|
||||||
|
$max_text = $text;
|
||||||
|
} else {
|
||||||
|
if ($max < $percent_ok) {
|
||||||
|
$max = $percent_ok;
|
||||||
|
$max_text = $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$count++;
|
||||||
|
} else {
|
||||||
|
$data[$key]['availability_item'] = '--';
|
||||||
|
$data[$key]['agent'] = '--';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (empty($content['subitems'])) {
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$sql = sprintf(
|
||||||
}
|
'
|
||||||
}
|
SELECT id_agent_module, id_agent_module_failover,
|
||||||
|
server_name, operation
|
||||||
|
FROM treport_content_item
|
||||||
|
WHERE id_report_content = %d',
|
||||||
|
$content['id_rc']
|
||||||
|
);
|
||||||
|
|
||||||
|
$items = db_process_sql($sql);
|
||||||
|
} else {
|
||||||
|
$items = $content['subitems'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = [];
|
||||||
|
|
||||||
|
$style = io_safe_output($content['style']);
|
||||||
|
if ($style['hide_notinit_agents']) {
|
||||||
|
$aux_id_agents = $agents;
|
||||||
|
$i = 0;
|
||||||
|
foreach ($items as $item) {
|
||||||
|
$utimestamp = db_get_value('utimestamp', 'tagente_datos', 'id_agente_modulo', $item['id_agent_module'], true);
|
||||||
|
if (($utimestamp === false) || (intval($utimestamp) > intval($datetime_to))) {
|
||||||
|
unset($items[$i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($items)) {
|
||||||
|
foreach ($items as $item) {
|
||||||
|
// aaMetaconsole connection
|
||||||
|
$server_name = $item['server_name'];
|
||||||
|
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||||
|
$connection = metaconsole_get_connection($server_name);
|
||||||
|
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||||
|
// ui_print_error_message ("Error connecting to ".$server_name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modules_is_disable_agent($item['id_agent_module'])
|
||||||
|
|| modules_is_not_init($item['id_agent_module'])
|
||||||
|
) {
|
||||||
|
// Restore dbconnection
|
||||||
|
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($items)) {
|
|
||||||
foreach ($items as $item) {
|
|
||||||
// aaMetaconsole connection
|
|
||||||
$server_name = $item['server_name'];
|
|
||||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
|
||||||
$connection = metaconsole_get_connection($server_name);
|
|
||||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
|
||||||
// ui_print_error_message ("Error connecting to ".$server_name);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (modules_is_disable_agent($item['id_agent_module'])
|
$row = [];
|
||||||
|| modules_is_not_init($item['id_agent_module'])
|
|
||||||
) {
|
$text = '';
|
||||||
|
|
||||||
|
$row['data'] = reporting_advanced_sla(
|
||||||
|
$item['id_agent_module'],
|
||||||
|
($report['datetime'] - $content['period']),
|
||||||
|
$report['datetime'],
|
||||||
|
null,
|
||||||
|
// min_value -> dynamic
|
||||||
|
null,
|
||||||
|
// max_value -> dynamic
|
||||||
|
null,
|
||||||
|
// inverse_interval -> dynamic
|
||||||
|
[
|
||||||
|
'1' => $content['sunday'],
|
||||||
|
'2' => $content['monday'],
|
||||||
|
'3' => $content['tuesday'],
|
||||||
|
'4' => $content['wednesday'],
|
||||||
|
'5' => $content['thursday'],
|
||||||
|
'6' => $content['friday'],
|
||||||
|
'7' => $content['saturday'],
|
||||||
|
],
|
||||||
|
$content['time_from'],
|
||||||
|
$content['time_to']
|
||||||
|
);
|
||||||
|
|
||||||
|
// HACK it is saved in show_graph field.
|
||||||
|
// Show interfaces instead the modules
|
||||||
|
if ($content['show_graph']) {
|
||||||
|
$text = $row['data']['availability_item'] = agents_get_address(
|
||||||
|
modules_get_agentmodule_agent($item['id_agent_module'])
|
||||||
|
);
|
||||||
|
|
||||||
|
if (empty($text)) {
|
||||||
|
$text = $row['data']['availability_item'] = __('No Address');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$text = $row['data']['availability_item'] = modules_get_agentmodule_name(
|
||||||
|
$item['id_agent_module']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$row['data']['agent'] = modules_get_agentmodule_agent_alias(
|
||||||
|
$item['id_agent_module']
|
||||||
|
);
|
||||||
|
|
||||||
|
$text = $row['data']['agent'].' ('.$text.')';
|
||||||
|
|
||||||
// Restore dbconnection
|
// Restore dbconnection
|
||||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
// find order
|
||||||
}
|
$row['data']['order'] = $row['data']['SLA'];
|
||||||
|
|
||||||
$row = [];
|
$percent_ok = $row['data']['SLA'];
|
||||||
|
$avg = ((($avg * $count) + $percent_ok) / ($count + 1));
|
||||||
$text = '';
|
if (is_null($min)) {
|
||||||
|
|
||||||
$row['data'] = reporting_advanced_sla(
|
|
||||||
$item['id_agent_module'],
|
|
||||||
($report['datetime'] - $content['period']),
|
|
||||||
$report['datetime'],
|
|
||||||
null,
|
|
||||||
// min_value -> dynamic
|
|
||||||
null,
|
|
||||||
// max_value -> dynamic
|
|
||||||
null,
|
|
||||||
// inverse_interval -> dynamic
|
|
||||||
[
|
|
||||||
'1' => $content['sunday'],
|
|
||||||
'2' => $content['monday'],
|
|
||||||
'3' => $content['tuesday'],
|
|
||||||
'4' => $content['wednesday'],
|
|
||||||
'5' => $content['thursday'],
|
|
||||||
'6' => $content['friday'],
|
|
||||||
'7' => $content['saturday'],
|
|
||||||
],
|
|
||||||
$content['time_from'],
|
|
||||||
$content['time_to']
|
|
||||||
);
|
|
||||||
|
|
||||||
// HACK it is saved in show_graph field.
|
|
||||||
// Show interfaces instead the modules
|
|
||||||
if ($content['show_graph']) {
|
|
||||||
$text = $row['data']['availability_item'] = agents_get_address(
|
|
||||||
modules_get_agentmodule_agent($item['id_agent_module'])
|
|
||||||
);
|
|
||||||
|
|
||||||
if (empty($text)) {
|
|
||||||
$text = $row['data']['availability_item'] = __('No Address');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$text = $row['data']['availability_item'] = modules_get_agentmodule_name(
|
|
||||||
$item['id_agent_module']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$row['data']['agent'] = modules_get_agentmodule_agent_alias(
|
|
||||||
$item['id_agent_module']
|
|
||||||
);
|
|
||||||
|
|
||||||
$text = $row['data']['agent'].' ('.$text.')';
|
|
||||||
|
|
||||||
// Restore dbconnection
|
|
||||||
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
|
|
||||||
metaconsole_restore_db();
|
|
||||||
}
|
|
||||||
|
|
||||||
// find order
|
|
||||||
$row['data']['order'] = $row['data']['SLA'];
|
|
||||||
|
|
||||||
$percent_ok = $row['data']['SLA'];
|
|
||||||
$avg = ((($avg * $count) + $percent_ok) / ($count + 1));
|
|
||||||
if (is_null($min)) {
|
|
||||||
$min = $percent_ok;
|
|
||||||
$min_text = $text;
|
|
||||||
} else {
|
|
||||||
if ($min > $percent_ok) {
|
|
||||||
$min = $percent_ok;
|
$min = $percent_ok;
|
||||||
$min_text = $text;
|
$min_text = $text;
|
||||||
|
} else {
|
||||||
|
if ($min > $percent_ok) {
|
||||||
|
$min = $percent_ok;
|
||||||
|
$min_text = $text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (is_null($max)) {
|
if (is_null($max)) {
|
||||||
$max = $percent_ok;
|
|
||||||
$max_text = $text;
|
|
||||||
} else {
|
|
||||||
if ($max < $percent_ok) {
|
|
||||||
$max = $percent_ok;
|
$max = $percent_ok;
|
||||||
$max_text = $text;
|
$max_text = $text;
|
||||||
|
} else {
|
||||||
|
if ($max < $percent_ok) {
|
||||||
|
$max = $percent_ok;
|
||||||
|
$max_text = $text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data[] = $row['data'];
|
||||||
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[] = $row['data'];
|
switch ($content['order_uptodown']) {
|
||||||
$count++;
|
case REPORT_ITEM_ORDER_BY_AGENT_NAME:
|
||||||
}
|
$temp = [];
|
||||||
|
foreach ($data as $row) {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($temp as $t_row) {
|
||||||
|
if (strcmp($row['data']['agent'], $t_row['agent']) < 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($content['order_uptodown']) {
|
$i++;
|
||||||
case REPORT_ITEM_ORDER_BY_AGENT_NAME:
|
|
||||||
$temp = [];
|
|
||||||
foreach ($data as $row) {
|
|
||||||
$i = 0;
|
|
||||||
foreach ($temp as $t_row) {
|
|
||||||
if (strcmp($row['data']['agent'], $t_row['agent']) < 0) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
array_splice($temp, $i, 0, [$row]);
|
||||||
}
|
}
|
||||||
|
|
||||||
array_splice($temp, $i, 0, [$row]);
|
$data = $temp;
|
||||||
}
|
break;
|
||||||
|
|
||||||
$data = $temp;
|
case REPORT_ITEM_ORDER_BY_ASCENDING:
|
||||||
break;
|
$temp = [];
|
||||||
|
foreach ($data as $row) {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($temp as $t_row) {
|
||||||
|
if ($row['data']['SLA'] < $t_row['order']) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case REPORT_ITEM_ORDER_BY_ASCENDING:
|
$i++;
|
||||||
$temp = [];
|
|
||||||
foreach ($data as $row) {
|
|
||||||
$i = 0;
|
|
||||||
foreach ($temp as $t_row) {
|
|
||||||
if ($row['data']['SLA'] < $t_row['order']) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
array_splice($temp, $i, 0, [$row]);
|
||||||
}
|
}
|
||||||
|
|
||||||
array_splice($temp, $i, 0, [$row]);
|
$data = $temp;
|
||||||
}
|
break;
|
||||||
|
|
||||||
$data = $temp;
|
case REPORT_ITEM_ORDER_BY_DESCENDING:
|
||||||
break;
|
$temp = [];
|
||||||
|
foreach ($data as $row) {
|
||||||
|
$i = 0;
|
||||||
|
foreach ($temp as $t_row) {
|
||||||
|
if ($row['data']['SLA'] > $t_row['order']) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case REPORT_ITEM_ORDER_BY_DESCENDING:
|
$i++;
|
||||||
$temp = [];
|
|
||||||
foreach ($data as $row) {
|
|
||||||
$i = 0;
|
|
||||||
foreach ($temp as $t_row) {
|
|
||||||
if ($row['data']['SLA'] > $t_row['order']) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
array_splice($temp, $i, 0, [$row]);
|
||||||
}
|
}
|
||||||
|
|
||||||
array_splice($temp, $i, 0, [$row]);
|
$data = $temp;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
$data = $temp;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6496,7 +6536,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||||||
*
|
*
|
||||||
* @return array Generates a structure the report.
|
* @return array Generates a structure the report.
|
||||||
*/
|
*/
|
||||||
function reporting_availability_graph($report, $content, $pdf=false)
|
function reporting_availability_graph($report, $content, $pdf=false, $failover=false)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$return = [];
|
$return = [];
|
||||||
@ -6538,7 +6578,7 @@ function reporting_availability_graph($report, $content, $pdf=false)
|
|||||||
|
|
||||||
$slas = io_safe_output(
|
$slas = io_safe_output(
|
||||||
db_get_all_rows_field_filter(
|
db_get_all_rows_field_filter(
|
||||||
'treport_content_sla_combined',
|
($failover) ? 'treport_content_item' : 'treport_content_sla_combined',
|
||||||
'id_report_content',
|
'id_report_content',
|
||||||
$content['id_rc']
|
$content['id_rc']
|
||||||
)
|
)
|
||||||
@ -6943,9 +6983,19 @@ function prepare_data_for_paint(
|
|||||||
$alias_agent = modules_get_agentmodule_agent_alias(
|
$alias_agent = modules_get_agentmodule_agent_alias(
|
||||||
$sla['id_agent_module']
|
$sla['id_agent_module']
|
||||||
);
|
);
|
||||||
$name_module = modules_get_agentmodule_name(
|
|
||||||
$sla['id_agent_module']
|
if ($content['show_graph']) {
|
||||||
);
|
$name_module = agents_get_address(
|
||||||
|
modules_get_agentmodule_agent($sla['id_agent_module'])
|
||||||
|
);
|
||||||
|
if (empty($name_module)) {
|
||||||
|
$name_module = __('No Address');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$name_module = modules_get_agentmodule_name(
|
||||||
|
$sla['id_agent_module']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$data['agent'] = $alias_agent;
|
$data['agent'] = $alias_agent;
|
||||||
$data['module'] = $name_module;
|
$data['module'] = $name_module;
|
||||||
|
@ -3028,6 +3028,10 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
$table1->data = [];
|
$table1->data = [];
|
||||||
|
|
||||||
$table1->head = [];
|
$table1->head = [];
|
||||||
|
if (isset($item['data'][0]['failover'])) {
|
||||||
|
$table1->head[-1] = __('Failover');
|
||||||
|
}
|
||||||
|
|
||||||
$table1->head[0] = __('Agent');
|
$table1->head[0] = __('Agent');
|
||||||
// HACK it is saved in show_graph field.
|
// HACK it is saved in show_graph field.
|
||||||
// Show interfaces instead the modules.
|
// Show interfaces instead the modules.
|
||||||
@ -3076,6 +3080,10 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
$table1->head[8] = __('% Ok');
|
$table1->head[8] = __('% Ok');
|
||||||
|
|
||||||
$table1->headstyle = [];
|
$table1->headstyle = [];
|
||||||
|
if (isset($item['data'][0]['failover'])) {
|
||||||
|
$table1->headstyle[-1] = 'text-align: left';
|
||||||
|
}
|
||||||
|
|
||||||
$table1->headstyle[0] = 'text-align: left';
|
$table1->headstyle[0] = 'text-align: left';
|
||||||
$table1->headstyle[1] = 'text-align: left';
|
$table1->headstyle[1] = 'text-align: left';
|
||||||
$table1->headstyle[2] = 'text-align: center';
|
$table1->headstyle[2] = 'text-align: center';
|
||||||
@ -3086,6 +3094,10 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
$table1->headstyle[7] = 'text-align: right';
|
$table1->headstyle[7] = 'text-align: right';
|
||||||
$table1->headstyle[8] = 'text-align: right';
|
$table1->headstyle[8] = 'text-align: right';
|
||||||
|
|
||||||
|
if (isset($item['data'][0]['failover'])) {
|
||||||
|
$table1->style[-1] = 'text-align: left';
|
||||||
|
}
|
||||||
|
|
||||||
$table1->style[0] = 'text-align: left';
|
$table1->style[0] = 'text-align: left';
|
||||||
$table1->style[1] = 'text-align: left';
|
$table1->style[1] = 'text-align: left';
|
||||||
$table1->style[2] = 'text-align: center';
|
$table1->style[2] = 'text-align: center';
|
||||||
@ -3101,6 +3113,10 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
$table2->data = [];
|
$table2->data = [];
|
||||||
|
|
||||||
$table2->head = [];
|
$table2->head = [];
|
||||||
|
if (isset($item['data'][0]['failover'])) {
|
||||||
|
$table2->head[-1] = __('Failover');
|
||||||
|
}
|
||||||
|
|
||||||
$table2->head[0] = __('Agent');
|
$table2->head[0] = __('Agent');
|
||||||
// HACK it is saved in show_graph field.
|
// HACK it is saved in show_graph field.
|
||||||
// Show interfaces instead the modules.
|
// Show interfaces instead the modules.
|
||||||
@ -3135,6 +3151,10 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$table2->headstyle = [];
|
$table2->headstyle = [];
|
||||||
|
if (isset($item['data'][0]['failover'])) {
|
||||||
|
$table2->headstyle[-1] = 'text-align: left';
|
||||||
|
}
|
||||||
|
|
||||||
$table2->headstyle[0] = 'text-align: left';
|
$table2->headstyle[0] = 'text-align: left';
|
||||||
$table2->headstyle[1] = 'text-align: left';
|
$table2->headstyle[1] = 'text-align: left';
|
||||||
$table2->headstyle[2] = 'text-align: right';
|
$table2->headstyle[2] = 'text-align: right';
|
||||||
@ -3142,6 +3162,10 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
$table2->headstyle[4] = 'text-align: right';
|
$table2->headstyle[4] = 'text-align: right';
|
||||||
$table2->headstyle[5] = 'text-align: right';
|
$table2->headstyle[5] = 'text-align: right';
|
||||||
|
|
||||||
|
if (isset($item['data'][0]['failover'])) {
|
||||||
|
$table2->style[-1] = 'text-align: left';
|
||||||
|
}
|
||||||
|
|
||||||
$table2->style[0] = 'text-align: left';
|
$table2->style[0] = 'text-align: left';
|
||||||
$table2->style[1] = 'text-align: left';
|
$table2->style[1] = 'text-align: left';
|
||||||
$table2->style[2] = 'text-align: right';
|
$table2->style[2] = 'text-align: right';
|
||||||
@ -3151,8 +3175,21 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
|
|
||||||
foreach ($item['data'] as $row) {
|
foreach ($item['data'] as $row) {
|
||||||
$table_row = [];
|
$table_row = [];
|
||||||
$table_row[] = $row['agent'];
|
if (isset($row['failover'])) {
|
||||||
$table_row[] = $row['availability_item'];
|
if (strpos($row['failover'], 'failover') !== false) {
|
||||||
|
$table_row[] = __('Failover');
|
||||||
|
} else {
|
||||||
|
$table_row[] = ucfirst($row['failover']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($row['failover']) && $row['failover'] === 'result') {
|
||||||
|
$table_row[] = '--';
|
||||||
|
$table_row[] = '--';
|
||||||
|
} else {
|
||||||
|
$table_row[] = $row['agent'];
|
||||||
|
$table_row[] = $row['availability_item'];
|
||||||
|
}
|
||||||
|
|
||||||
if ($row['time_total'] != 0 && $item['fields']['total_time']) {
|
if ($row['time_total'] != 0 && $item['fields']['total_time']) {
|
||||||
$table_row[] = human_time_description_raw(
|
$table_row[] = human_time_description_raw(
|
||||||
@ -3229,6 +3266,10 @@ function reporting_html_availability($table, $item, $pdf=0)
|
|||||||
$table_row[] = '<span style="font-size: '.$font_size.'; font-weight:bold;">'.sla_truncate($row['SLA'], $config['graph_precision']).'%</span>';
|
$table_row[] = '<span style="font-size: '.$font_size.'; font-weight:bold;">'.sla_truncate($row['SLA'], $config['graph_precision']).'%</span>';
|
||||||
|
|
||||||
$table_row2 = [];
|
$table_row2 = [];
|
||||||
|
if (isset($row['failover'])) {
|
||||||
|
$table_row2[] = ucfirst($row['failover']);
|
||||||
|
}
|
||||||
|
|
||||||
$table_row2[] = $row['agent'];
|
$table_row2[] = $row['agent'];
|
||||||
$table_row2[] = $row['availability_item'];
|
$table_row2[] = $row['availability_item'];
|
||||||
if ($item['fields']['total_checks']) {
|
if ($item['fields']['total_checks']) {
|
||||||
|
@ -919,7 +919,7 @@ function servers_get_info($id_server=-1)
|
|||||||
|
|
||||||
// Remote servers LAG Calculation (server_type != 0).
|
// Remote servers LAG Calculation (server_type != 0).
|
||||||
if ($server['server_type'] != 0) {
|
if ($server['server_type'] != 0) {
|
||||||
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
|
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
|
||||||
$result = db_get_row_sql(
|
$result = db_get_row_sql(
|
||||||
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
||||||
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
||||||
@ -936,7 +936,7 @@ function servers_get_info($id_server=-1)
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Local/Dataserver server LAG calculation.
|
// Local/Dataserver server LAG calculation.
|
||||||
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
|
// MySQL 8.0 has function lag(). So, lag must be enclosed in quotations.
|
||||||
$result = db_get_row_sql(
|
$result = db_get_row_sql(
|
||||||
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
'SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag,
|
||||||
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS "lag"
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
<div style='height: 10px'>
|
<div style='height: 10px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.742';
|
$version = '7.0NG.742';
|
||||||
$build = '200127';
|
$build = '200103';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
@ -965,11 +965,8 @@ function install_step4()
|
|||||||
|
|
||||||
$step5 = mysqli_query(
|
$step5 = mysqli_query(
|
||||||
$connection,
|
$connection,
|
||||||
"CREATE USER pandora@$host IDENTIFIED BY '".$random_password."'"
|
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host
|
||||||
);
|
IDENTIFIED BY '".$random_password."'"
|
||||||
$step5 |= mysqli_query(
|
|
||||||
$connection,
|
|
||||||
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host"
|
|
||||||
);
|
);
|
||||||
mysqli_query($connection, 'FLUSH PRIVILEGES');
|
mysqli_query($connection, 'FLUSH PRIVILEGES');
|
||||||
check_generic($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>");
|
check_generic($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>");
|
||||||
|
@ -1489,6 +1489,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_item` (
|
|||||||
`id` INTEGER UNSIGNED NOT NULL auto_increment,
|
`id` INTEGER UNSIGNED NOT NULL auto_increment,
|
||||||
`id_report_content` INTEGER UNSIGNED NOT NULL,
|
`id_report_content` INTEGER UNSIGNED NOT NULL,
|
||||||
`id_agent_module` int(10) unsigned NOT NULL,
|
`id_agent_module` int(10) unsigned NOT NULL,
|
||||||
|
`id_agent_module_failover` int(10) unsigned NOT NULL DEFAULT 0,
|
||||||
`server_name` text,
|
`server_name` text,
|
||||||
`operation` text,
|
`operation` text,
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
|
@ -64,6 +64,22 @@ mkdir temp_package
|
|||||||
|
|
||||||
if [ $package_pandora -eq 1 ]
|
if [ $package_pandora -eq 1 ]
|
||||||
then
|
then
|
||||||
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
|
if [ $? = 1 ]
|
||||||
|
then
|
||||||
|
if [ "$DPKG_DEB" == "" ]; then
|
||||||
|
echo "No found \"dpkg-deb\" aplication, please install."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ">> Using dockerized version of dpkg-deb: "
|
||||||
|
echo " $DPKG_DEB"
|
||||||
|
# Use dockerized app.
|
||||||
|
USE_DOCKER_APP=1
|
||||||
|
else
|
||||||
|
echo "Found \"dpkg-debs\"."
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p temp_package/usr/bin/
|
mkdir -p temp_package/usr/bin/
|
||||||
mkdir -p temp_package/usr/sbin/
|
mkdir -p temp_package/usr/sbin/
|
||||||
mkdir -p temp_package/etc/init.d/
|
mkdir -p temp_package/etc/init.d/
|
||||||
@ -164,8 +180,15 @@ then
|
|||||||
echo "END"
|
echo "END"
|
||||||
|
|
||||||
echo "Make the package \"Pandorafms server\"."
|
echo "Make the package \"Pandorafms server\"."
|
||||||
dpkg-deb --build temp_package
|
if [ "$USE_DOCKER_APP" == "1" ]; then
|
||||||
|
eval $DPKG_DEB --build temp_package
|
||||||
|
else
|
||||||
|
dpkg-deb --build temp_package
|
||||||
|
fi
|
||||||
mv temp_package.deb pandorafms.server_$pandora_version.deb
|
mv temp_package.deb pandorafms.server_$pandora_version.deb
|
||||||
|
echo "generated: pandorafms.server_$pandora_version.deb"
|
||||||
|
pwd
|
||||||
|
ls -lah pandorafms.server_$pandora_version.deb
|
||||||
chmod 777 pandorafms.server_$pandora_version.deb
|
chmod 777 pandorafms.server_$pandora_version.deb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ fi
|
|||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(750,root,root)
|
||||||
%doc AUTHORS COPYING README
|
%doc AUTHORS COPYING README
|
||||||
%{_sysconfdir}/rc.d/init.d/pandora_server
|
%{_sysconfdir}/rc.d/init.d/pandora_server
|
||||||
%{_sysconfdir}/rc.d/init.d/tentacle_serverd
|
%{_sysconfdir}/rc.d/init.d/tentacle_serverd
|
||||||
@ -174,10 +174,11 @@ exit 0
|
|||||||
%{_mandir}/man1/pandora_server.1.gz
|
%{_mandir}/man1/pandora_server.1.gz
|
||||||
%{_mandir}/man1/tentacle_server.1.gz
|
%{_mandir}/man1/tentacle_server.1.gz
|
||||||
|
|
||||||
%defattr(-,pandora,root)
|
%defattr(750,pandora,root)
|
||||||
%{_bindir}/pandora_exec
|
%{_bindir}/pandora_exec
|
||||||
%{_bindir}/pandora_server
|
%{_bindir}/pandora_server
|
||||||
%{_bindir}/tentacle_server
|
%{_bindir}/tentacle_server
|
||||||
|
|
||||||
%dir %{_sysconfdir}/pandora
|
%dir %{_sysconfdir}/pandora
|
||||||
%dir %{_localstatedir}/spool/pandora
|
%dir %{_localstatedir}/spool/pandora
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@ Packager: Sancho Lerena <slerena@artica.es>
|
|||||||
Prefix: /usr/share
|
Prefix: /usr/share
|
||||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
BuildRoot: %{_tmppath}/%{name}-buildroot
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
|
# PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
|
||||||
|
Requires(pre,preun):/usr/bin/sed /usr/bin/grep /usr/sbin/useradd
|
||||||
AutoReq: 0
|
AutoReq: 0
|
||||||
Provides: %{name}-%{version}
|
Provides: %{name}-%{version}
|
||||||
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
|
Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user