Fixes for the Oracl€.

This commit is contained in:
mdtrooper 2015-06-05 14:47:50 +02:00
parent a9675820b9
commit 371aafa3fa
3 changed files with 13 additions and 8 deletions

View File

@ -2130,8 +2130,12 @@ function modules_get_count_datas($id_agent_module, $date_init, $date_end) {
$date_end = strtotime($date_end);
}
$first_date = modules_get_first_contact_date($id_agent_module);
if ($date_init < $first_date) {
$date_init = $first_date;
}
@ -2144,6 +2148,8 @@ function modules_get_count_datas($id_agent_module, $date_init, $date_end) {
function modules_get_count_data_with_value($id_agent_module, $date_init,
$date_end, $value) {
global $config;
if (!is_numeric($date_init)) {
$date_init = strtotime($date_init);
}
@ -2203,14 +2209,9 @@ function modules_get_first_contact_date($id_agent_module) {
// TODO FOR OTHER KIND OF DATA
$sql = "
SELECT utimestamp
FROM tagente_datos
WHERE id_agente_modulo = " . (int)($id_agent_module) . "
ORDER BY utimestamp ASC
LIMIT 1";
$first_date = db_get_sql($sql, 0, $config['history_db_enabled']);
$first_date = db_get_value('utimestamp', 'tagente_datos',
'id_agente_modulo', $id_agent_module,
$config['history_db_enabled']);
return $first_date;
}

View File

@ -3721,6 +3721,8 @@ function reporting_availability($report, $content) {
$text = "";
// HACK it is saved in show_graph field.
// Show interfaces instead the modules
if ($content['show_graph']) {
@ -3746,6 +3748,7 @@ function reporting_availability($report, $content) {
$report["datetime"]);
if (empty($count_checks)) {
$row['checks'] = __('Unknown');
$row['failed'] = __('Unknown');

View File

@ -1615,6 +1615,7 @@ function reporting_html_text(&$table, $item) {
function reporting_html_availability(&$table, $item) {
if (!empty($item["data"])) {
$table1 = new stdClass();
$table1->width = '99%';
$table1->data = array ();
$table1->head = array ();