diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 41a552ad2e..b4711b6706 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160125 +Version: 6.1dev-160126 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 4402798359..fdc2036a18 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160125" +pandora_version="6.1dev-160126" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index d6fc3e0303..7ba88a742d 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160125'; +use constant AGENT_BUILD => '160126'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 0392083a31..0cb5052b70 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160125 +%define release 160126 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3e2d63478f..34e42fc2f8 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160125 +%define release 160126 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer old mode 100644 new mode 100755 index 38b2a447cb..6581e710aa --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160125" +PI_BUILD="160126" OS_NAME=`uname -s` FORCE=0 @@ -486,6 +486,9 @@ install () { echo " ($HOME/.ssh/id_dsa) under /home/pandora/.ssh/authorized_keys " echo "on your Pandora FMS Server host" echo " " + echo "You may need to install manually some additional required dependencies:" + echo "perl-Sys-Syslog" + echo " " echo "You also need to setup your $PANDORA_BASE$PANDORA_CFG/pandora_agent.conf config file" echo " " if [ "$OS_NAME" = "FreeBSD" ] diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index add488b963..b14e539114 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160125} +{160126} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 963751d774..584e5e9fa4 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160125)") +#define PANDORA_VERSION ("6.1dev(Build 160126)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index fabc7edf6b..85212901c7 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160125))" + VALUE "ProductVersion", "(6.1dev(Build 160126))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e846f183c7..c86b184137 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160125 +Version: 6.1dev-160126 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 1a2a0eaf86..fca6a59ffe 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160125" +pandora_version="6.1dev-160126" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 8754d8b28b..5474820287 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160125'; +$build_version = 'PC160126'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 43281dfad8..f65e84f6a2 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3792,198 +3792,200 @@ function reporting_availability($report, $content) { $max = null; $max_text = ""; $count = 0; - foreach ($items as $item) { - //aaMetaconsole connection - $server_name = $item ['server_name']; - if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { - $connection = metaconsole_get_connection($server_name); - if (metaconsole_load_external_db($connection) != NOERR) { - //ui_print_error_message ("Error connecting to ".$server_name); + + if (!empty($items)) { + foreach ($items as $item) { + //aaMetaconsole connection + $server_name = $item ['server_name']; + if (($config ['metaconsole'] == 1) && $server_name != '' && defined('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 != '' && defined('METACONSOLE')) { + metaconsole_restore_db(); + } + continue; } - } - - - - if (modules_is_disable_agent($item['id_agent_module']) - || modules_is_not_init($item['id_agent_module'])) { + + $row = array(); + + $text = ""; + + // HACK it is saved in show_graph field. + // Show interfaces instead the modules + if ($content['show_graph']) { + $text = $row['availability_item'] = agents_get_address( + modules_get_agentmodule_agent($item['id_agent_module'])); + + if (empty($text)) { + $text = $row['availability_item'] = __('No Address'); + } + } + else { + $text = $row['availability_item'] = modules_get_agentmodule_name( + $item['id_agent_module']); + } + + $row['agent'] = modules_get_agentmodule_agent_name( + $item['id_agent_module']); + + $text = $row['agent'] . " (" . $text . ")"; + + $sla_value = reporting_get_agentmodule_sla( + $item['id_agent_module'], + $content['period'], + 0.50, + 1.50, + $report["datetime"], + null, + $content['time_from'], + $content['time_to']); + + $count_checks = modules_get_count_datas( + $item['id_agent_module'], + $report["datetime"] - $content['period'], + $report["datetime"]); + + + if ($sla_value === false) { + $row['checks'] = __('Unknown'); + $row['failed'] = __('Unknown'); + $row['fail'] = __('Unknown'); + $row['poling_time'] = __('Unknown'); + $row['time_unavaliable'] = __('Unknown'); + $row['ok'] = __('Unknown'); + $row['order'] = 0; + + $percent_ok = 0; + } + else { + $percent_ok = format_numeric($sla_value, 2); + $percent_fail = (100 - $percent_ok); + + $row['checks'] = format_numeric($count_checks, 0); + $row['ok'] = format_numeric($percent_ok,2) . " %"; + $row['order'] = $percent_ok; + $row['fail'] = format_numeric($percent_fail,2) . " %"; + $row['failed'] = + format_numeric($percent_fail * $count_checks / 100, 0); + + + $row['poling_time'] = + human_time_description_raw( + ($percent_ok * $count_checks / 100) * modules_get_interval($item['id_agent_module']), + true); + + $row['time_unavaliable'] = "-"; + if ($percent_fail > 0) { + $row['time_unavaliable'] = + human_time_description_raw( + ($percent_fail * $count_checks / 100) * modules_get_interval($item['id_agent_module']), + true); + } + + } + + $data[] = $row; + + + $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; + } + } + + //Restore dbconnection if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { metaconsole_restore_db(); } - continue; - } - - $row = array(); - - $text = ""; - - // HACK it is saved in show_graph field. - // Show interfaces instead the modules - if ($content['show_graph']) { - $text = $row['availability_item'] = agents_get_address( - modules_get_agentmodule_agent($item['id_agent_module'])); - - if (empty($text)) { - $text = $row['availability_item'] = __('No Address'); - } - } - else { - $text = $row['availability_item'] = modules_get_agentmodule_name( - $item['id_agent_module']); - } - - $row['agent'] = modules_get_agentmodule_agent_name( - $item['id_agent_module']); - - $text = $row['agent'] . " (" . $text . ")"; - - $sla_value = reporting_get_agentmodule_sla( - $item['id_agent_module'], - $content['period'], - 0.50, - 1.50, - $report["datetime"], - null, - $content['time_from'], - $content['time_to']); - - $count_checks = modules_get_count_datas( - $item['id_agent_module'], - $report["datetime"] - $content['period'], - $report["datetime"]); - - - if ($sla_value === false) { - $row['checks'] = __('Unknown'); - $row['failed'] = __('Unknown'); - $row['fail'] = __('Unknown'); - $row['poling_time'] = __('Unknown'); - $row['time_unavaliable'] = __('Unknown'); - $row['ok'] = __('Unknown'); - $row['order'] = 0; - - $percent_ok = 0; - } - else { - $percent_ok = format_numeric($sla_value, 2); - $percent_fail = (100 - $percent_ok); - - $row['checks'] = format_numeric($count_checks, 0); - $row['ok'] = format_numeric($percent_ok,2) . " %"; - $row['order'] = $percent_ok; - $row['fail'] = format_numeric($percent_fail,2) . " %"; - $row['failed'] = - format_numeric($percent_fail * $count_checks / 100, 0); - - - $row['poling_time'] = - human_time_description_raw( - ($percent_ok * $count_checks / 100) * modules_get_interval($item['id_agent_module']), - true); - - $row['time_unavaliable'] = "-"; - if ($percent_fail > 0) { - $row['time_unavaliable'] = - human_time_description_raw( - ($percent_fail * $count_checks / 100) * modules_get_interval($item['id_agent_module']), - true); - } - - } - - $data[] = $row; - - - $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++; } - //Restore dbconnection - if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { - metaconsole_restore_db(); + switch ($content['order_uptodown']) { + case REPORT_ITEM_ORDER_BY_AGENT_NAME: + $temp = array(); + foreach ($data as $row) { + $i = 0; + foreach ($temp as $t_row) { + if (strcmp($row['agent'], $t_row['agent']) < 0) { + break; + } + + $i++; + } + + array_splice($temp, $i, 0, array($row)); + } + + $data = $temp; + break; + case REPORT_ITEM_ORDER_BY_ASCENDING: + $temp = array(); + foreach ($data as $row) { + $i = 0; + foreach ($temp as $t_row) { + if ($row['order'] < $t_row['order']) { + break; + } + + $i++; + } + + array_splice($temp, $i, 0, array($row)); + } + + $data = $temp; + break; + case REPORT_ITEM_ORDER_BY_DESCENDING: + $temp = array(); + foreach ($data as $row) { + $i = 0; + foreach ($temp as $t_row) { + + if ($row['order'] > $t_row['order']) { + break; + } + + $i++; + } + + array_splice($temp, $i, 0, array($row)); + } + + $data = $temp; + break; } - - $count++; } - - switch ($content['order_uptodown']) { - case REPORT_ITEM_ORDER_BY_AGENT_NAME: - $temp = array(); - foreach ($data as $row) { - $i = 0; - foreach ($temp as $t_row) { - if (strcmp($row['agent'], $t_row['agent']) < 0) { - break; - } - - $i++; - } - - array_splice($temp, $i, 0, array($row)); - } - - $data = $temp; - break; - case REPORT_ITEM_ORDER_BY_ASCENDING: - $temp = array(); - foreach ($data as $row) { - $i = 0; - foreach ($temp as $t_row) { - if ($row['order'] < $t_row['order']) { - break; - } - - $i++; - } - - array_splice($temp, $i, 0, array($row)); - } - - $data = $temp; - break; - case REPORT_ITEM_ORDER_BY_DESCENDING: - $temp = array(); - foreach ($data as $row) { - $i = 0; - foreach ($temp as $t_row) { - - if ($row['order'] > $t_row['order']) { - break; - } - - $i++; - } - - array_splice($temp, $i, 0, array($row)); - } - - $data = $temp; - break; - } - - $return["data"] = $data; $return["resume"] = array(); $return["resume"]['min_text'] = $min_text; diff --git a/pandora_console/install.php b/pandora_console/install.php index 84132db572..3333a59320 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
style[0] = 'text-align:center;'; $table->data = array (); $table->data[0][0] = html_print_image("images/reporting32.png", true, array("width" => "32", "height" => "32")); -if (defined("METACONSOLE")) { - if ($report['description'] != '') { - $table->data[0][1] = '
' . __("Description: ") . $report['description'] . '
'; - } - else { - $table->data[0][1] = '
' . __("Name: ") . $report['name'] . '
'; - } - - $table->data[0][1] .= '
'.__('Set initial date') . html_print_checkbox('enable_init_date', 1, $enable_init_date, true); - $html_enterprise = enterprise_hook('reporting_print_button_PDF', array($id_report)); - if ($html_enterprise !== ENTERPRISE_NOT_HOOK) { - $table->data[0][1] .= $html_enterprise; - } - $table->data[0][1] .= '
'; - - $table->data[1][1] = '
' . __('From') . ': '; - $table->data[1][1] .= html_print_input_text ('date_init', $date_init, '', 12, 10, true). ' '; - $table->data[1][1] .= html_print_input_text ('time_init', $time_init, '', 10, 7, true). '
'; - $table->data[1][2] = '
' . __('Items period before') . ':'; - $table->data[1][2] .= html_print_input_text ('date', $date, '', 12, 10, true) . ' '; - $table->data[1][2] .= html_print_input_text ('time', $time, '', 10, 7, true) . ' '; - $table->data[1][2] .= html_print_submit_button (__('Update'), 'date_submit', false, 'class="sub next"', true) . '
'; - $table->data[1][2] .= '
' . __('to') . ':'; - $table->data[1][2] .= html_print_input_text ('date', $date, '', 12, 10, true) . ' '; - $table->data[1][2] .= html_print_input_text ('time', $time, '', 10, 7, true) . ' '; - $table->data[1][2] .= html_print_submit_button (__('Update'), 'date_submit', false, 'class="sub next"', true) . '
'; + +if (reporting_get_description($id_report)) { + $table->data[0][1] = '
' . + reporting_get_description($id_report) . '
'; } else { - if (reporting_get_description($id_report)) { - $table->data[0][1] = '
' . - reporting_get_description($id_report) . '
'; - } - else { - $table->data[0][1] = '
' . - reporting_get_name($id_report) . '
'; - } - - $table->data[0][1] .= '
'.__('Set initial date') . html_print_checkbox('enable_init_date', 1, $enable_init_date, true); - $html_enterprise = enterprise_hook('reporting_print_button_PDF', - array($id_report)); - if ($html_enterprise !== ENTERPRISE_NOT_HOOK) { - $table->data[0][1] .= $html_enterprise; - } - $table->data[0][1] .= '
'; - - $table->data[1][1] = '
' . __('From') . ':
'; - $table->data[1][1] .= html_print_input_text ('date_init', $date_init, '', 12, 10, true). ' '; - $table->data[1][1] .= html_print_input_text ('time_init', $time_init, '', 10, 7, true). ' '; - $table->data[1][2] = '
' . __('Items period before') . ':
'; - $table->data[1][2] .= '
' . __('to') . ':
'; - $table->data[1][2] .= html_print_input_text ('date', $date, '', 12, 10, true). ' '; - $table->data[1][2] .= html_print_input_text ('time', $time, '', 10, 7, true). ' '; - $table->data[1][2] .= html_print_submit_button (__('Update'), 'date_submit', false, 'class="sub next"', true); - + $table->data[0][1] = '
' . + reporting_get_name($id_report) . '
'; } +$table->data[0][1] .= '
'.__('Set initial date') . html_print_checkbox('enable_init_date', 1, $enable_init_date, true); +$html_enterprise = enterprise_hook('reporting_print_button_PDF', + array($id_report)); +if ($html_enterprise !== ENTERPRISE_NOT_HOOK) { + $table->data[0][1] .= $html_enterprise; +} +$table->data[0][1] .= '
'; + +$table->data[1][1] = '
' . __('From') . ':
'; +$table->data[1][1] .= html_print_input_text ('date_init', $date_init, '', 12, 10, true). ' '; +$table->data[1][1] .= html_print_input_text ('time_init', $time_init, '', 10, 7, true). ' '; +$table->data[1][2] = '
' . __('Items period before') . ':
'; +$table->data[1][2] .= '
' . __('to') . ':
'; +$table->data[1][2] .= html_print_input_text ('date', $date, '', 12, 10, true). ' '; +$table->data[1][2] .= html_print_input_text ('time', $time, '', 10, 7, true). ' '; +$table->data[1][2] .= html_print_submit_button (__('Update'), 'date_submit', false, 'class="sub next"', true); + echo '
'; html_print_table ($table); html_print_input_hidden ('id_report', $id_report); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index eb1782fe1b..b78a31fd8a 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 6.1dev -%define release 160125 +%define release 160126 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 050c749a1a..e22bb54940 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 6.1dev -%define release 160125 +%define release 160126 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 330a6e0bf7..5b34e9ebf9 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -65,7 +65,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5'); INSERT INTO tconfig (token, value) VALUES ('step_compact','1'); INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc'); INSERT INTO tconfig (token, value) VALUES('db_scheme_version','6.1dev'); -INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160125'); +INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160126'); INSERT INTO tconfig (token, value) VALUES ('show_unknown','0'); INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); INSERT INTO tconfig (token, value) VALUES ('style','pandora'); diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index c2944d365d..a4d1ecdcfa 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 6.1dev-160125 +Version: 6.1dev-160126 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index f4a5d40c10..78926e9594 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160125" +pandora_version="6.1dev-160126" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index c376e705ec..b9012e2bc5 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -43,7 +43,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "6.1dev"; -my $pandora_build = "160125"; +my $pandora_build = "160126"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index a832efa67b..f4059ee9a8 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 6.1dev -%define release 160125 +%define release 160126 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a9ab893a59..30231a8ebc 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 6.1dev -%define release 160125 +%define release 160126 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 62eec4a3a4..7f5de0733f 100644 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160125" +PI_BUILD="160126" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ee814993f8..5210214d61 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "6.1dev PS160125"; +my $version = "6.1dev PS160126"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2175dfdfae..a27173931e 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -35,7 +35,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "6.1dev PS160125"; +my $version = "6.1dev PS160126"; # save program name for logging my $progname = basename($0); @@ -3320,17 +3320,17 @@ sub cli_create_synthetic() { my $agent_name = @ARGV[4]; my @module_data = @ARGV[5..$#ARGV]; my $module; - my (@filterdata,@data_module,$module_data); + my (@filterdata,@data_module); if ($synthetic_type ne 'arithmetic' && $synthetic_type ne 'average') { print("[ERROR] Type of syntethic module doesn't exists \n\n"); exit 1; } - if (scalar(@{$module_data}) == 0) { + if (scalar(@{module_data}) == 0) { print("[ERROR] No modules data \n\n"); exit 1; } - if ($name_module == '') { + if ($name_module eq '') { print("[ERROR] No module name \n\n"); exit 1; } @@ -3384,7 +3384,9 @@ sub cli_create_synthetic() { $module->{'id_agente'} = $id_agent; $module->{'nombre'} = safe_input($name_module); + my $id_tipo_modulo = get_db_value ($dbh, "SELECT id_tipo FROM ttipo_modulo WHERE nombre = ?", "generic_data"); $module->{'id_modulo'} = 5; + $module->{'id_tipo_modulo'} = $id_tipo_modulo; my $id_module = db_process_insert($dbh, 'id_agente_modulo', 'tagente_modulo', $module); @@ -3395,10 +3397,12 @@ sub cli_create_synthetic() { print("[OK] The modules are creating ID: $id_module \n\n"); } else { + db_do ($dbh, 'DELETE FROM tagente_modulo WHERE id_agente_modulo = ?', $id_module); print("[ERROR] Problems with creating data module. \n\n"); } } else { + db_do ($dbh, 'DELETE FROM tagente_modulo WHERE nombre = ? AND id_agente = ?', $name_module, $id_agent); print("[INFO] Problems with creating module \n\n"); } }