Merge remote-tracking branch 'origin/develop' into ent-5408-consola-visual-nueva-bugs
This commit is contained in:
commit
6ccc606c74
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.743-200218
|
||||
Version: 7.0NG.743-200220
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.743-200218"
|
||||
pandora_version="7.0NG.743-200220"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -55,7 +55,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.743';
|
||||
use constant AGENT_BUILD => '200218';
|
||||
use constant AGENT_BUILD => '200220';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -183,6 +183,7 @@ my %DefaultConf = (
|
|||
'secondary_server_pwd' => '',
|
||||
'secondary_server_ssl' => '0',
|
||||
'secondary_server_opts' => '',
|
||||
'secondary_temporal' => '/var/spool/pandora',
|
||||
'autotime' => 0,
|
||||
'temporal_min_size' => 1,
|
||||
'timezone_offset' => 0,
|
||||
|
@ -1058,6 +1059,16 @@ sub read_config (;$) {
|
|||
$Conf{'secondary_server_opts'} = '-c ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_ssl'} eq '1');
|
||||
}
|
||||
|
||||
# Set up the primary and secondary temporary directories.
|
||||
if ($Conf{'secondary_mode'} eq 'always') {
|
||||
$Conf{'secondary_temporal'} = $Conf{'temporal'} . '/pandorafms.secondary';
|
||||
if (! -d $Conf{'secondary_temporal'}) {
|
||||
mkdir($Conf{'secondary_temporal'}) || die("Error creating the secondary temporary directory $!");
|
||||
}
|
||||
} elsif ($Conf{'secondary_mode'} eq "on_error") {
|
||||
$Conf{'secondary_temporal'} = $Conf{'temporal'};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
|
@ -1077,7 +1088,7 @@ sub fix_directory ($) {
|
|||
# Sends a file to the server.
|
||||
################################################################################
|
||||
sub send_file {
|
||||
my ($file, $secondary, $rc_primary, $flag_always, $relative) = @_;
|
||||
my ($file, $relative) = @_;
|
||||
|
||||
my $output;
|
||||
my $pid = fork();
|
||||
|
@ -1131,109 +1142,83 @@ sub send_file {
|
|||
waitpid ($pid, 0);
|
||||
my $rc = $? >> 8;
|
||||
|
||||
if( ($Conf{'secondary_mode'} eq 'always') && ( !defined($flag_always) ) ){
|
||||
# Send the file to the secondary server
|
||||
return $rc unless ($Conf{'secondary_mode'} eq 'always');
|
||||
|
||||
if(defined ($secondary)){
|
||||
if( ($rc != 0 && ($file =~ /\.data/)) ){
|
||||
$rc_primary = 1;
|
||||
return $rc
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Send buffered XML files.
|
||||
################################################################################
|
||||
sub send_xml_file ($) {
|
||||
my ($file) = @_;
|
||||
|
||||
my $rc = send_file($file);
|
||||
if ($rc != 0 && $Conf{'secondary_mode'} eq "on_error") {
|
||||
swap_servers();
|
||||
$rc = send_file ($file, undef, $rc_primary, undef, $relative);
|
||||
$rc = send_file($file);
|
||||
swap_servers();
|
||||
}
|
||||
elsif ($Conf{'secondary_mode'} eq "always") {
|
||||
swap_servers();
|
||||
my $rc_sec = send_file($file);
|
||||
swap_servers();
|
||||
|
||||
return $rc;
|
||||
# Secondary buffer.
|
||||
if ($rc_sec != 0 && $Conf{'xml_buffer'} == 1 && temporal_freedisk () > $Conf{'temporal_min_size'}) {
|
||||
copy($file, $Conf{'secondary_temporal'}) || die("Error copying file $file to " . $Conf{'secondary_temporal'} . ": $!");
|
||||
}
|
||||
else{
|
||||
my $rc_secondary = 0;
|
||||
if( ($rc != 0) && ($file =~ /\.data/)){
|
||||
$rc_secondary = 1;
|
||||
}
|
||||
|
||||
if ( $rc_secondary == 1 && defined($rc_primary) ){
|
||||
return 1;
|
||||
# Primary buffer.
|
||||
if ($rc == 0 || $Conf{'xml_buffer'} == 0 || temporal_freedisk () <= $Conf{'temporal_min_size'}) {
|
||||
if ($Conf{'debug'} eq '1') {
|
||||
rename($file, $file . "sent");
|
||||
} else {
|
||||
unlink ($file);
|
||||
}
|
||||
|
||||
if ( $rc_secondary == 1 ){
|
||||
if (! -d "$Conf{'temporal'}/secondary"){
|
||||
mkdir "$Conf{'temporal'}/secondary";
|
||||
}
|
||||
eval {
|
||||
copy("$file", "$Conf{'temporal'}/secondary/");
|
||||
};
|
||||
if ($@) {
|
||||
# We shouldn't reach this point...
|
||||
die ("Cannot write on $Conf{'temporal'}/secondary/");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( defined($rc_primary) ){
|
||||
if (! -d "$Conf{'temporal'}/primary"){
|
||||
mkdir "$Conf{'temporal'}/primary";
|
||||
}
|
||||
eval {
|
||||
copy("$file", "$Conf{'temporal'}/primary/");
|
||||
};
|
||||
if ($@) {
|
||||
# We shouldn't reach this point...
|
||||
die ("Cannot write on $Conf{'temporal'}/primary/");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( $rc_secondary == 0 && !defined($rc_primary) ){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ( ($Conf{'secondary_mode'} eq 'always') && defined($flag_always) ){
|
||||
return $rc;
|
||||
}
|
||||
else{
|
||||
return $rc unless (defined ($secondary));
|
||||
|
||||
# Send the file to the secondary server
|
||||
return $rc unless ($Conf{'secondary_mode'} eq 'always' || ($Conf{'secondary_mode'} eq 'on_error' && $rc != 0));
|
||||
|
||||
swap_servers ();
|
||||
$rc = send_file ($file, undef, undef, undef, $relative);
|
||||
swap_servers ();
|
||||
return $rc;
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Send buffered XML files.
|
||||
################################################################################
|
||||
sub send_buffered_xml_files ($;$) {
|
||||
my ($temporal_file, $flag_always) = @_;
|
||||
sub send_buffered_xml_files () {
|
||||
my $temp_fh;
|
||||
|
||||
# Read XML files from the temporal directory
|
||||
opendir(TEMPORAL, $temporal_file) or return;
|
||||
if (defined($flag_always) && ($flag_always == 2)){
|
||||
swap_servers ();
|
||||
}
|
||||
while (my $xml_file = readdir(TEMPORAL)) {
|
||||
opendir($temp_fh, $Conf{'temporal'}) or return;
|
||||
while (my $xml_file = readdir($temp_fh)) {
|
||||
# Skip non data files and symlinks
|
||||
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$temporal_file/$xml_file");
|
||||
my $rc = send_file ("$temporal_file/$xml_file", 1, undef, $flag_always);
|
||||
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$Conf{'temporal'}/$xml_file");
|
||||
my $rc = send_file ("$Conf{'temporal'}/$xml_file");
|
||||
if ($rc == 0) {
|
||||
if ($Conf{'debug'} eq '1') {
|
||||
rename "$temporal_file/$xml_file", "$temporal_file/$xml_file". "sent";
|
||||
rename("$Conf{'temporal'}/$xml_file", "$Conf{'temporal'}/$xml_file". "sent");
|
||||
} else {
|
||||
unlink ("$temporal_file/$xml_file");
|
||||
unlink ("$Conf{'temporal'}/$xml_file");
|
||||
}
|
||||
}
|
||||
# Do not get stuck trying to send buffered XML files to a secondary server.
|
||||
elsif ($flag_always == 2) {
|
||||
} else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
if (defined($flag_always) && ($flag_always == 2)){
|
||||
closedir($temp_fh);
|
||||
|
||||
# Read XML files from the secondary temporal directory
|
||||
return unless ($Conf{'secondary_mode'} ne "never");
|
||||
opendir($temp_fh, $Conf{'secondary_temporal'}) or return;
|
||||
swap_servers ();
|
||||
while (my $xml_file = readdir($temp_fh)) {
|
||||
# Skip non data files and symlinks
|
||||
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$Conf{'secondary_temporal'}/$xml_file");
|
||||
my $rc = send_file ("$Conf{'secondary_temporal'}/$xml_file");
|
||||
if ($rc == 0) {
|
||||
unlink ("$Conf{'secondary_temporal'}/$xml_file") ;
|
||||
} else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
swap_servers ();
|
||||
closedir($temp_fh);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Swap primary and secondary servers.
|
||||
|
@ -1341,8 +1326,8 @@ sub check_remote_config () {
|
|||
chown ($uid, $gid, "$Conf{'temporal'}/$RemoteMD5File");
|
||||
chown ($uid, $gid, "$Conf{'temporal'}/$RemoteConfFile");
|
||||
}
|
||||
send_file ("$Conf{'temporal'}/$RemoteConfFile", undef, undef, undef, $Conf{'server_path_conf'});
|
||||
send_file ("$Conf{'temporal'}/$RemoteMD5File", undef, undef, undef, $Conf{'server_path_md5'});
|
||||
send_file ("$Conf{'temporal'}/$RemoteConfFile", $Conf{'server_path_conf'});
|
||||
send_file ("$Conf{'temporal'}/$RemoteMD5File", $Conf{'server_path_md5'});
|
||||
unlink ("$Conf{'temporal'}/$RemoteConfFile");
|
||||
unlink ("$Conf{'temporal'}/$RemoteMD5File");
|
||||
return;
|
||||
|
@ -3710,31 +3695,11 @@ while (1) {
|
|||
}
|
||||
|
||||
# Send the XML data file
|
||||
my $rc = send_file ($temp_file, 1);
|
||||
if ($rc == 0 || $Conf{'xml_buffer'} == 0 || temporal_freedisk () < $Conf{'temporal_min_size'}) {
|
||||
if ($Conf{'debug'} eq '1') {
|
||||
rename $temp_file, $temp_file . "sent";
|
||||
} else {
|
||||
unlink ($temp_file);
|
||||
}
|
||||
}
|
||||
send_xml_file ($temp_file);
|
||||
|
||||
# Send buffered XML data files
|
||||
if ($Conf{'xml_buffer'} == 1) {
|
||||
if($Conf{'secondary_mode'} eq 'always'){
|
||||
$Conf{'__temporal_primary'} = "$Conf{'temporal'}/primary";
|
||||
$Conf{'__temporal_secondary'} = "$Conf{'temporal'}/secondary";
|
||||
if (-d "$Conf{'__temporal_primary'}"){
|
||||
send_buffered_xml_files ($Conf{'__temporal_primary'}, 1);
|
||||
}
|
||||
if (-d "$Conf{'__temporal_secondary'}"){
|
||||
send_buffered_xml_files ($Conf{'__temporal_secondary'}, 2);
|
||||
}
|
||||
send_buffered_xml_files ($Conf{'temporal'});
|
||||
}
|
||||
else{
|
||||
send_buffered_xml_files ($Conf{'temporal'});
|
||||
}
|
||||
send_buffered_xml_files ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.743
|
||||
%define release 200218
|
||||
%define release 200220
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.743
|
||||
%define release 200218
|
||||
%define release 200220
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.743"
|
||||
PI_BUILD="200218"
|
||||
PI_BUILD="200220"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{200218}
|
||||
{200220}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -31,6 +31,24 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* Checks if a directory exists.
|
||||
*
|
||||
* @param dirpath Path of the directory to check.
|
||||
*
|
||||
* @retval True if the directory exists.
|
||||
**/
|
||||
bool
|
||||
Pandora_File::dirExists (const string dirpath) {
|
||||
struct stat info;
|
||||
|
||||
if (stat(dirpath.c_str(), &info) == 0 && (info.st_mode & S_IFDIR)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a file exists.
|
||||
*
|
||||
|
|
|
@ -51,6 +51,7 @@ namespace Pandora_File {
|
|||
class Delete_Error : Pandora_File::File_Exception {
|
||||
};
|
||||
|
||||
bool dirExists (const string dirpath);
|
||||
bool fileExists (const string filename);
|
||||
int readFile (const string filepath, string &result);
|
||||
int readBinFile (const string filepath, char **buffer);
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.743(Build 200218)")
|
||||
#define PANDORA_VERSION ("7.0NG.743(Build 200220)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace Pandora;
|
||||
using namespace Pandora_File;
|
||||
using namespace Pandora_Modules;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
|
@ -251,6 +252,22 @@ Pandora_Windows_Service::pandora_init (bool reload_modules) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Set up the secondary buffer. */
|
||||
if (conf->getValue ("secondary_mode") == "always") {
|
||||
string secondary_temporal = conf->getValue("temporal");
|
||||
if (secondary_temporal[secondary_temporal.length () - 1] != '\\') {
|
||||
secondary_temporal += "\\";
|
||||
}
|
||||
secondary_temporal += SECONDARY_DIR;
|
||||
if (!dirExists(secondary_temporal) && mkdir (secondary_temporal.c_str()) != 0) {
|
||||
pandoraLog ("Pandora_Windows_Service::pandora_init: Can not create directory %s", secondary_temporal.c_str());
|
||||
}
|
||||
conf->setValue("secondary_temporal", secondary_temporal);
|
||||
}
|
||||
else if (conf->getValue ("secondary_mode") == "on_error") {
|
||||
conf->setValue("secondary_temporal", conf->getValue("temporal"));
|
||||
}
|
||||
|
||||
// Set the intensive interval
|
||||
if (intensive_interval != "") {
|
||||
try {
|
||||
|
@ -980,7 +997,7 @@ Pandora_Windows_Service::copyFtpDataFile (string host,
|
|||
}
|
||||
|
||||
int
|
||||
Pandora_Windows_Service::copyDataFile (string filename)
|
||||
Pandora_Windows_Service::copyDataFile (string filename, bool secondary_buffer)
|
||||
{
|
||||
int rc = 0, timeout;
|
||||
unsigned char copy_to_secondary = 0;
|
||||
|
@ -1020,19 +1037,18 @@ Pandora_Windows_Service::copyDataFile (string filename)
|
|||
|
||||
if (rc == 0) {
|
||||
pandoraDebug ("Successfuly copied XML file to server.");
|
||||
} else if (conf->getValue ("secondary_mode") == "on_error") {
|
||||
copy_to_secondary = 1;
|
||||
}
|
||||
|
||||
if (conf->getValue ("secondary_mode") == "always") {
|
||||
copy_to_secondary = 1;
|
||||
}
|
||||
|
||||
// Exit unless we have to send the file to a secondary server
|
||||
if (copy_to_secondary == 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
Pandora_Windows_Service::copyToSecondary (string filename, bool secondary_buffer)
|
||||
{
|
||||
int rc = 0, timeout;
|
||||
unsigned char copy_to_secondary = 0;
|
||||
string mode, host, remote_path;
|
||||
|
||||
// Read secondary server configuration
|
||||
mode = conf->getValue ("secondary_transfer_mode");
|
||||
host = conf->getValue ("secondary_server_ip");
|
||||
|
@ -1042,6 +1058,12 @@ Pandora_Windows_Service::copyDataFile (string filename)
|
|||
timeout = 30;
|
||||
}
|
||||
|
||||
// Adjust the path for the secondary buffer.
|
||||
if (secondary_buffer) {
|
||||
filename.insert(0, "\\");
|
||||
filename.insert(0, SECONDARY_DIR);
|
||||
}
|
||||
|
||||
// Fix remote path
|
||||
if (mode != "local" && remote_path[remote_path.length () - 1] != '/') {
|
||||
remote_path += "/";
|
||||
|
@ -1061,7 +1083,7 @@ Pandora_Windows_Service::copyDataFile (string filename)
|
|||
} else {
|
||||
rc = PANDORA_EXCEPTION;
|
||||
pandoraLog ("Invalid transfer mode: %s."
|
||||
"Please recheck transfer_mode option "
|
||||
"Please recheck secondary_transfer_mode option "
|
||||
"in configuration file.");
|
||||
}
|
||||
|
||||
|
@ -1671,10 +1693,11 @@ Pandora_Windows_Service::checkConfig (string file) {
|
|||
|
||||
int
|
||||
Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
|
||||
int rc = 0, xml_buffer;
|
||||
int rc = 0, rc_sec = 0, xml_buffer;
|
||||
string data_xml;
|
||||
string xml_filename, random_integer;
|
||||
string tmp_filename, tmp_filepath;
|
||||
string secondary_filename, secondary_filepath;
|
||||
string encoding;
|
||||
string ehorus_conf, eh_key;
|
||||
static HANDLE mutex = 0;
|
||||
|
@ -1779,8 +1802,19 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
|
|||
|
||||
/* Allways reports to Data Server*/
|
||||
rc = this->copyDataFile (tmp_filename);
|
||||
if (rc != 0 && conf->getValue("secondary_mode") == "on_error") {
|
||||
rc = this->copyToSecondary (tmp_filename, false);
|
||||
} else if (conf->getValue("secondary_mode") == "always") {
|
||||
rc_sec = this->copyToSecondary (tmp_filename, false);
|
||||
|
||||
/* Delete the file if successfully copied, buffer disabled or not enough space available */
|
||||
/* Secondary buffer. */
|
||||
if (rc_sec != 0 && xml_buffer == 1 && (GetDiskFreeSpaceEx (conf->getValue ("secondary_temporal").c_str (), &free_bytes, NULL, NULL) != 0 && free_bytes.QuadPart >= min_free_bytes)) {
|
||||
secondary_filepath = conf->getValue ("secondary_temporal") + "\\" + tmp_filename;
|
||||
CopyFile (tmp_filepath.c_str(), secondary_filepath.c_str(), false);
|
||||
}
|
||||
}
|
||||
|
||||
/* Primary buffer. Delete the file if successfully copied, buffer disabled or not enough space available. */
|
||||
if (rc == 0 || xml_buffer == 0 || (GetDiskFreeSpaceEx (tmp_filepath.c_str (), &free_bytes, NULL, NULL) != 0 && free_bytes.QuadPart < min_free_bytes)) {
|
||||
/* Rename the file if debug mode is enabled*/
|
||||
if (getPandoraDebug ()) {
|
||||
|
@ -1793,18 +1827,28 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
|
|||
|
||||
/* Send any buffered data files */
|
||||
if (xml_buffer == 1) {
|
||||
this->sendBufferedXml (conf->getValue ("temporal"));
|
||||
this->sendBufferedXml (conf->getValue ("temporal"), &Pandora_Windows_Service::copyDataFile, false);
|
||||
if (conf->getValue ("secondary_mode") == "always") {
|
||||
this->sendBufferedXml (conf->getValue ("secondary_temporal"), &Pandora_Windows_Service::copyToSecondary, true);
|
||||
} else {
|
||||
this->sendBufferedXml (conf->getValue ("temporal"), &Pandora_Windows_Service::copyToSecondary, false);
|
||||
}
|
||||
}
|
||||
|
||||
ReleaseMutex (mutex);
|
||||
}
|
||||
|
||||
void
|
||||
Pandora_Windows_Service::sendBufferedXml (string path) {
|
||||
Pandora_Windows_Service::sendBufferedXml (string path, copy_func_p copy_func, bool secondary_buffer) {
|
||||
string base_path = path, file_path;
|
||||
WIN32_FIND_DATA file_data;
|
||||
HANDLE find;
|
||||
|
||||
/* Nothing to do. */
|
||||
if (path == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (base_path[base_path.length () - 1] != '\\') {
|
||||
base_path += "\\";
|
||||
}
|
||||
|
@ -1817,7 +1861,7 @@ Pandora_Windows_Service::sendBufferedXml (string path) {
|
|||
}
|
||||
|
||||
/* Send data files as long as there are no errors */
|
||||
if (this->copyDataFile (file_data.cFileName) != 0) {
|
||||
if ((this->*copy_func) (file_data.cFileName, secondary_buffer) != 0) {
|
||||
FindClose(find);
|
||||
return;
|
||||
}
|
||||
|
@ -1832,7 +1876,7 @@ Pandora_Windows_Service::sendBufferedXml (string path) {
|
|||
Pandora_File::removeFile (base_path + file_data.cFileName);
|
||||
|
||||
while (FindNextFile(find, &file_data) != 0) {
|
||||
if (this->copyDataFile (file_data.cFileName) != 0) {
|
||||
if ((this->*copy_func) (file_data.cFileName, secondary_buffer) != 0) {
|
||||
FindClose(find);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#define FTP_DEFAULT_PORT 21
|
||||
#define SSH_DEFAULT_PORT 22
|
||||
#define SECONDARY_DIR "secondary" /* Path of the secondary buffer relative to the primary buffer. */
|
||||
|
||||
using namespace std;
|
||||
using namespace Pandora_Modules;
|
||||
|
@ -39,6 +40,7 @@ namespace Pandora {
|
|||
* Class to implement the Pandora Windows service.
|
||||
*/
|
||||
class Pandora_Windows_Service : public Windows_Service {
|
||||
typedef int (Pandora::Pandora_Windows_Service::*copy_func_p)(string, bool);
|
||||
private:
|
||||
Pandora_Agent_Conf *conf;
|
||||
Pandora_Module_List *modules;
|
||||
|
@ -54,7 +56,8 @@ namespace Pandora {
|
|||
list<string> collection_disk;
|
||||
|
||||
string getXmlHeader ();
|
||||
int copyDataFile (string filename);
|
||||
int copyDataFile (string filename, bool secondary_buffer = false);
|
||||
int copyToSecondary (string filename, bool secondary_buffer = true);
|
||||
string getValueFromCmdExec (string cmd_exec, int timeout);
|
||||
string getAgentNameFromCmdExec (string cmd_exec);
|
||||
string getCoordinatesFromCmdExec (string cmd_exec);
|
||||
|
@ -115,7 +118,7 @@ namespace Pandora {
|
|||
|
||||
void start ();
|
||||
int sendXml (Pandora_Module_List *modules);
|
||||
void sendBufferedXml (string path);
|
||||
void sendBufferedXml (string path, copy_func_p copy_func, bool secondary_buffer);
|
||||
Pandora_Agent_Conf *getConf ();
|
||||
string getEHKey (string ehorus_conf);
|
||||
long getInterval ();
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.743(Build 200218))"
|
||||
VALUE "ProductVersion", "(7.0NG.743(Build 200220))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.743-200218
|
||||
Version: 7.0NG.743-200220
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.743-200218"
|
||||
pandora_version="7.0NG.743-200220"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `server_uid` TEXT NOT NULL default '';
|
||||
SET @st_oum744 = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM tconfig WHERE token LIKE 'server_unique_identifier') > 0,
|
||||
"SELECT 1",
|
||||
"INSERT INTO `tconfig` (`token`, `value`) VALUES ('server_unique_identifier', replace(uuid(),'-',''))"
|
||||
));
|
||||
|
||||
PREPARE pr_oum744 FROM @st_oum744;
|
||||
EXECUTE pr_oum744;
|
||||
DEALLOCATE PREPARE pr_oum744;
|
||||
|
||||
COMMIT;
|
|
@ -392,6 +392,8 @@ ALTER TABLE `tmetaconsole_setup` MODIFY COLUMN `meta_dbuser` text NULL,
|
|||
MODIFY COLUMN `meta_dbport` text NULL,
|
||||
MODIFY COLUMN `meta_dbname` text NULL;
|
||||
|
||||
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `server_uid` TEXT NOT NULL default '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tprofile_view`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
|
|
@ -429,8 +429,7 @@ if ($create_modules) {
|
|||
|
||||
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||
echo "<form method='post' id='wmi_form'
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&
|
||||
tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
|
@ -533,8 +532,7 @@ echo '</form>';
|
|||
if ($wmiexplore && !$fail) {
|
||||
echo '<br><span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente
|
||||
&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
echo '<span id="form_interfaces">';
|
||||
|
||||
html_print_input_hidden('create_modules', 1);
|
||||
|
|
|
@ -182,19 +182,11 @@ $table_simple->cellclass = [];
|
|||
|
||||
$table_simple->colspan = [];
|
||||
|
||||
|
||||
|
||||
$table_simple->colspan[6][1] = 3;
|
||||
|
||||
$table_simple->rowspan = [];
|
||||
if (strstr($page, 'policy_modules')) {
|
||||
$table_simple->rowspan[3][2] = 3;
|
||||
$table_simple->colspan[3][2] = 2;
|
||||
} else {
|
||||
$table_simple->rowspan[4][2] = 3;
|
||||
$table_simple->colspan[4][2] = 2;
|
||||
$table_simple->colspan[5][1] = 3;
|
||||
}
|
||||
|
||||
$table_simple->rowspan[2][2] = 3;
|
||||
$table_simple->colspan[2][2] = 2;
|
||||
$table_simple->colspan[3][1] = 3;
|
||||
|
||||
$table_simple->data[0][0] = __('Name');
|
||||
$table_simple->data[0][1] = html_print_input_text_extended(
|
||||
|
@ -264,40 +256,9 @@ if ((isset($id_agent_module) && $id_agent_module) || $id_policy_module != 0) {
|
|||
}
|
||||
|
||||
$in_policy = strstr($page, 'policy_modules');
|
||||
if (!$in_policy) {
|
||||
// Cannot select the current module to be itself parent.
|
||||
$module_parent_filter = ($id_agent_module) ? ['tagente_modulo.id_agente_modulo' => "<>$id_agent_module"] : '';
|
||||
$table_simple->data[1][0] = __('Module parent');
|
||||
$modules_can_be_parent = agents_get_modules(
|
||||
$id_agente,
|
||||
false,
|
||||
$module_parent_filter
|
||||
);
|
||||
// If the user cannot have access to parent module, only print the name.
|
||||
if ($parent_module_id != 0
|
||||
&& !in_array($parent_module_id, array_keys($modules_can_be_parent))
|
||||
) {
|
||||
$table_simple->data[1][1] = db_get_value(
|
||||
'nombre',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$parent_module_id
|
||||
);
|
||||
} else {
|
||||
$table_simple->data[1][1] = html_print_select(
|
||||
$modules_can_be_parent,
|
||||
'parent_module_id',
|
||||
$parent_module_id,
|
||||
'',
|
||||
__('Not assigned'),
|
||||
'0',
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
|
||||
$table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
|
||||
$table_simple->data[1][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
|
||||
$table_simple->data[1][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
|
||||
|
||||
if (!$edit) {
|
||||
$sql = sprintf(
|
||||
|
@ -315,8 +276,8 @@ if (!$edit) {
|
|||
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
|
||||
}
|
||||
|
||||
$table_simple->data[2][1] = '<em>'.modules_get_moduletype_description($id_module_type).' ('.$type_names_hash[$id_module_type].')</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_hidden(
|
||||
$table_simple->data[1][1] = '<em>'.modules_get_moduletype_description($id_module_type).' ('.$type_names_hash[$id_module_type].')</em>';
|
||||
$table_simple->data[1][1] .= html_print_input_hidden(
|
||||
'type_names',
|
||||
base64_encode(io_json_mb_encode($type_names_hash)),
|
||||
true
|
||||
|
@ -358,7 +319,7 @@ if (!$edit) {
|
|||
}
|
||||
}
|
||||
|
||||
$table_simple->data[2][1] = html_print_select(
|
||||
$table_simple->data[1][1] = html_print_select(
|
||||
$type_description_hash,
|
||||
'id_module_type',
|
||||
$idModuleType,
|
||||
|
@ -376,7 +337,7 @@ if (!$edit) {
|
|||
);
|
||||
|
||||
// Store the relation between id and name of the types on a hidden field.
|
||||
$table_simple->data[2][1] .= html_print_input_hidden(
|
||||
$table_simple->data[1][1] .= html_print_input_hidden(
|
||||
'type_names',
|
||||
base64_encode(io_json_mb_encode($type_names_hash)),
|
||||
true
|
||||
|
@ -409,74 +370,22 @@ if ($edit_module) {
|
|||
$help_header = 'webserver_module_tab';
|
||||
}
|
||||
|
||||
$table_simple->data[2][0] = __('Type').' ';
|
||||
$table_simple->data[2][0] .= ui_print_help_icon($help_header, true);
|
||||
$table_simple->data[1][0] = __('Type').' ';
|
||||
$table_simple->data[1][0] .= ui_print_help_icon($help_header, true);
|
||||
}
|
||||
|
||||
if ($disabledBecauseInPolicy) {
|
||||
$table_simple->data[2][3] .= html_print_input_hidden(
|
||||
$table_simple->data[1][3] .= html_print_input_hidden(
|
||||
'id_module_group',
|
||||
$id_module_group,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table_simple->data[3][0] = __('Dynamic Threshold Interval');
|
||||
$table_simple->data[3][1] = html_print_extended_select_for_time(
|
||||
'dynamic_interval',
|
||||
$dynamic_interval,
|
||||
'',
|
||||
'None',
|
||||
'0',
|
||||
10,
|
||||
true,
|
||||
'width:150px',
|
||||
false,
|
||||
$classdisabledBecauseInPolicy,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image('images/cog.png', true, ['title' => __('Advanced options Dynamic Threshold')]).'</a>';
|
||||
if ($in_policy) {
|
||||
$table_simple->cellclass[2][2] = 'hide_dinamic';
|
||||
$table_simple->cellclass[2][3] = 'hide_dinamic';
|
||||
} else {
|
||||
$table_simple->cellclass[3][2] = 'hide_dinamic';
|
||||
$table_simple->cellclass[3][3] = 'hide_dinamic';
|
||||
}
|
||||
|
||||
$table_simple->data[3][2] = '<span><em>'.__('Dynamic Threshold Min. ').'</em>';
|
||||
$table_simple->data[3][2] .= html_print_input_text(
|
||||
'dynamic_min',
|
||||
$dynamic_min,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[3][2] .= '<br /><em>'.__('Dynamic Threshold Max. ').'</em>';
|
||||
$table_simple->data[3][2] .= html_print_input_text(
|
||||
'dynamic_max',
|
||||
$dynamic_max,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[3][3] = '<span><em>'.__('Dynamic Threshold Two Tailed: ').'</em>';
|
||||
$table_simple->data[3][3] .= html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true, $disabledBecauseInPolicy);
|
||||
|
||||
$table_simple->data[4][0] = __('Warning status');
|
||||
$table_simple->data[2][0] = __('Warning status');
|
||||
if (!modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[4][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[4][1] .= html_print_input_text(
|
||||
$table_simple->data[2][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_text(
|
||||
'min_warning',
|
||||
$min_warning,
|
||||
'',
|
||||
|
@ -488,8 +397,8 @@ if (!modules_is_string_type($id_module_type) || $edit) {
|
|||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[4][1] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[4][1] .= html_print_input_text(
|
||||
$table_simple->data[2][1] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_text(
|
||||
'max_warning',
|
||||
$max_warning,
|
||||
'',
|
||||
|
@ -504,8 +413,8 @@ if (!modules_is_string_type($id_module_type) || $edit) {
|
|||
}
|
||||
|
||||
if (modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[4][1] .= html_print_input_text(
|
||||
$table_simple->data[2][1] .= '<span id="string_warning"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_text(
|
||||
'str_warning',
|
||||
str_replace('"', '', $str_warning),
|
||||
'',
|
||||
|
@ -519,17 +428,17 @@ if (modules_is_string_type($id_module_type) || $edit) {
|
|||
).'</span>';
|
||||
}
|
||||
|
||||
$table_simple->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[4][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[2][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true, $disabledBecauseInPolicy);
|
||||
|
||||
if (!modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[4][2] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
|
||||
$table_simple->data[2][2] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
|
||||
}
|
||||
|
||||
$table_simple->data[5][0] = __('Critical status');
|
||||
$table_simple->data[3][0] = __('Critical status');
|
||||
if (!modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[5][1] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[5][1] .= html_print_input_text(
|
||||
$table_simple->data[3][1] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_input_text(
|
||||
'min_critical',
|
||||
$min_critical,
|
||||
'',
|
||||
|
@ -541,8 +450,8 @@ if (!modules_is_string_type($id_module_type) || $edit) {
|
|||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[5][1] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[5][1] .= html_print_input_text(
|
||||
$table_simple->data[3][1] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_input_text(
|
||||
'max_critical',
|
||||
$max_critical,
|
||||
'',
|
||||
|
@ -557,8 +466,8 @@ if (!modules_is_string_type($id_module_type) || $edit) {
|
|||
}
|
||||
|
||||
if (modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[5][1] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[5][1] .= html_print_input_text(
|
||||
$table_simple->data[3][1] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_input_text(
|
||||
'str_critical',
|
||||
str_replace('"', '', $str_critical),
|
||||
'',
|
||||
|
@ -572,109 +481,24 @@ if (modules_is_string_type($id_module_type) || $edit) {
|
|||
).'</span>';
|
||||
}
|
||||
|
||||
$table_simple->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[3][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy);
|
||||
|
||||
// FF stands for Flip-flop.
|
||||
$table_simple->data[6][0] = __('FF threshold').' ';
|
||||
|
||||
$table_simple->data[6][1] .= __('Keep counters');
|
||||
$table_simple->data[6][1] .= html_print_checkbox(
|
||||
'ff_type',
|
||||
1,
|
||||
$ff_type,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
).'<br />';
|
||||
|
||||
$table_simple->data[6][1] .= html_print_radio_button(
|
||||
'each_ff',
|
||||
0,
|
||||
'',
|
||||
$each_ff,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[6][1] .= ' '.__('All state changing').' : ';
|
||||
$table_simple->data[6][1] .= html_print_input_text(
|
||||
'ff_event',
|
||||
$ff_event,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'<br />';
|
||||
$table_simple->data[6][1] .= html_print_radio_button(
|
||||
'each_ff',
|
||||
1,
|
||||
'',
|
||||
$each_ff,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$table_simple->data[6][1] .= ' '.__('Each state changing').' : ';
|
||||
$table_simple->data[6][1] .= __('To normal');
|
||||
$table_simple->data[6][1] .= html_print_input_text(
|
||||
'ff_event_normal',
|
||||
$ff_event_normal,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).' ';
|
||||
|
||||
$table_simple->data[6][1] .= __('To warning');
|
||||
$table_simple->data[6][1] .= html_print_input_text(
|
||||
'ff_event_warning',
|
||||
$ff_event_warning,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).' ';
|
||||
|
||||
$table_simple->data[6][1] .= __('To critical');
|
||||
$table_simple->data[6][1] .= html_print_input_text(
|
||||
'ff_event_critical',
|
||||
$ff_event_critical,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$table_simple->data[7][0] = __('Historical data');
|
||||
$table_simple->data[4][0] = __('Historical data');
|
||||
if ($disabledBecauseInPolicy) {
|
||||
// If is disabled, we send a hidden in his place and print a false
|
||||
// checkbox because HTML dont send disabled fields
|
||||
// and could be disabled by error.
|
||||
$table_simple->data[7][1] = html_print_checkbox(
|
||||
$table_simple->data[4][1] = html_print_checkbox(
|
||||
'history_data_fake',
|
||||
1,
|
||||
$history_data,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[7][1] .= '<input type="hidden" name="history_data" value="'.(int) $history_data.'">';
|
||||
$table_simple->data[4][1] .= '<input type="hidden" name="history_data" value="'.(int) $history_data.'">';
|
||||
} else {
|
||||
$table_simple->data[7][1] = html_print_checkbox(
|
||||
$table_simple->data[4][1] = html_print_checkbox(
|
||||
'history_data',
|
||||
1,
|
||||
$history_data,
|
||||
|
@ -693,21 +517,11 @@ $table_advanced->style = [];
|
|||
$table_advanced->style[0] = $table_advanced->style[3] = $table_advanced->style[5] = 'font-weight: bold;';
|
||||
$table_advanced->colspan = [];
|
||||
|
||||
$table_advanced->data[0][0] = __('Description');
|
||||
$table_advanced->colspan[0][1] = 6;
|
||||
$table_advanced->data[0][1] = html_print_textarea(
|
||||
'description',
|
||||
2,
|
||||
65,
|
||||
$description,
|
||||
$disabledTextBecauseInPolicy,
|
||||
true,
|
||||
$largeClassDisabledBecauseInPolicy
|
||||
);
|
||||
$table_advanced->colspan[17][1] = 3;
|
||||
|
||||
$table_advanced->data[1][0] = __('Custom ID');
|
||||
$table_advanced->colspan[1][1] = 2;
|
||||
$table_advanced->data[1][1] = html_print_input_text(
|
||||
$table_advanced->data[0][0] = __('Custom ID');
|
||||
$table_advanced->colspan[0][1] = 2;
|
||||
$table_advanced->data[0][1] = html_print_input_text(
|
||||
'custom_id',
|
||||
$custom_id,
|
||||
'',
|
||||
|
@ -720,11 +534,11 @@ $table_advanced->data[1][1] = html_print_input_text(
|
|||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$table_advanced->data[1][3] = __('Unit');
|
||||
$table_advanced->data[0][3] = __('Unit');
|
||||
// $table_advanced->data[1][4] = html_print_input_text ('unit', $unit, '', 20, 65, true,
|
||||
// $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
|
||||
// $table_advanced->colspan[1][4] = 3;
|
||||
$table_advanced->data[1][4] = html_print_extended_select_for_unit(
|
||||
$table_advanced->data[0][4] = html_print_extended_select_for_unit(
|
||||
'unit',
|
||||
$unit,
|
||||
'',
|
||||
|
@ -735,7 +549,7 @@ $table_advanced->data[1][4] = html_print_extended_select_for_unit(
|
|||
false,
|
||||
false
|
||||
);
|
||||
$table_advanced->colspan[1][4] = 3;
|
||||
$table_advanced->colspan[0][4] = 3;
|
||||
|
||||
$module_id_policy_module = 0;
|
||||
if (isset($module['id_policy_module'])) {
|
||||
|
@ -745,38 +559,38 @@ if (isset($module['id_policy_module'])) {
|
|||
// In the data modules, the interval is not in seconds. It is a factor
|
||||
// to be multiplied for the agent interval
|
||||
if ($moduletype == MODULE_DATA) {
|
||||
$table_advanced->data[2][0] = __('Interval');
|
||||
$table_advanced->colspan[2][1] = 2;
|
||||
$table_advanced->data[1][0] = __('Interval');
|
||||
$table_advanced->colspan[1][1] = 2;
|
||||
$interval_factor = 1;
|
||||
if (isset($id_agente)) {
|
||||
$agent_interval = agents_get_interval($id_agente);
|
||||
$interval_factor = ($interval / $agent_interval);
|
||||
$table_advanced->data[2][1] = human_time_description_raw($interval).' ('.sprintf(__('Agent interval x %s'), $interval_factor).') ';
|
||||
$table_advanced->data[1][1] = human_time_description_raw($interval).' ('.sprintf(__('Agent interval x %s'), $interval_factor).') ';
|
||||
} else {
|
||||
$table_advanced->data[2][1] = sprintf(__('Agent interval x %s'), $interval_factor);
|
||||
$table_advanced->data[1][1] = sprintf(__('Agent interval x %s'), $interval_factor);
|
||||
}
|
||||
|
||||
if ($__code_from == 'policies') {
|
||||
// If is the policy form, module_interval will store the factor (not the seconds).
|
||||
// So server will transform it to interval in seconds
|
||||
$table_advanced->data[2][1] = sprintf(__('Default').': 1', $interval_factor);
|
||||
$table_advanced->data[2][1] .= html_print_input_hidden('module_interval', $interval_factor, true);
|
||||
$table_advanced->data[1][1] = sprintf(__('Default').': 1', $interval_factor);
|
||||
$table_advanced->data[1][1] .= html_print_input_hidden('module_interval', $interval_factor, true);
|
||||
} else if ($module_id_policy_module != 0) {
|
||||
$table_advanced->data[2][1] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true);
|
||||
$table_advanced->data[1][1] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true);
|
||||
}
|
||||
|
||||
// If it is a non policy form, the module_interval will not provided and will
|
||||
// be taken the agent interval (this code is at configurar_agente.php)
|
||||
} else {
|
||||
$table_advanced->data[2][0] = __('Interval');
|
||||
$table_advanced->colspan[2][1] = 2;
|
||||
$table_advanced->data[2][1] = html_print_extended_select_for_time('module_interval', $interval, '', '', '0', false, true, false, false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
|
||||
$table_advanced->data[1][0] = __('Interval');
|
||||
$table_advanced->colspan[1][1] = 2;
|
||||
$table_advanced->data[1][1] = html_print_extended_select_for_time('module_interval', $interval, '', '', '0', false, true, false, false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
|
||||
}
|
||||
|
||||
$table_advanced->data[2][1] .= html_print_input_hidden('moduletype', $moduletype, true);
|
||||
$table_advanced->data[1][1] .= html_print_input_hidden('moduletype', $moduletype, true);
|
||||
|
||||
$table_advanced->data[2][3] = __('Post process');
|
||||
$table_advanced->data[2][4] = html_print_extended_select_for_post_process(
|
||||
$table_advanced->data[1][3] = __('Post process');
|
||||
$table_advanced->data[1][4] = html_print_extended_select_for_post_process(
|
||||
'post_process',
|
||||
$post_process,
|
||||
'',
|
||||
|
@ -788,17 +602,17 @@ $table_advanced->data[2][4] = html_print_extended_select_for_post_process(
|
|||
false,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_advanced->colspan[1][4] = 3;
|
||||
|
||||
$table_advanced->data[2][0] = __('Min. Value');
|
||||
$table_advanced->colspan[2][1] = 2;
|
||||
|
||||
$table_advanced->data[2][1] = html_print_input_text('min', $min, '', 5, 15, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).' '.ui_print_help_tip(__('Any value below this number is discarted.'), true);
|
||||
$table_advanced->data[2][3] = __('Max. Value');
|
||||
$table_advanced->data[2][4] = html_print_input_text('max', $max, '', 5, 15, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).' '.ui_print_help_tip(__('Any value over this number is discarted.'), true);
|
||||
$table_advanced->colspan[2][4] = 3;
|
||||
|
||||
$table_advanced->data[3][0] = __('Min. Value');
|
||||
$table_advanced->colspan[3][1] = 2;
|
||||
|
||||
$table_advanced->data[3][1] = html_print_input_text('min', $min, '', 5, 15, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).' '.ui_print_help_tip(__('Any value below this number is discarted.'), true);
|
||||
$table_advanced->data[3][3] = __('Max. Value');
|
||||
$table_advanced->data[3][4] = html_print_input_text('max', $max, '', 5, 15, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).' '.ui_print_help_tip(__('Any value over this number is discarted.'), true);
|
||||
$table_advanced->colspan[3][4] = 3;
|
||||
|
||||
$table_advanced->data[4][0] = __('Export target');
|
||||
$table_advanced->data[3][0] = __('Export target');
|
||||
// Default text message for export target select and disabled option
|
||||
$none_text = __('None');
|
||||
$disabled_export = false;
|
||||
|
@ -808,7 +622,7 @@ if ($__code_from == 'policies') {
|
|||
$disabled_export = true;
|
||||
}
|
||||
|
||||
$table_advanced->data[4][1] = html_print_select_from_sql(
|
||||
$table_advanced->data[3][1] = html_print_select_from_sql(
|
||||
'SELECT id, name FROM tserver_export ORDER BY name',
|
||||
'id_export',
|
||||
$id_export,
|
||||
|
@ -820,7 +634,7 @@ $table_advanced->data[4][1] = html_print_select_from_sql(
|
|||
false,
|
||||
$disabled_export
|
||||
).ui_print_help_tip(__('In case you use an Export server you can link this module and export data to one these.'), true);
|
||||
$table_advanced->colspan[4][1] = 2;
|
||||
$table_advanced->colspan[3][1] = 2;
|
||||
|
||||
// Code comes from module_editor
|
||||
if ($__code_from == 'modules') {
|
||||
|
@ -831,18 +645,18 @@ if ($__code_from == 'modules') {
|
|||
$throw_unknown_events_check = policy_module_is_disable_type_event($__id_pol_mod, EVENTS_GOING_UNKNOWN);
|
||||
}
|
||||
|
||||
$table_advanced->data[4][3] = __('Discard unknown events');
|
||||
$table_advanced->data[4][4] = html_print_checkbox(
|
||||
$table_advanced->data[3][3] = __('Discard unknown events');
|
||||
$table_advanced->data[3][4] = html_print_checkbox(
|
||||
'throw_unknown_events',
|
||||
1,
|
||||
$throw_unknown_events_check,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_advanced->colspan[4][4] = 3;
|
||||
$table_advanced->colspan[3][4] = 3;
|
||||
|
||||
$table_advanced->data[5][0] = __('FF interval');
|
||||
$table_advanced->data[5][1] = html_print_input_text(
|
||||
$table_advanced->data[4][0] = __('FF interval');
|
||||
$table_advanced->data[4][1] = html_print_input_text(
|
||||
'module_ff_interval',
|
||||
$ff_interval,
|
||||
'',
|
||||
|
@ -854,14 +668,14 @@ $table_advanced->data[5][1] = html_print_input_text(
|
|||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).ui_print_help_tip(__('Module execution flip flop time interval (in secs).'), true);
|
||||
$table_advanced->colspan[5][1] = 2;
|
||||
$table_advanced->colspan[4][1] = 2;
|
||||
|
||||
$table_advanced->data[5][3] = __('FF timeout');
|
||||
$table_advanced->data[4][3] = __('FF timeout');
|
||||
|
||||
$module_type_name = modules_get_type_name($id_module_type);
|
||||
$table_advanced->data[5][4] = '';
|
||||
$table_advanced->data[4][4] = '';
|
||||
if (preg_match('/async/', $module_type_name) || $edit) {
|
||||
$table_advanced->data[5][4] .= '<span id="ff_timeout">'.html_print_input_text(
|
||||
$table_advanced->data[4][4] .= '<span id="ff_timeout">'.html_print_input_text(
|
||||
'ff_timeout',
|
||||
$ff_timeout,
|
||||
'',
|
||||
|
@ -873,16 +687,16 @@ if (preg_match('/async/', $module_type_name) || $edit) {
|
|||
}
|
||||
|
||||
if (!preg_match('/async/', $module_type_name) || $edit) {
|
||||
$table_advanced->data[5][4] .= '<span id="ff_timeout_disable">'.__('Disabled').ui_print_help_tip(__('This value can be set only in the async modules.'), true).'</span>';
|
||||
$table_advanced->data[4][4] .= '<span id="ff_timeout_disable">'.__('Disabled').ui_print_help_tip(__('This value can be set only in the async modules.'), true).'</span>';
|
||||
}
|
||||
|
||||
$table_advanced->colspan[5][4] = 3;
|
||||
$table_advanced->colspan[4][4] = 3;
|
||||
|
||||
/*
|
||||
Tags */
|
||||
// This var comes from module_manager_editor.php or policy_modules.php
|
||||
global $__code_from;
|
||||
$table_advanced->data[6][0] = __('Tags available');
|
||||
$table_advanced->data[5][0] = __('Tags available');
|
||||
// Code comes from module_editor
|
||||
if ($__code_from == 'modules') {
|
||||
$__table_modules = 'ttag_module';
|
||||
|
@ -902,7 +716,7 @@ if ($__code_from == 'modules') {
|
|||
}
|
||||
|
||||
if (!tags_has_user_acl_tags($config['id_user'])) {
|
||||
$table_advanced->data[6][1] = html_print_select_from_sql(
|
||||
$table_advanced->data[5][1] = html_print_select_from_sql(
|
||||
"SELECT id_tag, name
|
||||
FROM ttag
|
||||
WHERE id_tag NOT IN (
|
||||
|
@ -927,7 +741,7 @@ if (!tags_has_user_acl_tags($config['id_user'])) {
|
|||
if (!empty($user_tags)) {
|
||||
$id_user_tags = array_keys($user_tags);
|
||||
|
||||
$table_advanced->data[6][1] = html_print_select_from_sql(
|
||||
$table_advanced->data[5][1] = html_print_select_from_sql(
|
||||
'SELECT id_tag, name
|
||||
FROM ttag
|
||||
WHERE id_tag IN ('.implode(',', $id_user_tags).") AND
|
||||
|
@ -949,7 +763,7 @@ if (!tags_has_user_acl_tags($config['id_user'])) {
|
|||
'5'
|
||||
);
|
||||
} else {
|
||||
$table_advanced->data[6][1] = html_print_select_from_sql(
|
||||
$table_advanced->data[5][1] = html_print_select_from_sql(
|
||||
"SELECT id_tag, name
|
||||
FROM ttag
|
||||
WHERE id_tag NOT IN (
|
||||
|
@ -972,12 +786,12 @@ if (!tags_has_user_acl_tags($config['id_user'])) {
|
|||
}
|
||||
}
|
||||
|
||||
$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module')]);
|
||||
$table_advanced->data[5][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module')]);
|
||||
// html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
|
||||
$table_advanced->data[6][2] .= '<br><br><br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'left', 'title' => __('Delete tags to module')]);
|
||||
$table_advanced->data[5][2] .= '<br><br><br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'left', 'title' => __('Delete tags to module')]);
|
||||
// html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
|
||||
$table_advanced->data[6][3] = '<b>'.__('Tags selected').'</b>';
|
||||
$table_advanced->data[6][4] = html_print_select_from_sql(
|
||||
$table_advanced->data[5][3] = '<b>'.__('Tags selected').'</b>';
|
||||
$table_advanced->data[5][4] = html_print_select_from_sql(
|
||||
"SELECT a.id_tag, name
|
||||
FROM ttag a, $__table_modules b
|
||||
WHERE a.id_tag = b.id_tag AND $__id_where = $__id
|
||||
|
@ -997,8 +811,8 @@ $table_advanced->data[6][4] = html_print_select_from_sql(
|
|||
);
|
||||
|
||||
if ($__code_from == 'modules') {
|
||||
$table_advanced->data[6][5] = '<b>'.__('Tags from policy').'</b>';
|
||||
$table_advanced->data[6][6] = html_print_select_from_sql(
|
||||
$table_advanced->data[5][5] = '<b>'.__('Tags from policy').'</b>';
|
||||
$table_advanced->data[5][6] = html_print_select_from_sql(
|
||||
"SELECT a.id_tag, name
|
||||
FROM ttag a, $__table_modules b
|
||||
WHERE a.id_tag = b.id_tag AND $__id_where = $__id
|
||||
|
@ -1018,9 +832,9 @@ if ($__code_from == 'modules') {
|
|||
);
|
||||
}
|
||||
|
||||
$table_advanced->data[7][0] = __('Quiet');
|
||||
$table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true);
|
||||
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true, $disabledBecauseInPolicy);
|
||||
$table_advanced->data[6][0] = __('Quiet');
|
||||
$table_advanced->data[6][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true);
|
||||
$table_advanced->data[6][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true, $disabledBecauseInPolicy);
|
||||
|
||||
$cps_array[-1] = __('Disabled');
|
||||
if ($cps_module > 0) {
|
||||
|
@ -1037,22 +851,37 @@ if ($cps_module > 0) {
|
|||
$cps_array[$cps_inc] = __('Enabled');
|
||||
}
|
||||
|
||||
$table_advanced->data[7][2] = __('Cascade Protection Services');
|
||||
$table_advanced->data[7][2] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||
$table_advanced->colspan[7][3] = 5;
|
||||
$table_advanced->data[7][3] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, '', $disabledBecauseInPolicy);
|
||||
$table_advanced->data[6][2] = '';
|
||||
$table_advanced->data[6][3] = __('Cascade Protection Services');
|
||||
$table_advanced->data[6][3] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
|
||||
$table_advanced->colspan[6][4] = 3;
|
||||
$table_advanced->data[6][4] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, '', $disabledBecauseInPolicy);
|
||||
|
||||
$textarea_custom_style = ' style="min-height: 0px;"';
|
||||
|
||||
$table_advanced->data[7][0] = __('Description');
|
||||
$table_advanced->colspan[7][1] = 6;
|
||||
$table_advanced->data[7][1] = html_print_textarea(
|
||||
'description',
|
||||
3,
|
||||
65,
|
||||
$description,
|
||||
$disabledTextBecauseInPolicy.$textarea_custom_style,
|
||||
true,
|
||||
$largeClassDisabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$table_advanced->data[8][0] = __('Critical instructions').ui_print_help_tip(__('Instructions when the status is critical'), true);
|
||||
$table_advanced->data[8][1] = html_print_textarea('critical_instructions', 2, 65, $critical_instructions, $disabledTextBecauseInPolicy, true, $largeClassDisabledBecauseInPolicy);
|
||||
$table_advanced->data[8][1] = html_print_textarea('critical_instructions', 3, 65, $critical_instructions, $disabledTextBecauseInPolicy.$textarea_custom_style, true, $largeClassDisabledBecauseInPolicy);
|
||||
|
||||
$table_advanced->colspan[8][1] = 6;
|
||||
|
||||
$table_advanced->data[9][0] = __('Warning instructions').ui_print_help_tip(__('Instructions when the status is warning'), true);
|
||||
$table_advanced->data[9][1] = html_print_textarea('warning_instructions', 2, 65, $warning_instructions, $disabledTextBecauseInPolicy, true, $largeClassDisabledBecauseInPolicy);
|
||||
$table_advanced->data[9][1] = html_print_textarea('warning_instructions', 3, 65, $warning_instructions, $disabledTextBecauseInPolicy.$textarea_custom_style, true, $largeClassDisabledBecauseInPolicy);
|
||||
$table_advanced->colspan[9][1] = 6;
|
||||
|
||||
$table_advanced->data[10][0] = __('Unknown instructions').ui_print_help_tip(__('Instructions when the status is unknown'), true);
|
||||
$table_advanced->data[10][1] = html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, $disabledTextBecauseInPolicy, true, $largeClassDisabledBecauseInPolicy);
|
||||
$table_advanced->data[10][1] = html_print_textarea('unknown_instructions', 3, 65, $unknown_instructions, $disabledTextBecauseInPolicy.$textarea_custom_style, true, $largeClassDisabledBecauseInPolicy);
|
||||
$table_advanced->colspan[10][1] = 6;
|
||||
|
||||
if (isset($id_agente) && $moduletype == MODULE_DATA) {
|
||||
|
@ -1112,6 +941,175 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||
$table_advanced->data[13][4] .= html_print_input_hidden('id_category', $id_category, true);
|
||||
}
|
||||
|
||||
if (!$in_policy) {
|
||||
// Cannot select the current module to be itself parent.
|
||||
$module_parent_filter = ($id_agent_module) ? ['tagente_modulo.id_agente_modulo' => "<>$id_agent_module"] : '';
|
||||
$table_advanced->data[15][0] = __('Module parent');
|
||||
$modules_can_be_parent = agents_get_modules(
|
||||
$id_agente,
|
||||
false,
|
||||
$module_parent_filter
|
||||
);
|
||||
// If the user cannot have access to parent module, only print the name.
|
||||
if ($parent_module_id != 0
|
||||
&& !in_array($parent_module_id, array_keys($modules_can_be_parent))
|
||||
) {
|
||||
$table_advanced->data[15][1] = db_get_value(
|
||||
'nombre',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$parent_module_id
|
||||
);
|
||||
} else {
|
||||
$table_advanced->data[15][1] = html_print_select(
|
||||
$modules_can_be_parent,
|
||||
'parent_module_id',
|
||||
$parent_module_id,
|
||||
'',
|
||||
__('Not assigned'),
|
||||
'0',
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table_advanced->data[16][0] = __('Dynamic Threshold Interval');
|
||||
$table_advanced->data[16][1] = html_print_extended_select_for_time(
|
||||
'dynamic_interval',
|
||||
$dynamic_interval,
|
||||
'',
|
||||
'None',
|
||||
'0',
|
||||
10,
|
||||
true,
|
||||
'width:150px',
|
||||
false,
|
||||
$classdisabledBecauseInPolicy,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_advanced->data[16][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image('images/cog.png', true, ['title' => __('Advanced options Dynamic Threshold')]).'</a>';
|
||||
|
||||
$table_advanced->cellclass[16][2] = 'hide_dinamic';
|
||||
$table_advanced->cellclass[16][3] = 'hide_dinamic';
|
||||
|
||||
|
||||
$table_advanced->data[16][2] = '<span><em>'.__('Dynamic Threshold Min. ').'</em>';
|
||||
$table_advanced->data[16][2] .= html_print_input_text(
|
||||
'dynamic_min',
|
||||
$dynamic_min,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$table_advanced->data[16][2] .= '<br /><em>'.__('Dynamic Threshold Max. ').'</em>';
|
||||
$table_advanced->data[16][2] .= html_print_input_text(
|
||||
'dynamic_max',
|
||||
$dynamic_max,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$table_advanced->data[16][3] = '<span><em>'.__('Dynamic Threshold Two Tailed: ').'</em>';
|
||||
$table_advanced->data[16][3] .= html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true, $disabledBecauseInPolicy);
|
||||
|
||||
|
||||
|
||||
// FF stands for Flip-flop.
|
||||
$table_advanced->data[17][0] = __('FF threshold').' ';
|
||||
|
||||
$table_advanced->data[17][1] .= __('Keep counters');
|
||||
$table_advanced->data[17][1] .= html_print_checkbox(
|
||||
'ff_type',
|
||||
1,
|
||||
$ff_type,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
).'<br />';
|
||||
|
||||
$table_advanced->data[17][1] .= html_print_radio_button(
|
||||
'each_ff',
|
||||
0,
|
||||
'',
|
||||
$each_ff,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_advanced->data[17][1] .= ' '.__('All state changing').' : ';
|
||||
$table_advanced->data[17][1] .= html_print_input_text(
|
||||
'ff_event',
|
||||
$ff_event,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'<br />';
|
||||
$table_advanced->data[17][1] .= html_print_radio_button(
|
||||
'each_ff',
|
||||
1,
|
||||
'',
|
||||
$each_ff,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$table_advanced->data[17][1] .= ' '.__('Each state changing').' : ';
|
||||
$table_advanced->data[17][1] .= __('To normal');
|
||||
$table_advanced->data[17][1] .= html_print_input_text(
|
||||
'ff_event_normal',
|
||||
$ff_event_normal,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).' ';
|
||||
|
||||
$table_advanced->data[17][1] .= __('To warning');
|
||||
$table_advanced->data[17][1] .= html_print_input_text(
|
||||
'ff_event_warning',
|
||||
$ff_event_warning,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).' ';
|
||||
|
||||
$table_advanced->data[17][1] .= __('To critical');
|
||||
$table_advanced->data[17][1] .= html_print_input_text(
|
||||
'ff_event_critical',
|
||||
$ff_event_critical,
|
||||
'',
|
||||
5,
|
||||
15,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
|
||||
|
||||
// Advanced form part
|
||||
$table_macros = new stdClass();
|
||||
$table_macros->id = 'module_macros';
|
||||
|
|
|
@ -1,18 +1,25 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to self monitor Pandora FMS Console
|
||||
*
|
||||
* @package Pandora FMS
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
* Pandora FMS - http://pandorafms.com
|
||||
* * ==================================================
|
||||
* * Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
* * Please see http://pandorafms.org for full contribution list
|
||||
* * This program is free software; you can redistribute it and/or
|
||||
* * modify it under the terms of the GNU General Public License
|
||||
* * as published by the Free Software Foundation for version 2.
|
||||
* * This program is distributed in the hope that it will be useful,
|
||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* * GNU General Public License for more details.
|
||||
* * Warning: This file may be required into the metaconsole's setup
|
||||
* * Load global vars
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Warning: This file may be required into the metaconsole's setup
|
||||
// Load global vars
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -23,7 +30,7 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
|
|||
return;
|
||||
}
|
||||
|
||||
// Load enterprise extensions
|
||||
// Load enterprise extensions.
|
||||
enterprise_include('godmode/setup/setup_auth.php');
|
||||
|
||||
if (is_ajax()) {
|
||||
|
@ -39,19 +46,35 @@ if (is_ajax()) {
|
|||
|
||||
$type_auth = (string) get_parameter('type_auth', '');
|
||||
|
||||
// field for all types except mysql
|
||||
// Field for all types except mysql.
|
||||
if ($type_auth != 'mysql') {
|
||||
// Fallback to local authentication
|
||||
// Fallback to local authentication.
|
||||
$row = [];
|
||||
$row['name'] = __('Fallback to local authentication').ui_print_help_tip(__('Enable this option if you want to fallback to local authentication when remote (ldap etc...) authentication failed. Only available when \'Save password\' is enabled.'), true);
|
||||
$row['control'] = html_print_checkbox_switch('fallback_local_auth', 1, $config['fallback_local_auth'], true);
|
||||
$row['name'] = __('Fallback to local authentication').ui_print_help_tip(
|
||||
__('Enable this option if you want to fallback to local authentication when remote (ldap etc...) authentication failed. Only available when \'Save password\' is enabled.'),
|
||||
true
|
||||
);
|
||||
$row['control'] = html_print_checkbox_switch(
|
||||
'fallback_local_auth',
|
||||
1,
|
||||
$config['fallback_local_auth'],
|
||||
true
|
||||
);
|
||||
$table->data['fallback_local_auth'] = $row;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
// Autocreate remote users
|
||||
// Autocreate remote users.
|
||||
$row = [];
|
||||
$row['name'] = __('Autocreate remote users');
|
||||
$row['control'] = html_print_checkbox_switch_extended('autocreate_remote_users', 1, $config['autocreate_remote_users'], false, '', '', true).' ';
|
||||
$row['control'] = html_print_checkbox_switch_extended(
|
||||
'autocreate_remote_users',
|
||||
1,
|
||||
$config['autocreate_remote_users'],
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).' ';
|
||||
$table->data['autocreate_remote_users'] = $row;
|
||||
|
||||
add_enterprise_auth_autocreate_profiles($table, $type_auth);
|
||||
|
@ -63,19 +86,33 @@ if (is_ajax()) {
|
|||
break;
|
||||
|
||||
case 'ldap':
|
||||
// LDAP server
|
||||
// LDAP server.
|
||||
$row = [];
|
||||
$row['name'] = __('LDAP server');
|
||||
$row['control'] = html_print_input_text('ldap_server', $config['ldap_server'], '', 30, 100, true);
|
||||
$row['control'] = html_print_input_text(
|
||||
'ldap_server',
|
||||
$config['ldap_server'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table->data['ldap_server'] = $row;
|
||||
|
||||
// LDAP port
|
||||
// LDAP port.
|
||||
$row = [];
|
||||
$row['name'] = __('LDAP port');
|
||||
$row['control'] = html_print_input_text('ldap_port', $config['ldap_port'], '', 10, 100, true);
|
||||
$row['control'] = html_print_input_text(
|
||||
'ldap_port',
|
||||
$config['ldap_port'],
|
||||
'',
|
||||
10,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table->data['ldap_port'] = $row;
|
||||
|
||||
// LDAP version
|
||||
// LDAP version.
|
||||
$ldap_versions = [
|
||||
1 => 'LDAPv1',
|
||||
2 => 'LDAPv2',
|
||||
|
@ -83,37 +120,78 @@ if (is_ajax()) {
|
|||
];
|
||||
$row = [];
|
||||
$row['name'] = __('LDAP version');
|
||||
$row['control'] = html_print_select($ldap_versions, 'ldap_version', $config['ldap_version'], '', '', 0, true);
|
||||
$row['control'] = html_print_select(
|
||||
$ldap_versions,
|
||||
'ldap_version',
|
||||
$config['ldap_version'],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data['ldap_version'] = $row;
|
||||
|
||||
// Start TLS
|
||||
// Start TLS.
|
||||
$row = [];
|
||||
$row['name'] = __('Start TLS');
|
||||
$row['control'] = html_print_checkbox_switch('ldap_start_tls', 1, $config['ldap_start_tls'], true);
|
||||
$row['control'] = html_print_checkbox_switch(
|
||||
'ldap_start_tls',
|
||||
1,
|
||||
$config['ldap_start_tls'],
|
||||
true
|
||||
);
|
||||
$table->data['ldap_start_tls'] = $row;
|
||||
|
||||
// Base DN
|
||||
// Base DN.
|
||||
$row = [];
|
||||
$row['name'] = __('Base DN');
|
||||
$row['control'] = html_print_input_text('ldap_base_dn', $config['ldap_base_dn'], '', 60, 100, true);
|
||||
$row['control'] = html_print_input_text(
|
||||
'ldap_base_dn',
|
||||
$config['ldap_base_dn'],
|
||||
'',
|
||||
60,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table->data['ldap_base_dn'] = $row;
|
||||
|
||||
// Login attribute
|
||||
// Login attribute.
|
||||
$row = [];
|
||||
$row['name'] = __('Login attribute');
|
||||
$row['control'] = html_print_input_text('ldap_login_attr', $config['ldap_login_attr'], '', 60, 100, true);
|
||||
$row['control'] = html_print_input_text(
|
||||
'ldap_login_attr',
|
||||
$config['ldap_login_attr'],
|
||||
'',
|
||||
60,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table->data['ldap_login_attr'] = $row;
|
||||
|
||||
// Admin LDAP login
|
||||
// Admin LDAP login.
|
||||
$row = [];
|
||||
$row['name'] = __('Admin LDAP login');
|
||||
$row['control'] = html_print_input_text('ldap_admin_login', $config['ldap_admin_login'], '', 60, 100, true);
|
||||
$row['control'] = html_print_input_text(
|
||||
'ldap_admin_login',
|
||||
$config['ldap_admin_login'],
|
||||
'',
|
||||
60,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table->data['ldap_admin_login'] = $row;
|
||||
|
||||
// Admin LDAP password
|
||||
// Admin LDAP password.
|
||||
$row = [];
|
||||
$row['name'] = __('Admin LDAP password');
|
||||
$row['control'] = html_print_input_password('ldap_admin_pass', $config['ldap_admin_pass'], $alt = '', 60, 100, true);
|
||||
$row['control'] = html_print_input_password(
|
||||
'ldap_admin_pass',
|
||||
io_output_password($config['ldap_admin_pass']),
|
||||
$alt = '',
|
||||
60,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table->data['ldap_admin_pass'] = $row;
|
||||
break;
|
||||
|
||||
|
@ -121,28 +199,50 @@ if (is_ajax()) {
|
|||
case 'ad':
|
||||
case 'saml':
|
||||
case 'integria':
|
||||
// Add enterprise authentication options
|
||||
// Add enterprise authentication options.
|
||||
if (enterprise_installed()) {
|
||||
add_enterprise_auth_options($table, $type_auth);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default case.
|
||||
break;
|
||||
}
|
||||
|
||||
// field for all types
|
||||
// Enable double authentication
|
||||
// Set default value
|
||||
// Field for all types.
|
||||
// Enable double authentication.
|
||||
// Set default value.
|
||||
set_unless_defined($config['double_auth_enabled'], false);
|
||||
$row = [];
|
||||
$row['name'] = __('Double authentication').ui_print_help_tip(__('If this option is enabled, the users can use double authentication with their accounts'), true);
|
||||
$row['control'] .= html_print_checkbox_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
|
||||
$row['name'] = __('Double authentication').ui_print_help_tip(
|
||||
__('If this option is enabled, the users can use double authentication with their accounts'),
|
||||
true
|
||||
);
|
||||
$row['control'] .= html_print_checkbox_switch(
|
||||
'double_auth_enabled',
|
||||
1,
|
||||
$config['double_auth_enabled'],
|
||||
true
|
||||
);
|
||||
$table->data['double_auth_enabled'] = $row;
|
||||
|
||||
// Session timeout
|
||||
// Default session timeout
|
||||
// Session timeout.
|
||||
// Default session timeout.
|
||||
set_when_empty($config['session_timeout'], 90);
|
||||
$row = [];
|
||||
$row['name'] = __('Session timeout (mins)').ui_print_help_tip(__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'), true);
|
||||
$row['control'] = html_print_input_text('session_timeout', $config['session_timeout'], '', 10, 10, true);
|
||||
$row['name'] = __('Session timeout (mins)').ui_print_help_tip(
|
||||
__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'),
|
||||
true
|
||||
);
|
||||
$row['control'] = html_print_input_text(
|
||||
'session_timeout',
|
||||
$config['session_timeout'],
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
);
|
||||
$table->data['session_timeout'] = $row;
|
||||
|
||||
html_print_table($table);
|
||||
|
@ -159,23 +259,23 @@ $table->class = 'databox filters';
|
|||
$table->size['name'] = '30%';
|
||||
$table->style['name'] = 'font-weight: bold';
|
||||
|
||||
// Auth methods added to the table (doesn't take in account mysql)
|
||||
// Auth methods added to the table (doesn't take in account mysql).
|
||||
$auth_methods_added = [];
|
||||
|
||||
// Remote options row names
|
||||
// Fill this array for every matched row
|
||||
// Remote options row names.
|
||||
// Fill this array for every matched row.
|
||||
$remote_rows = [];
|
||||
|
||||
// Autocreate options row names
|
||||
// Fill this array for every matched row
|
||||
// Autocreate options row names.
|
||||
// Fill this array for every matched row.
|
||||
$autocreate_rows = [];
|
||||
$no_autocreate_rows = [];
|
||||
|
||||
// LDAP data row names
|
||||
// Fill this array for every matched row
|
||||
// LDAP data row names.
|
||||
// Fill this array for every matched row.
|
||||
$ldap_rows = [];
|
||||
|
||||
// Method
|
||||
// Method.
|
||||
$auth_methods = [
|
||||
'mysql' => __('Local %s', get_product_name()),
|
||||
'ldap' => __('ldap'),
|
||||
|
@ -186,16 +286,24 @@ if (enterprise_installed()) {
|
|||
|
||||
$row = [];
|
||||
$row['name'] = __('Authentication method');
|
||||
$row['control'] = html_print_select($auth_methods, 'auth', $config['auth'], '', '', 0, true);
|
||||
$row['control'] = html_print_select(
|
||||
$auth_methods,
|
||||
'auth',
|
||||
$config['auth'],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data['auth'] = $row;
|
||||
|
||||
// Form
|
||||
// Form.
|
||||
echo '<form id="form_setup" method="post">';
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
html_print_input_hidden('update_config', 1);
|
||||
} else {
|
||||
// To use it in the metasetup
|
||||
// To use it in the metasetup.
|
||||
html_print_input_hidden('action', 'save');
|
||||
html_print_input_hidden('hash_save_config', md5('save'.$config['dbpass']));
|
||||
}
|
||||
|
@ -203,7 +311,12 @@ if (!is_metaconsole()) {
|
|||
html_print_table($table);
|
||||
echo '<div id="table_auth_result"></div>';
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
?>
|
||||
|
|
|
@ -60,7 +60,10 @@ if (users_is_admin()) {
|
|||
}
|
||||
|
||||
if (!$action_update_url_update_manager) {
|
||||
$url_update_manager = get_parameter('url_update_manager', $config['url_update_manager']);
|
||||
$url_update_manager = get_parameter(
|
||||
'url_update_manager',
|
||||
$config['url_update_manager']
|
||||
);
|
||||
$update_manager_proxy_server = get_parameter(
|
||||
'update_manager_proxy_server',
|
||||
$config['update_manager_proxy_server']
|
||||
|
@ -162,7 +165,7 @@ if (!$action_update_url_update_manager) {
|
|||
if ($result) {
|
||||
$result = config_update_value(
|
||||
'update_manager_proxy_password',
|
||||
$update_manager_proxy_password
|
||||
io_input_password($update_manager_proxy_password)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -179,6 +182,7 @@ if (!$action_update_url_update_manager) {
|
|||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup">';
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
|
@ -259,6 +263,7 @@ if (license_free()) {
|
|||
}
|
||||
|
||||
html_print_input_hidden('action_update_url_update_manager', 1);
|
||||
html_print_input_hidden('update_config', 1);
|
||||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC200218';
|
||||
$build_version = 'PC200220';
|
||||
$pandora_version = 'v7.0NG.743';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -148,7 +148,8 @@ function config_update_config()
|
|||
|
||||
$error_update = [];
|
||||
|
||||
$sec2 = get_parameter_get('sec2');
|
||||
$sec2 = get_parameter('sec2');
|
||||
|
||||
switch ($sec2) {
|
||||
case 'godmode/setup/setup':
|
||||
$section_setup = get_parameter('section');
|
||||
|
@ -350,7 +351,7 @@ function config_update_config()
|
|||
$error_update[] = __('Email user');
|
||||
}
|
||||
|
||||
if (!config_update_value('email_password', get_parameter('email_password'))) {
|
||||
if (!config_update_value('email_password', io_input_password(get_parameter('email_password')))) {
|
||||
$error_update[] = __('Email password');
|
||||
}
|
||||
|
||||
|
@ -608,7 +609,7 @@ function config_update_config()
|
|||
$error_update[] = __('Admin LDAP login');
|
||||
}
|
||||
|
||||
if (!config_update_value('ldap_admin_pass', get_parameter('ldap_admin_pass'))) {
|
||||
if (!config_update_value('ldap_admin_pass', io_input_password(get_parameter('ldap_admin_pass')))) {
|
||||
$error_update[] = __('Admin LDAP password');
|
||||
}
|
||||
|
||||
|
@ -1315,10 +1316,6 @@ function config_update_config()
|
|||
$error_update[] = __('PDF font size (px)');
|
||||
}
|
||||
|
||||
if (!config_update_value('interval_description', (string) get_parameter('interval_description', 'large'))) {
|
||||
$error_update[] = __('Interval description');
|
||||
}
|
||||
|
||||
if (!config_update_value('custom_report_front', get_parameter('custom_report_front'))) {
|
||||
$error_update[] = __('Custom report front');
|
||||
}
|
||||
|
@ -1961,6 +1958,14 @@ function config_process_config()
|
|||
* Parse the ACL IP list for access API
|
||||
*/
|
||||
|
||||
$temp_list_ACL_IPs_for_API = [];
|
||||
if (isset($config['list_ACL_IPs_for_API'])) {
|
||||
if (!empty($config['list_ACL_IPs_for_API'])) {
|
||||
$temp_list_ACL_IPs_for_API = explode(';', $config['list_ACL_IPs_for_API']);
|
||||
}
|
||||
}
|
||||
|
||||
$config['list_ACL_IPs_for_API'] = $temp_list_ACL_IPs_for_API;
|
||||
$keysConfig = array_keys($config);
|
||||
|
||||
/*
|
||||
|
@ -2867,14 +2872,6 @@ function config_process_config()
|
|||
config_update_value('font_size_item_report', 2);
|
||||
}
|
||||
|
||||
if (!isset($config['global_font_size_report'])) {
|
||||
config_update_value('global_font_size_report', 14);
|
||||
}
|
||||
|
||||
if (!isset($config['interval_description'])) {
|
||||
config_update_value('interval_description', 'large');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_report_front_font'])) {
|
||||
config_update_value('custom_report_front_font', 'FreeSans.ttf');
|
||||
}
|
||||
|
@ -3030,15 +3027,6 @@ function config_process_config()
|
|||
|
||||
// Finally, check if any value was overwritten in a form.
|
||||
config_update_config();
|
||||
|
||||
$temp_list_ACL_IPs_for_API = [];
|
||||
if (isset($config['list_ACL_IPs_for_API'])) {
|
||||
if (!empty($config['list_ACL_IPs_for_API'])) {
|
||||
$temp_list_ACL_IPs_for_API = explode(';', $config['list_ACL_IPs_for_API']);
|
||||
}
|
||||
}
|
||||
|
||||
$config['list_ACL_IPs_for_API'] = $temp_list_ACL_IPs_for_API;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1521,8 +1521,10 @@ function paint_graph_status(
|
|||
//delete elements
|
||||
svg.selectAll("g").remove();
|
||||
|
||||
width_x = 101;
|
||||
height_x = 50;
|
||||
var width_x = 101;
|
||||
var height_x = 50;
|
||||
var legend_width_x = 135;
|
||||
var legend_height_x = 80;
|
||||
|
||||
svg
|
||||
.append("g")
|
||||
|
@ -1535,8 +1537,8 @@ function paint_graph_status(
|
|||
.attr("width", 300)
|
||||
.attr("height", 300)
|
||||
.append("text")
|
||||
.attr("x", width_x)
|
||||
.attr("y", height_x - 20)
|
||||
.attr("x", legend_width_x + 15)
|
||||
.attr("y", legend_height_x - 20)
|
||||
.attr("fill", "black")
|
||||
.style("font-family", "arial")
|
||||
.style("font-weight", "bold")
|
||||
|
@ -1551,8 +1553,8 @@ function paint_graph_status(
|
|||
.append("g")
|
||||
.append("rect")
|
||||
.attr("id", "legend_normal")
|
||||
.attr("x", width_x + 80)
|
||||
.attr("y", height_x - 30)
|
||||
.attr("x", legend_width_x)
|
||||
.attr("y", legend_height_x - 30)
|
||||
.attr("width", 10)
|
||||
.attr("height", 10)
|
||||
.style("fill", "#82B92E");
|
||||
|
@ -1561,8 +1563,8 @@ function paint_graph_status(
|
|||
svg
|
||||
.append("g")
|
||||
.append("text")
|
||||
.attr("x", width_x + 100)
|
||||
.attr("y", height_x - 20)
|
||||
.attr("x", legend_width_x + 15)
|
||||
.attr("y", legend_height_x + 5)
|
||||
.attr("fill", "black")
|
||||
.style("font-family", "arial")
|
||||
.style("font-weight", "bold")
|
||||
|
@ -1575,8 +1577,8 @@ function paint_graph_status(
|
|||
.append("g")
|
||||
.append("rect")
|
||||
.attr("id", "legend_warning")
|
||||
.attr("x", width_x + 185)
|
||||
.attr("y", height_x - 30)
|
||||
.attr("x", legend_width_x)
|
||||
.attr("y", legend_height_x - 5)
|
||||
.attr("width", 10)
|
||||
.attr("height", 10)
|
||||
.style("fill", "#ffd731");
|
||||
|
@ -1585,8 +1587,8 @@ function paint_graph_status(
|
|||
svg
|
||||
.append("g")
|
||||
.append("text")
|
||||
.attr("x", width_x + 205)
|
||||
.attr("y", height_x - 20)
|
||||
.attr("x", legend_width_x + 15)
|
||||
.attr("y", legend_height_x + 30)
|
||||
.attr("fill", "black")
|
||||
.style("font-family", "arial")
|
||||
.style("font-weight", "bold")
|
||||
|
@ -1599,8 +1601,8 @@ function paint_graph_status(
|
|||
.append("g")
|
||||
.append("rect")
|
||||
.attr("id", "legend_critical")
|
||||
.attr("x", width_x + 285)
|
||||
.attr("y", height_x - 30)
|
||||
.attr("x", legend_width_x)
|
||||
.attr("y", legend_height_x + 20)
|
||||
.attr("width", 10)
|
||||
.attr("height", 10)
|
||||
.style("fill", "#e63c52");
|
||||
|
@ -1624,7 +1626,7 @@ function paint_graph_status(
|
|||
.attr("id", "status_rect")
|
||||
.attr("x", width_x)
|
||||
.attr("y", height_x)
|
||||
.attr("width", 300)
|
||||
.attr("width", 20)
|
||||
.attr("height", 200)
|
||||
.style("fill", "#82B92E");
|
||||
|
||||
|
@ -1641,7 +1643,7 @@ function paint_graph_status(
|
|||
"y",
|
||||
height_x + (range_max - min_w) * position - (max_w - min_w) * position
|
||||
)
|
||||
.attr("width", 300)
|
||||
.attr("width", 20)
|
||||
.attr("height", (max_w - min_w) * position)
|
||||
.style("fill", "#ffd731");
|
||||
} else {
|
||||
|
@ -1653,7 +1655,7 @@ function paint_graph_status(
|
|||
.attr("id", "warning_rect")
|
||||
.attr("x", width_x)
|
||||
.attr("y", height_x + 200 - (min_w - range_min) * position)
|
||||
.attr("width", 300)
|
||||
.attr("width", 20)
|
||||
.attr("height", (min_w - range_min) * position)
|
||||
.style("fill", "#ffd731");
|
||||
|
||||
|
@ -1665,7 +1667,7 @@ function paint_graph_status(
|
|||
.attr("id", "warning_inverse_rect")
|
||||
.attr("x", width_x)
|
||||
.attr("y", height_x)
|
||||
.attr("width", 300)
|
||||
.attr("width", 20)
|
||||
.attr(
|
||||
"height",
|
||||
(range_max - min_w) * position - (max_w - min_w) * position
|
||||
|
@ -1685,7 +1687,7 @@ function paint_graph_status(
|
|||
"y",
|
||||
height_x + (range_max - min_c) * position - (max_c - min_c) * position
|
||||
)
|
||||
.attr("width", 300)
|
||||
.attr("width", 20)
|
||||
.attr("height", (max_c - min_c) * position)
|
||||
.style("fill", "#e63c52");
|
||||
} else {
|
||||
|
@ -1697,7 +1699,7 @@ function paint_graph_status(
|
|||
.attr("id", "critical_rect")
|
||||
.attr("x", width_x)
|
||||
.attr("y", height_x + 200 - (min_c - range_min) * position)
|
||||
.attr("width", 300)
|
||||
.attr("width", 20)
|
||||
.attr("height", (min_c - range_min) * position)
|
||||
.style("fill", "#e63c52");
|
||||
svg
|
||||
|
@ -1708,7 +1710,7 @@ function paint_graph_status(
|
|||
.attr("id", "critical_inverse_rect")
|
||||
.attr("x", width_x)
|
||||
.attr("y", height_x)
|
||||
.attr("width", 300)
|
||||
.attr("width", 20)
|
||||
.attr(
|
||||
"height",
|
||||
(range_max - min_c) * position - (max_c - min_c) * position
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.743';
|
||||
$build = '200218';
|
||||
$build = '200220';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.743
|
||||
%define release 200218
|
||||
%define release 200220
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.743
|
||||
%define release 200218
|
||||
%define release 200220
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.743
|
||||
%define release 200218
|
||||
%define release 200220
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -2579,7 +2579,7 @@ CREATE TABLE IF NOT EXISTS `ttrap_custom_values` (
|
|||
-- Table `tmetaconsole_setup`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tmetaconsole_setup` (
|
||||
`id` int(10) NOT NULL auto_increment primary key,
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`server_name` text,
|
||||
`server_url` text,
|
||||
`dbuser` text,
|
||||
|
@ -2596,7 +2596,9 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_setup` (
|
|||
`id_group` int(10) unsigned NOT NULL default 0,
|
||||
`api_password` text NOT NULL,
|
||||
`disabled` tinyint(1) unsigned NOT NULL default '0',
|
||||
`last_event_replication` bigint(20) default '0'
|
||||
`last_event_replication` bigint(20) default '0',
|
||||
`server_uid` text NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB
|
||||
COMMENT = 'Table to store metaconsole sources'
|
||||
DEFAULT CHARSET=utf8;
|
||||
|
|
|
@ -141,7 +141,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('cr_incident_content', ''),
|
||||
('sample_agent', '0'),
|
||||
('gotty', '/usr/bin/gotty'),
|
||||
('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}');
|
||||
('custom_module_units', '{"bytes":"bytes","entries":"entries","files":"files","hits":"hits","sessions":"sessions","users":"users","ºC":"ºC","ºF":"ºF"}'),
|
||||
('server_unique_identifier', replace(uuid(),'-',''));
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.743-200218
|
||||
Version: 7.0NG.743-200220
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.743-200218"
|
||||
pandora_version="7.0NG.743-200220"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.743";
|
||||
my $pandora_build = "200218";
|
||||
my $pandora_build = "200220";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -33,7 +33,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.743";
|
||||
my $pandora_build = "200218";
|
||||
my $pandora_build = "200220";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.743
|
||||
%define release 200218
|
||||
%define release 200220
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.743
|
||||
%define release 200218
|
||||
%define release 200220
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.743"
|
||||
PI_BUILD="200218"
|
||||
PI_BUILD="200220"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.743 PS200218";
|
||||
my $version = "7.0NG.743 PS200220";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.743 PS200218";
|
||||
my $version = "7.0NG.743 PS200220";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue