Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop

This commit is contained in:
Alejandro Gallardo Escobar 2015-02-06 13:41:37 +01:00
commit f956d219f4
24 changed files with 162 additions and 147 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 6.0dev-150205 Version: 6.0dev-150206
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="6.0dev-150205" pandora_version="6.0dev-150206"
echo "Test if you has the tools for to make the packages." 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

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0dev'; use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150205'; use constant AGENT_BUILD => '150206';
# Commands to retrieve total memory information in kB # Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => { use constant TOTALMEMORY_CMDS => {

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0dev %define version 6.0dev
%define release 150205 %define release 150206
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0dev %define version 6.0dev
%define release 150205 %define release 150206
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{150205} {150206}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("6.0dev(Build 150205)") #define PANDORA_VERSION ("6.0dev(Build 150206)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(6.0dev(Build 150205))" VALUE "ProductVersion", "(6.0dev(Build 150206))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 6.0dev-150205 Version: 6.0dev-150206
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="6.0dev-150205" pandora_version="6.0dev-150206"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -69,6 +69,7 @@ function pluginreg_extension_main () {
echo "<h2 class=error>".__("Cannot load INI file")."</h2>"; echo "<h2 class=error>".__("Cannot load INI file")."</h2>";
} }
else { else {
$version = preg_replace("/.*[.]/", "", $name_file); $version = preg_replace("/.*[.]/", "", $name_file);
$exec_path = $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"]; $exec_path = $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"];
@ -114,6 +115,7 @@ function pluginreg_extension_main () {
'parameters' => $ini_array["plugin_definition"]["parameters"], 'parameters' => $ini_array["plugin_definition"]["parameters"],
'plugin_type' => $ini_array["plugin_definition"]["plugin_type"]); 'plugin_type' => $ini_array["plugin_definition"]["plugin_type"]);
switch ($version) { switch ($version) {
case 'pspz': case 'pspz':
// Fixed the static parameters // Fixed the static parameters
@ -265,130 +267,138 @@ function pluginreg_extension_main () {
$create_id = db_process_sql_insert('tplugin', $values); $create_id = db_process_sql_insert('tplugin', $values);
for ($ax = 1; $ax <= $ini_array["plugin_definition"]["total_modules_provided"]; $ax++) { if (empty($create_id)) {
$label = "module" . $ax; ui_print_error_message(
__('Plug-in Remote Registered unsuccessfull'));
$plugin_user = ""; ui_print_info_message(
if (isset($ini_array[$label]["plugin_user"])) __('Please check the syntax of file "plugin_definition.ini"'));
$plugin_user = $ini_array[$label]["plugin_user"]; }
$plugin_pass = ""; else {
if (isset($ini_array[$label]["plugin_pass"])) for ($ax = 1; $ax <= $ini_array["plugin_definition"]["total_modules_provided"]; $ax++) {
$plugin_pass = $ini_array[$label]["plugin_pass"]; $label = "module" . $ax;
$plugin_parameter = "";
if (isset($ini_array[$label]["plugin_parameter"])) $plugin_user = "";
$plugin_parameter = $ini_array[$label]["plugin_parameter"]; if (isset($ini_array[$label]["plugin_user"]))
$unit = ""; $plugin_user = $ini_array[$label]["plugin_user"];
if (isset($ini_array[$label]["unit"])) $plugin_pass = "";
$unit = $ini_array[$label]["unit"]; if (isset($ini_array[$label]["plugin_pass"]))
$plugin_pass = $ini_array[$label]["plugin_pass"];
$values = array( $plugin_parameter = "";
'name' => io_safe_input ($ini_array[$label]["name"]), if (isset($ini_array[$label]["plugin_parameter"]))
'description' => io_safe_input ($ini_array[$label]["description"]), $plugin_parameter = $ini_array[$label]["plugin_parameter"];
'id_group' => $ini_array[$label]["id_group"], $unit = "";
'type' => $ini_array[$label]["type"], if (isset($ini_array[$label]["unit"]))
'max' => isset($ini_array[$label]["max"]) ? $ini_array[$label]["max"] : '', $unit = $ini_array[$label]["unit"];
'min' => isset($ini_array[$label]["min"]) ? $ini_array[$label]["min"] : '',
'module_interval' => isset($ini_array[$label]["module_interval"]) ? $ini_array[$label]["module_interval"] : '', $values = array(
'id_module_group' => $ini_array[$label]["id_module_group"], 'name' => io_safe_input ($ini_array[$label]["name"]),
'id_modulo' => $ini_array[$label]["id_modulo"], 'description' => io_safe_input ($ini_array[$label]["description"]),
'plugin_user' => io_safe_input ($plugin_user), 'id_group' => $ini_array[$label]["id_group"],
'plugin_pass' => io_safe_input ($plugin_pass), 'type' => $ini_array[$label]["type"],
'plugin_parameter' => io_safe_input ($plugin_parameter), 'max' => isset($ini_array[$label]["max"]) ? $ini_array[$label]["max"] : '',
'unit' => io_safe_input ($unit), 'min' => isset($ini_array[$label]["min"]) ? $ini_array[$label]["min"] : '',
'max_timeout' => isset($ini_array[$label]["max_timeout"]) ? $ini_array[$label]["max_timeout"] : '', 'module_interval' => isset($ini_array[$label]["module_interval"]) ? $ini_array[$label]["module_interval"] : '',
'history_data' => isset($ini_array[$label]["history_data"]) ? $ini_array[$label]["history_data"] : '', 'id_module_group' => $ini_array[$label]["id_module_group"],
'min_warning' => isset($ini_array[$label]["min_warning"]) ? $ini_array[$label]["min_warning"] : '', 'id_modulo' => $ini_array[$label]["id_modulo"],
'max_warning' => isset($ini_array[$label]["max_warning"]) ? $ini_array[$label]["max_warning"] : '', 'plugin_user' => io_safe_input ($plugin_user),
'str_warning' => isset($ini_array[$label]["str_warning"]) ? $ini_array[$label]["str_warning"] : '', 'plugin_pass' => io_safe_input ($plugin_pass),
'min_critical' => isset($ini_array[$label]["min_critical"]) ? $ini_array[$label]["min_critical"] : '', 'plugin_parameter' => io_safe_input ($plugin_parameter),
'max_critical' => isset($ini_array[$label]["max_critical"]) ? $ini_array[$label]["max_critical"] : '', 'unit' => io_safe_input ($unit),
'str_critical' => isset($ini_array[$label]["str_critical"]) ? $ini_array[$label]["str_critical"] : '', 'max_timeout' => isset($ini_array[$label]["max_timeout"]) ? $ini_array[$label]["max_timeout"] : '',
'min_ff_event' => isset($ini_array[$label]["min_ff_event"]) ? $ini_array[$label]["min_ff_event"] : '', 'history_data' => isset($ini_array[$label]["history_data"]) ? $ini_array[$label]["history_data"] : '',
'tcp_port' => isset($ini_array[$label]["tcp_port"]) ? $ini_array[$label]["tcp_port"] : '', 'min_warning' => isset($ini_array[$label]["min_warning"]) ? $ini_array[$label]["min_warning"] : '',
'id_plugin' => $create_id); 'max_warning' => isset($ini_array[$label]["max_warning"]) ? $ini_array[$label]["max_warning"] : '',
'str_warning' => isset($ini_array[$label]["str_warning"]) ? $ini_array[$label]["str_warning"] : '',
$macros_component = $macros; 'min_critical' => isset($ini_array[$label]["min_critical"]) ? $ini_array[$label]["min_critical"] : '',
'max_critical' => isset($ini_array[$label]["max_critical"]) ? $ini_array[$label]["max_critical"] : '',
switch ($version) { 'str_critical' => isset($ini_array[$label]["str_critical"]) ? $ini_array[$label]["str_critical"] : '',
case 'pspz': 'min_ff_event' => isset($ini_array[$label]["min_ff_event"]) ? $ini_array[$label]["min_ff_event"] : '',
// Fixed the static parameters 'tcp_port' => isset($ini_array[$label]["tcp_port"]) ? $ini_array[$label]["tcp_port"] : '',
// for 'id_plugin' => $create_id);
// the dinamic parameters of pandoras 5
$macros_component = $macros;
foreach ($macros_component as $key => $macro) {
if ($macro['desc'] == 'Target IP from net') { switch ($version) {
if (!empty($values['ip_target'])) { case 'pspz':
$macros_component[$key]['value'] = // Fixed the static parameters
io_safe_input($values['ip_target']); // for
} // the dinamic parameters of pandoras 5
}
if ($macro['desc'] == 'Target IP') { foreach ($macros_component as $key => $macro) {
if (!empty($values['ip_target'])) { if ($macro['desc'] == 'Target IP from net') {
$macros_component[$key]['value'] = if (!empty($values['ip_target'])) {
io_safe_input($values['ip_target']); $macros_component[$key]['value'] =
} io_safe_input($values['ip_target']);
} }
else if ($macro['desc'] == 'Port from net') { }
if (!empty($values['tcp_port'])) { if ($macro['desc'] == 'Target IP') {
$macros_component[$key]['value'] = if (!empty($values['ip_target'])) {
io_safe_input($values['tcp_port']); $macros_component[$key]['value'] =
} io_safe_input($values['ip_target']);
} }
else if ($macro['desc'] == 'Port') { }
if (!empty($values['tcp_port'])) { else if ($macro['desc'] == 'Port from net') {
$macros_component[$key]['value'] = if (!empty($values['tcp_port'])) {
io_safe_input($values['tcp_port']); $macros_component[$key]['value'] =
} io_safe_input($values['tcp_port']);
} }
else if ($macro['desc'] == 'Username') { }
if (!empty($values['plugin_user'])) { else if ($macro['desc'] == 'Port') {
$macros_component[$key]['value'] = if (!empty($values['tcp_port'])) {
io_safe_input($values['plugin_user']); $macros_component[$key]['value'] =
} io_safe_input($values['tcp_port']);
} }
else if ($macro['desc'] == 'Password') { }
if (!empty($values['plugin_pass'])) { else if ($macro['desc'] == 'Username') {
$macros_component[$key]['value'] = if (!empty($values['plugin_user'])) {
io_safe_input($values['plugin_pass']); $macros_component[$key]['value'] =
} io_safe_input($values['plugin_user']);
} }
else if ($macro['desc'] == 'Plug-in Parameters') { }
if (!empty($values['plugin_parameter'])) { else if ($macro['desc'] == 'Password') {
$macros_component[$key]['value'] = if (!empty($values['plugin_pass'])) {
io_safe_input($values['plugin_parameter']); $macros_component[$key]['value'] =
} io_safe_input($values['plugin_pass']);
} }
} }
break; else if ($macro['desc'] == 'Plug-in Parameters') {
case 'pspz2': if (!empty($values['plugin_parameter'])) {
if ($total_macros > 0) { $macros_component[$key]['value'] =
for ($it_macros = 1; $it_macros <= $total_macros; $it_macros++) { io_safe_input($values['plugin_parameter']);
$macro = "macro_" . $it_macros . "_value"; }
}
// Set the value or use the default }
if (isset($ini_array[$label][$macro])) { break;
$macros_component[(string)$it_macros]['value'] = case 'pspz2':
io_safe_input($ini_array[$label][$macro]); if ($total_macros > 0) {
} for ($it_macros = 1; $it_macros <= $total_macros; $it_macros++) {
} $macro = "macro_" . $it_macros . "_value";
}
break; // Set the value or use the default
} if (isset($ini_array[$label][$macro])) {
$macros_component[(string)$it_macros]['value'] =
if (!empty($macros_component)) { io_safe_input($ini_array[$label][$macro]);
$values['macros'] = json_encode($macros_component); }
} }
}
db_process_sql_insert('tnetwork_component', $values); break;
}
echo "<h3 class=suc>" .
__("Module plugin registered") . " : " . $ini_array[$label]["name"] . if (!empty($macros_component)) {
"</h3>"; $values['macros'] = json_encode($macros_component);
}
db_process_sql_insert('tnetwork_component', $values);
echo "<h3 class=suc>" .
__("Module plugin registered") . " : " . $ini_array[$label]["name"] .
"</h3>";
}
echo "<h2 class=suc>" .
__("Plugin") . " " . $ini_array["plugin_definition"]["name"] . " " . __("Registered successfully") .
"</h2>";
} }
echo "<h2 class=suc>" .
__("Plugin") . " " . $ini_array["plugin_definition"]["name"] . " " . __("Registered successfully") .
"</h2>";
unlink ($config["attachment_store"] . "/plugin_definition.ini"); unlink ($config["attachment_store"] . "/plugin_definition.ini");
} }
} }

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC150205'; $build_version = 'PC150206';
$pandora_version = 'v6.0dev'; $pandora_version = 'v6.0dev';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -1525,6 +1525,8 @@ function agents_get_addresses ($id_agent) {
* return -1 if the data are wrong * return -1 if the data are wrong
*/ */
function agents_get_status_from_counts($agent) { function agents_get_status_from_counts($agent) {
// Check if in the data there are all the necessary values // Check if in the data there are all the necessary values
if (!isset($agent['normal_count']) && if (!isset($agent['normal_count']) &&
!isset($agent['warning_count']) && !isset($agent['warning_count']) &&
@ -1534,11 +1536,11 @@ function agents_get_status_from_counts($agent) {
!isset($agent['total_count'])) { !isset($agent['total_count'])) {
return -1; return -1;
} }
# Juanma (05/05/2014) Fix: This status is not init! 0 modules or all not init # Juanma (05/05/2014) Fix: This status is not init! 0 modules or all not init
if ($agent['notinit_count'] == $agent['total_count']) { if ($agent['notinit_count'] == $agent['total_count']) {
return AGENT_MODULE_STATUS_NOT_INIT; return AGENT_MODULE_STATUS_NOT_INIT;
} }
if ($agent['critical_count'] > 0) { if ($agent['critical_count'] > 0) {
return AGENT_MODULE_STATUS_CRITICAL_BAD; return AGENT_MODULE_STATUS_CRITICAL_BAD;
} }
@ -1551,6 +1553,9 @@ function agents_get_status_from_counts($agent) {
else if ($agent['normal_count'] == $agent['total_count']) { else if ($agent['normal_count'] == $agent['total_count']) {
return AGENT_MODULE_STATUS_NORMAL; return AGENT_MODULE_STATUS_NORMAL;
} }
else if ($agent['normal_count'] + $agent['notinit_count'] == $agent['total_count']) {
return AGENT_MODULE_STATUS_NORMAL;
}
//~ else if($agent['notinit_count'] == $agent['total_count']) { //~ else if($agent['notinit_count'] == $agent['total_count']) {
//~ return AGENT_MODULE_STATUS_NORMAL; //~ return AGENT_MODULE_STATUS_NORMAL;
//~ } //~ }

View File

@ -63,7 +63,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '6.0dev'; $version = '6.0dev';
$build = '150205'; $build = '150206';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150205 %define release 150206
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150205 %define release 150206
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('graph_res','5'), ('graph_res','5'),
('step_compact','1'), ('step_compact','1'),
('db_scheme_version','6.0dev'), ('db_scheme_version','6.0dev'),
('db_scheme_build','PD150205'), ('db_scheme_build','PD150206'),
('show_unknown','0'), ('show_unknown','0'),
('show_lastalerts','1'), ('show_lastalerts','1'),
('style','pandora'), ('style','pandora'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 6.0dev-150205 Version: 6.0dev-150206
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="6.0dev-150205" pandora_version="6.0dev-150206"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "6.0dev"; my $pandora_version = "6.0dev";
my $pandora_build = "150205"; my $pandora_build = "150206";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0dev %define version 6.0dev
%define release 150205 %define release 150206
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0dev %define version 6.0dev
%define release 150205 %define release 150206
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "6.0dev PS150205"; my $version = "6.0dev PS150206";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -34,7 +34,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "6.0dev PS150205"; my $version = "6.0dev PS150206";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);