This commit is contained in:
cesar991 2016-08-26 13:42:16 +02:00
commit 4d0664e4a6
27 changed files with 106 additions and 49 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 6.1dev-160825 Version: 6.1dev-160826
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.1dev-160825" pandora_version="6.1dev-160826"
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.1dev'; use constant AGENT_VERSION => '6.1dev';
use constant AGENT_BUILD => '160825'; use constant AGENT_BUILD => '160826';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.1dev %define version 6.1dev
%define release 160825 %define release 160826
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.1dev %define version 6.1dev
%define release 160825 %define release 160826
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="6.1dev" PI_VERSION="6.1dev"
PI_BUILD="160825" PI_BUILD="160826"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{160825} {160826}
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.1dev(Build 160825)") #define PANDORA_VERSION ("6.1dev(Build 160826)")
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.1dev(Build 160825))" VALUE "ProductVersion", "(6.1dev(Build 160826))"
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.1dev-160825 Version: 6.1dev-160826
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.1dev-160825" pandora_version="6.1dev-160826"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -20,6 +20,7 @@ check_login ();
$table = new StdClass(); $table = new StdClass();
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->id = 'setup_general';
$table->width = '100%'; $table->width = '100%';
$table->data = array (); $table->data = array ();
$table->size = array(); $table->size = array();
@ -74,6 +75,14 @@ $table->data[11][0] = __('Enforce https');
$table->data[11][1] = __('Yes').'   '.html_print_radio_button_extended ('https', 1, '', $config["https"], false, "if (! confirm ('" . __('If SSL is not properly configured you will lose access to Pandora FMS Console. Do you want to continue?') . "')) return false", '', true) .'  '; $table->data[11][1] = __('Yes').'   '.html_print_radio_button_extended ('https', 1, '', $config["https"], false, "if (! confirm ('" . __('If SSL is not properly configured you will lose access to Pandora FMS Console. Do you want to continue?') . "')) return false", '', true) .'  ';
$table->data[11][1] .= __('No').'   '.html_print_radio_button ('https', 0, '', $config["https"], true); $table->data[11][1] .= __('No').'   '.html_print_radio_button ('https', 0, '', $config["https"], true);
$table->data[12][0] = __('Use cert of SSL');
$table->data[12][1] = __('Yes').'   '.html_print_radio_button_extended ('use_cert', 1, '', $config["use_cert"], false, '', '', true) .'  ';
$table->data[12][1] .= __('No').'   '.html_print_radio_button ('use_cert', 0, '', $config["use_cert"], true);
$table->rowstyle[13] = 'display: none;';
$table->data[13][0] = __('Path of SSL Cert.') . ui_print_help_tip (__("Path where you put your cert and name of this cert. Remember your cert only in .pem extension."), true);
$table->data[13][1] = html_print_input_text ('cert_path', io_safe_output($config["cert_path"]), '', 50, 255, true);
$table->data[14][0] = __('Attachment store') . ui_print_help_tip (__("Directory where temporary data is stored."), true); $table->data[14][0] = __('Attachment store') . ui_print_help_tip (__("Directory where temporary data is stored."), true);
$table->data[14][1] = html_print_input_text ('attachment_store', io_safe_output($config["attachment_store"]), '', 50, 255, true); $table->data[14][1] = html_print_input_text ('attachment_store', io_safe_output($config["attachment_store"]), '', 50, 255, true);
@ -285,7 +294,6 @@ $table->data[36][0] = __('audit log directory') .
ui_print_help_tip (__("Directory where audit log is stored."), true); ui_print_help_tip (__("Directory where audit log is stored."), true);
$table->data[36][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true); $table->data[36][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">'; echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo "<fieldset>"; echo "<fieldset>";
@ -358,6 +366,16 @@ $(document).ready (function () {
$("#zone").attr("hidden", false); $("#zone").attr("hidden", false);
$("#timezone").attr("hidden", false); $("#timezone").attr("hidden", false);
}); });
$("input[name=use_cert]").change(function () {
if( $(this).is(":checked") ){
var val = $(this).val();
if (val == 1) {
$('#setup_general-13').show();
}
else
$('#setup_general-13').hide();
}
});
}); });
</script> </script>
<?php <?php

View File

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

View File

@ -8890,29 +8890,55 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4) {
'', false, false, true, time(), '', 0, 0, true, true, '', false, false, true, time(), '', 0, 0, true, true,
ui_get_full_url(false) . '/', 1, false, '', false, true); ui_get_full_url(false) . '/', 1, false, '', false, true);
$graph_image_file_encoded = false; $graph_image_file_encoded = false;
if (preg_match("/<img src='(.+)'./", $graph_html, $matches)) {
// Get the src of the html item $file_url = $matches[1];
if (preg_match("/<img src='(.+)'.*/", $graph_html, $matches)) {
if (isset($matches) && isset($matches[1])) { if (preg_match("/\?(.+)&(.+)&(.+)&(.+)/", $file_url,$parameters)) {
$file_url = $matches[1]; array_shift ($parameters);
// Get the file foreach ($parameters as $parameter){
$graph_image_file = file_get_contents($file_url); $value = explode ("=",$parameter);
if ($graph_image_file !== false) { if (strcmp($value[0], "static_graph") == 0){
// Encode the file $static_graph = $value[1];
$graph_image_file_encoded = base64_encode($graph_image_file); }
unset($graph_image_file); elseif (strcmp($value[0], "graph_type") == 0){
} $graph_type = $value[1];
} }
} elseif (strcmp($value[0], "ttl") == 0){
$ttl = $value[1];
if (empty($graph_image_file_encoded)) { }
// returnError('error_module_graph', __('')); elseif (strcmp($value[0], "id_graph") == 0){
} $id_graph = $value[1];
else { }
returnData('string', array('type' => 'string', 'data' => $graph_image_file_encoded)); }
} }
}
// Check values are OK
if ( (isset ($graph_type))
&& (isset ($ttl))
&& (isset ($id_graph))) {
$_GET["ttl"] = $ttl;
$_GET["id_graph"] = $id_graph;
$_GET["graph_type"] = $graph_type;
$_GET["static_graph"] = $static_graph;
}
ob_start();
include (__DIR__ . "/graphs/functions_pchart.php");
$output = ob_get_clean();
$graph_image_file_encoded = base64_encode($output);
if (empty($graph_image_file_encoded)) {
// returnError('error_module_graph', __(''));
}
else {
header('Content-type: text/html');
returnData('string', array('type' => 'string', 'data' => '<img src="data:image/jpeg;base64,' . $graph_image_file_encoded . '">'));
// To show only the base64 code, call returnData as:
// returnData('string', array('type' => 'string', 'data' => $graph_image_file_encoded));
}
} }
?> ?>

View File

@ -141,8 +141,12 @@ function config_update_config () {
$error_update[] = __('Time source'); $error_update[] = __('Time source');
if (!config_update_value ('autoupdate', (bool) get_parameter ('autoupdate'))) if (!config_update_value ('autoupdate', (bool) get_parameter ('autoupdate')))
$error_update[] = __('Automatic check for updates'); $error_update[] = __('Automatic check for updates');
if (!config_update_value ('cert_path', (bool) get_parameter ('cert_path')))
$error_update[] = __('SSL cert path');
if (!config_update_value ('https', (bool) get_parameter ('https'))) if (!config_update_value ('https', (bool) get_parameter ('https')))
$error_update[] = __('Enforce https'); $error_update[] = __('Enforce https');
if (!config_update_value ('use_cert', (bool) get_parameter ('use_cert')))
$error_update[] = __('Use cert.');
if (!config_update_value ('attachment_store', (string) get_parameter ('attachment_store'))) if (!config_update_value ('attachment_store', (string) get_parameter ('attachment_store')))
$error_update[] = __('Attachment store'); $error_update[] = __('Attachment store');
if (!config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'))) if (!config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API')))
@ -769,6 +773,14 @@ function config_process_config () {
// potentially unexisting config by default // potentially unexisting config by default
config_update_value ('https', false); config_update_value ('https', false);
} }
if (!isset ($config["use_cert"])) {
config_update_value ('use_cert', false);
}
if (!isset ($config['cert_path'])) {
// Sets name and path of ssl path for use in application
config_update_value ('cert_path', '/etc/ssl/certs/pandorafms.pem');
}
if (!isset ($config["num_files_attachment"])) { if (!isset ($config["num_files_attachment"])) {
config_update_value ('num_files_attachment', 100); config_update_value ('num_files_attachment', 100);
@ -981,8 +993,9 @@ function config_process_config () {
if (!isset ($config['fontpath'])) { if (!isset ($config['fontpath'])) {
$home = str_replace('\\', '/', $config['homedir'] );
config_update_value('fontpath', config_update_value('fontpath',
$config['homedir'] . '/include/fonts/smallfont.ttf'); $home . '/include/fonts/smallfont.ttf');
} }
if (!isset ($config['style'])) { if (!isset ($config['style'])) {

View File

@ -71,7 +71,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '6.1dev'; $version = '6.1dev';
$build = '160825'; $build = '160826';
$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.1dev %define version 6.1dev
%define release 160825 %define release 160826
# 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.1dev %define version 6.1dev
%define release 160825 %define release 160826
%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

@ -66,7 +66,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 ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc'); 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_version','6.1dev');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160825'); INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160826');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0'); INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora'); INSERT INTO tconfig (token, value) VALUES ('style','pandora');

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 6.1dev-160825 Version: 6.1dev-160826
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.1dev-160825" pandora_version="6.1dev-160826"
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.1dev"; my $pandora_version = "6.1dev";
my $pandora_build = "160825"; my $pandora_build = "160826";
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.1dev %define version 6.1dev
%define release 160825 %define release 160826
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.1dev %define version 6.1dev
%define release 160825 %define release 160826
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="6.1dev" PI_VERSION="6.1dev"
PI_BUILD="160825" PI_BUILD="160826"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

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.1dev PS160825"; my $version = "6.1dev PS160826";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "6.1dev PS160825"; my $version = "6.1dev PS160826";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);