Merge remote-tracking branch 'origin/develop' into features/oracle

This commit is contained in:
Alejandro Gallardo Escobar 2015-06-18 20:02:01 +02:00
commit 3b037caf32
222 changed files with 3634 additions and 3474 deletions

View File

@ -0,0 +1,49 @@
%define name wmic
%define version 4.0.0tp4.rbn
Summary: Linux WMI client to do WMI querys using DCOM http://samba.org
Name: %{name}
Version: %{version}
Release: 1
License: GPL2
Group: System/Management
Packager: Robert B. Nelson <robertn@the-nelsons.org>
Source: http://www.openvas.org/download/wmi/wmi-1.3.14.tar.bz2
Patch1: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch
Patch2: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch2
Patch3: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch3v2
Patch4: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch4
Patch5: http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch5
BuildRoot: %{_tmppath}/%{name}-%{version}-build
AutoReq: 1
Provides: %{name}-%{version}
%description
Linux WMI client to do WMI querys. More information at SAMBA4 project at http://www.samba.org/
%prep
rm -rf $RPM_BUILD_ROOT
%setup -n wmi-1.3.14
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
cd Samba/source
./autogen.sh
./configure --without-readline --enable-debug
make "CPP=gcc -E -ffreestanding" proto bin/wmic
%install
mkdir -p $RPM_BUILD_ROOT/usr/bin/
install Samba/source/bin/wmic $RPM_BUILD_ROOT%{_bindir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%{_bindir}/wmic

View File

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

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="6.0dev-150602" pandora_version="6.0dev-150618"
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

@ -68,6 +68,9 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local # Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default). # Server password (Tentacle or FTP). Leave empty for no password (default).
#server_pwd mypassword #server_pwd mypassword
@ -120,6 +123,7 @@ transfer_mode tentacle
#secondary_server_path /var/spool/pandora/data_in #secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121 #secondary_server_port 41121
#secondary_transfer_mode tentacle #secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword #secondary_server_pwd mypassword
#secondary_server_ssl no #secondary_server_ssl no
#secondary_server_opts #secondary_server_opts

View File

@ -94,6 +94,9 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local # Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default). # Server password (Tentacle or FTP). Leave empty for no password (default).
#server_pwd mypassword #server_pwd mypassword
@ -154,6 +157,7 @@ temporal_min_size 1024
#secondary_server_path /var/spool/pandora/data_in #secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121 #secondary_server_port 41121
#secondary_transfer_mode tentacle #secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword #secondary_server_pwd mypassword
#secondary_server_ssl no #secondary_server_ssl no
#secondary_server_opts #secondary_server_opts

View File

@ -64,6 +64,9 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local # Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default). # Server password (Tentacle or FTP). Leave empty for no password (default).
#server_pwd mypassword #server_pwd mypassword
@ -116,6 +119,7 @@ transfer_mode tentacle
#secondary_server_path /var/spool/pandora/data_in #secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121 #secondary_server_port 41121
#secondary_transfer_mode tentacle #secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword #secondary_server_pwd mypassword
#secondary_server_ssl no #secondary_server_ssl no
#secondary_server_opts #secondary_server_opts

View File

@ -58,6 +58,9 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local # Transfer mode: tentacle, ftp, ssh or local
transfer_mode tentacle transfer_mode tentacle
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# Server password (Tentacle or FTP). Leave empty for no password (default). # Server password (Tentacle or FTP). Leave empty for no password (default).
#server_pwd mypassword #server_pwd mypassword
@ -107,6 +110,7 @@ transfer_mode tentacle
#secondary_server_path /var/spool/pandora/data_in #secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121 #secondary_server_port 41121
#secondary_transfer_mode tentacle #secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword #secondary_server_pwd mypassword
#secondary_server_ssl no #secondary_server_ssl no
#secondary_server_opts #secondary_server_opts

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0dev'; use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150602'; use constant AGENT_BUILD => '150618';
# Commands to retrieve total memory information in kB # Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => { use constant TOTALMEMORY_CMDS => {
@ -510,6 +510,9 @@ sub parse_conf_modules($) {
# Make the module run the first time # Make the module run the first time
$module->{'counter'} = $module->{'intensive_interval'}; $module->{'counter'} = $module->{'intensive_interval'};
# Replace macros
replace_macros ($module);
push (@Modules, {%{$module}}); push (@Modules, {%{$module}});
} else { } else {
$module->{'func'} = \&module_plugin; $module->{'func'} = \&module_plugin;
@ -601,15 +604,19 @@ sub write_broker_conf($){
my ($broker_agent) = @_; my ($broker_agent) = @_;
my $content = ''; my $content = '';
# I don't think the following should be copied either: proxy_*
my %ignored_tokens = (
'broker_agent' => 1, 'agent_name_cmd' => 1, 'udp_server' => 1, 'cron_mode' => 1
);
open (CONF_FILE, "$ConfDir/$ConfFile") or error ("Could not open file '$ConfDir/$ConfFile': $!."); open (CONF_FILE, "$ConfDir/$ConfFile") or error ("Could not open file '$ConfDir/$ConfFile': $!.");
open (BROKER_FILE, ">$ConfDir/${broker_agent}.conf") or error ("Could not write configuration file: $!"); open (BROKER_FILE, ">$ConfDir/${broker_agent}.conf") or error ("Could not write configuration file: $!");
while (my $line = <CONF_FILE>) { while (my $line = <CONF_FILE>) {
# Skip broker definitions my ( $token ) = $line =~ m/^\s*(\S+)(\s.*)?$/;
if ($line =~ m/^\s*broker_agent/) { # Skip tokens which should not be copied to broker configuration
next; next if defined $ignored_tokens{$token};
}
# Change the agent name # Change the agent name
if ($line =~ m/^\s*#*\s*agent_name\s+/) { if ($line =~ m/^\s*#*\s*agent_name\s+/) {
@ -647,19 +654,6 @@ sub read_config (;$) {
# Replace CRLF with LF # Replace CRLF with LF
$line =~ s/\r\n/\n/g; $line =~ s/\r\n/\n/g;
# Store the custom fields
if (($line =~ m/^(custom_field\d+_name)\s+(.*)/) or ($line =~ m/^(custom_field\d+_value)\s+(.*)/)) {
$Customfields{$1} = $2;
next;
}
# Save global macros
if ($line =~ m/^macro(\S+)\s+(.*)/) {
$Macros{$1} = $2;
next;
}
# Token search # Token search
if (defined ($token)) { if (defined ($token)) {
if ($line =~ /^\s*(\S+)\s+(.*)$/ && $1 eq $token) { if ($line =~ /^\s*(\S+)\s+(.*)$/ && $1 eq $token) {
@ -675,6 +669,20 @@ sub read_config (;$) {
} }
next; next;
} }
# Store the custom fields
if (($line =~ m/^(custom_field\d+_name)\s+(.*)/) or ($line =~ m/^(custom_field\d+_value)\s+(.*)/)) {
$Customfields{$1} = $2;
next;
}
# Save global macros
if ($line =~ m/^macro(\S+)\s+(.*)/) {
$Macros{$1} = $2;
next;
}
next if ($line =~ /^module\s*\w*/); next if ($line =~ /^module\s*\w*/);
#Configuration token #Configuration token
@ -872,7 +880,7 @@ sub send_buffered_xml_files () {
while (my $xml_file = readdir(TEMPORAL)) { while (my $xml_file = readdir(TEMPORAL)) {
# Skip non data files and symlinks # Skip non data files and symlinks
next if ($xml_file !~ m/\.data$/ || -l "$Conf{'temporal'}/$xml_file"); next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$Conf{'temporal'}/$xml_file");
my $rc = send_file ("$Conf{'temporal'}/$xml_file", 1); my $rc = send_file ("$Conf{'temporal'}/$xml_file", 1);
unlink ("$Conf{'temporal'}/$xml_file") if ($rc == 0); unlink ("$Conf{'temporal'}/$xml_file") if ($rc == 0);

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0dev %define version 6.0dev
%define release 150602 %define release 150618
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}
@ -51,11 +51,6 @@ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_R
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
# Checking old config file (if exists)
if [ -f /etc/pandora/pandora_agent.conf ] ; then
mv /etc/pandora/pandora_agent.conf /etc/pandora/pandora_agent.conf.backup
fi
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0dev %define version 6.0dev
%define release 150602 %define release 150618
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}
@ -51,16 +51,11 @@ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_R
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
# Checking old config file (if exists)
if [ -f /etc/pandora/pandora_agent.conf ] ; then
mv /etc/pandora/pandora_agent.conf /etc/pandora/pandora_agent.conf.backup
fi
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then #if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec # rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
fi #fi
%clean %clean
rm -Rf $RPM_BUILD_ROOT rm -Rf $RPM_BUILD_ROOT

View File

@ -62,6 +62,9 @@ interval 300
transfer_mode tentacle transfer_mode tentacle
server_port 41121 server_port 41121
# timeout in seconds for file transfer programs execution (30 by default)
#transfer_timeout 30
# In case of using FTP or tentacle with password. User is always "pandora" # In case of using FTP or tentacle with password. User is always "pandora"
#server_pwd pandora #server_pwd pandora
@ -98,6 +101,7 @@ xml_buffer 1
#secondary_server_path /var/spool/pandora/data_in #secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121 #secondary_server_port 41121
#secondary_transfer_mode tentacle #secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword #secondary_server_pwd mypassword
#secondary_server_ssl no #secondary_server_ssl no
#secondary_server_opts #secondary_server_opts

View File

@ -107,7 +107,7 @@ read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
*/ */
int int
Pandora_Ftp_Client::ftpFileFilename (const string remote_filename, Pandora_Ftp_Client::ftpFileFilename (const string remote_filename,
const string filepath) const string filepath, int timeout)
{ {
FILE *fd; FILE *fd;
string operation1; string operation1;
@ -155,8 +155,8 @@ Pandora_Ftp_Client::ftpFileFilename (const string remote_filename,
curl_easy_setopt (this->curl, CURLOPT_UPLOAD, 1) ; curl_easy_setopt (this->curl, CURLOPT_UPLOAD, 1) ;
curl_easy_setopt (this->curl, CURLOPT_URL, url.c_str ()); curl_easy_setopt (this->curl, CURLOPT_URL, url.c_str ());
curl_easy_setopt (this->curl, CURLOPT_POSTQUOTE, headerlist); curl_easy_setopt (this->curl, CURLOPT_POSTQUOTE, headerlist);
curl_easy_setopt (this->curl, CURLOPT_TIMEOUT, 240); curl_easy_setopt (this->curl, CURLOPT_TIMEOUT, timeout * 4);
curl_easy_setopt (this->curl, CURLOPT_FTP_RESPONSE_TIMEOUT, 60); curl_easy_setopt (this->curl, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout);
curl_easy_setopt (this->curl, CURLOPT_READFUNCTION, read_func); curl_easy_setopt (this->curl, CURLOPT_READFUNCTION, read_func);
curl_easy_setopt (this->curl, CURLOPT_READDATA, fd); curl_easy_setopt (this->curl, CURLOPT_READDATA, fd);
curl_easy_setopt (curl, CURLOPT_INFILESIZE_LARGE, curl_easy_setopt (curl, CURLOPT_INFILESIZE_LARGE,

View File

@ -72,7 +72,7 @@ namespace FTP {
void disconnect (); void disconnect ();
int ftpFileFilename (const string remote_filename, int ftpFileFilename (const string remote_filename,
const string filepath); const string filepath, int timeout);
string getError (); string getError ();
}; };

View File

@ -79,10 +79,16 @@ Pandora_FTP_Test::test () {
char *err; char *err;
DIR *dir; DIR *dir;
FILE *conf_fh = NULL; FILE *conf_fh = NULL;
int timeout;
remote_host = this->conf->getValue ("server_ip"); remote_host = this->conf->getValue ("server_ip");
cout << "Connecting with " << remote_host << "..." << endl; cout << "Connecting with " << remote_host << "..." << endl;
password = this->conf->getValue ("server_pwd"); password = this->conf->getValue ("server_pwd");
timeout = atoi (conf->getValue ("transfer_timeout").c_str ());
if (timeout == 0) {
timeout = 30;
}
if (password == "") { if (password == "") {
cout << "FTP password not found in configuration file." << endl; cout << "FTP password not found in configuration file." << endl;
cout << "Check that server_pwd variable is set." << endl; cout << "Check that server_pwd variable is set." << endl;
@ -136,7 +142,7 @@ Pandora_FTP_Test::test () {
try { try {
ftp_client->ftpFileFilename (remote_filepath + tmp_filename, ftp_client->ftpFileFilename (remote_filepath + tmp_filename,
tmp_filepath); tmp_filepath, timeout);
} catch (FTP::Unknown_Host e) { } catch (FTP::Unknown_Host e) {
cout << "Failed when copying to " << remote_host << " (" << cout << "Failed when copying to " << remote_host << " (" <<
ftp_client->getError () << ")" << endl; ftp_client->getError () << ")" << endl;

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{150602} {150618}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

@ -687,14 +687,14 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
string port, string port,
string ssl, string ssl,
string pass, string pass,
string opts) string opts,
int timeout)
{ {
DWORD rc; DWORD rc;
string var, filepath; string var, filepath;
string tentacle_cmd, working_dir; string tentacle_cmd, working_dir;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
STARTUPINFO si; STARTUPINFO si;
int tentacle_timeout = 0;
var = conf->getValue ("temporal"); var = conf->getValue ("temporal");
if (var[var.length () - 1] != '\\') { if (var[var.length () - 1] != '\\') {
@ -740,17 +740,16 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
CloseHandle (pi.hThread); CloseHandle (pi.hThread);
/* Timeout */ /* Timeout */
tentacle_timeout = atoi (conf->getValue ("tentacle_timeout").c_str ()); if (timeout <= 0) {
if (tentacle_timeout <= 0) { timeout = 30;
tentacle_timeout = INFINITE;
} else {
/* Convert to milliseconds */
tentacle_timeout *= 1000;
} }
/* Convert to milliseconds */
timeout *= 1000;
if (WaitForSingleObject(pi.hProcess, tentacle_timeout) == WAIT_TIMEOUT) { if (WaitForSingleObject(pi.hProcess, timeout) == WAIT_TIMEOUT) {
TerminateProcess(pi.hProcess, STILL_ACTIVE); TerminateProcess(pi.hProcess, STILL_ACTIVE);
CloseHandle (pi.hProcess); CloseHandle (pi.hProcess);
pandoraLog ("Pandora Agent: Failed when copying to %s (tentacle timeout)", host.c_str ());
return -1; return -1;
} }
@ -758,6 +757,8 @@ Pandora_Windows_Service::copyTentacleDataFile (string host,
GetExitCodeProcess (pi.hProcess, &rc); GetExitCodeProcess (pi.hProcess, &rc);
if (rc != 0) { if (rc != 0) {
CloseHandle (pi.hProcess); CloseHandle (pi.hProcess);
pandoraLog ("Pandora Agent: Failed when copying to %s",
host.c_str ());
return -1; return -1;
} }
@ -770,6 +771,8 @@ Pandora_Windows_Service::copyScpDataFile (string host,
string remote_path, string remote_path,
string filename) string filename)
{ {
/* TODO: timeout implementation */
int rc = 0; int rc = 0;
SSH::Pandora_Ssh_Client ssh_client; SSH::Pandora_Ssh_Client ssh_client;
string tmp_dir, filepath,port_str; string tmp_dir, filepath,port_str;
@ -830,7 +833,8 @@ int
Pandora_Windows_Service::copyFtpDataFile (string host, Pandora_Windows_Service::copyFtpDataFile (string host,
string remote_path, string remote_path,
string filename, string filename,
string password) string password,
int timeout)
{ {
int rc = 0; int rc = 0;
FTP::Pandora_Ftp_Client ftp_client; FTP::Pandora_Ftp_Client ftp_client;
@ -856,7 +860,7 @@ Pandora_Windows_Service::copyFtpDataFile (string host,
password); password);
rc = ftp_client.ftpFileFilename (remote_path + filename, rc = ftp_client.ftpFileFilename (remote_path + filename,
filepath); filepath, timeout);
if (rc == UNKNOWN_HOST) { if (rc == UNKNOWN_HOST) {
pandoraLog ("Pandora Agent: Failed when copying to %s (%s)", pandoraLog ("Pandora Agent: Failed when copying to %s (%s)",
host.c_str (), ftp_client.getError ().c_str ()); host.c_str (), ftp_client.getError ().c_str ());
@ -882,13 +886,18 @@ Pandora_Windows_Service::copyFtpDataFile (string host,
int int
Pandora_Windows_Service::copyDataFile (string filename) Pandora_Windows_Service::copyDataFile (string filename)
{ {
int rc = 0; int rc = 0, timeout;
unsigned char copy_to_secondary = 0; unsigned char copy_to_secondary = 0;
string mode, host, remote_path; string mode, host, remote_path;
mode = conf->getValue ("transfer_mode"); mode = conf->getValue ("transfer_mode");
host = conf->getValue ("server_ip"); host = conf->getValue ("server_ip");
remote_path = conf->getValue ("server_path"); remote_path = conf->getValue ("server_path");
timeout = atoi (conf->getValue ("transfer_timeout").c_str ());
if (timeout == 0) {
timeout = 30;
}
// Fix remote path // Fix remote path
if (mode != "local" && remote_path[remote_path.length () - 1] != '/') { if (mode != "local" && remote_path[remote_path.length () - 1] != '/') {
remote_path += "/"; remote_path += "/";
@ -897,11 +906,11 @@ Pandora_Windows_Service::copyDataFile (string filename)
} }
if (mode == "ftp") { if (mode == "ftp") {
rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("server_pwd")); rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("server_pwd"), timeout);
} else if (mode == "tentacle" || mode == "") { } else if (mode == "tentacle" || mode == "") {
rc = copyTentacleDataFile (host, filename, conf->getValue ("server_port"), rc = copyTentacleDataFile (host, filename, conf->getValue ("server_port"),
conf->getValue ("server_ssl"), conf->getValue ("server_pwd"), conf->getValue ("server_ssl"), conf->getValue ("server_pwd"),
conf->getValue ("server_opts")); conf->getValue ("server_opts"), timeout);
} else if (mode == "ssh") { } else if (mode == "ssh") {
rc =copyScpDataFile (host, remote_path, filename); rc =copyScpDataFile (host, remote_path, filename);
} else if (mode == "local") { } else if (mode == "local") {
@ -932,6 +941,10 @@ Pandora_Windows_Service::copyDataFile (string filename)
mode = conf->getValue ("secondary_transfer_mode"); mode = conf->getValue ("secondary_transfer_mode");
host = conf->getValue ("secondary_server_ip"); host = conf->getValue ("secondary_server_ip");
remote_path = conf->getValue ("secondary_server_path"); remote_path = conf->getValue ("secondary_server_path");
timeout = atoi (conf->getValue ("secondary_transfer_timeout").c_str ());
if (timeout == 0) {
timeout = 30;
}
// Fix remote path // Fix remote path
if (mode != "local" && remote_path[remote_path.length () - 1] != '/') { if (mode != "local" && remote_path[remote_path.length () - 1] != '/') {
@ -942,11 +955,11 @@ Pandora_Windows_Service::copyDataFile (string filename)
// Send the file to the secondary server // Send the file to the secondary server
if (mode == "ftp") { if (mode == "ftp") {
rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("secondary_server_pwd")); rc = copyFtpDataFile (host, remote_path, filename, conf->getValue ("secondary_server_pwd"), timeout);
} else if (mode == "tentacle" || mode == "") { } else if (mode == "tentacle" || mode == "") {
rc = copyTentacleDataFile (host, filename, conf->getValue ("secondary_server_port"), rc = copyTentacleDataFile (host, filename, conf->getValue ("secondary_server_port"),
conf->getValue ("secondary_server_ssl"), conf->getValue ("secondary_server_pwd"), conf->getValue ("secondary_server_ssl"), conf->getValue ("secondary_server_pwd"),
conf->getValue ("secondary_server_opts")); conf->getValue ("secondary_server_opts"), timeout);
} else if (mode == "ssh") { } else if (mode == "ssh") {
rc = copyScpDataFile (host, remote_path, filename); rc = copyScpDataFile (host, remote_path, filename);
} else { } else {
@ -965,11 +978,14 @@ Pandora_Windows_Service::copyDataFile (string filename)
void void
Pandora_Windows_Service::recvTentacleDataFile (string host, Pandora_Windows_Service::recvTentacleDataFile (string host,
string filename) string filename,
int timeout)
{ {
int rc; DWORD rc;
string var; string var;
string tentacle_cmd; string tentacle_cmd;
PROCESS_INFORMATION pi;
STARTUPINFO si;
/* Change directory to "temporal" */ /* Change directory to "temporal" */
var = conf->getValue ("temporal"); var = conf->getValue ("temporal");
@ -1008,42 +1024,58 @@ Pandora_Windows_Service::recvTentacleDataFile (string host,
filename.c_str (), host.c_str ()); filename.c_str (), host.c_str ());
pandoraDebug ("Command %s", tentacle_cmd.c_str()); pandoraDebug ("Command %s", tentacle_cmd.c_str());
rc = system (tentacle_cmd.c_str()); ZeroMemory (&si, sizeof (si));
switch (rc) { ZeroMemory (&pi, sizeof (pi));
if (CreateProcess (NULL , (CHAR *)tentacle_cmd.c_str (), NULL, NULL, FALSE,
/* system() error */ CREATE_NO_WINDOW, NULL, NULL, &si, &pi) == 0) {
case -1: return;
pandoraLog ("Unable to receive file %s", filename.c_str ());
throw Pandora_Exception ();
/* tentacle_client.exe returned OK */
case 0:
break;
/* tentacle_client.exe error */
default:
pandoraDebug ("Tentacle client was unable to receive file %s",
filename.c_str ());
throw Pandora_Exception ();
} }
/* close thread handle, because it won't be used */
CloseHandle (pi.hThread);
/* Timeout */
if (timeout <= 0) {
timeout = 30;
}
/* Convert to milliseconds */
timeout *= 1000;
if (WaitForSingleObject(pi.hProcess, timeout) == WAIT_TIMEOUT) {
TerminateProcess(pi.hProcess, STILL_ACTIVE);
CloseHandle (pi.hProcess);
pandoraLog ("Unable to receive file %s (tentacle timeout)", filename.c_str ());
return;
}
/* Get the return code of the tentacle client*/
GetExitCodeProcess (pi.hProcess, &rc);
if (rc != 0) {
CloseHandle (pi.hProcess);
pandoraLog ("Unable to receive file %s", filename.c_str ());
return;
}
CloseHandle (pi.hProcess);
return; return;
} }
void void
Pandora_Windows_Service::recvDataFile (string filename) { Pandora_Windows_Service::recvDataFile (string filename) {
string mode, host, remote_path; string mode, host, remote_path;
int timeout;
mode = conf->getValue ("transfer_mode"); mode = conf->getValue ("transfer_mode");
host = conf->getValue ("server_ip"); host = conf->getValue ("server_ip");
remote_path = conf->getValue ("server_path"); remote_path = conf->getValue ("server_path");
timeout = atoi (conf->getValue ("transfer_timeout").c_str ());
if (remote_path[remote_path.length () - 1] != '/') { if (remote_path[remote_path.length () - 1] != '/') {
remote_path += "/"; remote_path += "/";
} }
try { try {
if (mode == "tentacle") { if (mode == "tentacle") {
recvTentacleDataFile (host, filename); recvTentacleDataFile (host, filename, timeout);
} else { } else {
pandoraLog ("Transfer mode %s does not support file retrieval.", mode.c_str () ); pandoraLog ("Transfer mode %s does not support file retrieval.", mode.c_str () );
throw Pandora_Exception (); throw Pandora_Exception ();

View File

@ -61,19 +61,22 @@ namespace Pandora {
string port, string port,
string ssl, string ssl,
string pass, string pass,
string opts); string opts,
int timeout);
int copyScpDataFile (string host, int copyScpDataFile (string host,
string remote_path, string remote_path,
string filename); string filename);
int copyFtpDataFile (string host, int copyFtpDataFile (string host,
string remote_path, string remote_path,
string filename, string filename,
string password); string password,
int timeout);
int copyLocalDataFile (string remote_path, int copyLocalDataFile (string remote_path,
string filename); string filename);
void recvDataFile (string filename); void recvDataFile (string filename);
void recvTentacleDataFile (string host, void recvTentacleDataFile (string host,
string filename); string filename,
int timeout);
int unzipCollection(string zip_path, string dest_dir); int unzipCollection(string zip_path, string dest_dir);
void checkCollections (); void checkCollections ();

View File

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

View File

@ -116,11 +116,8 @@ Pandora_Wmi::isServiceRunning (string service_name) {
if (str_state == "Running") { if (str_state == "Running") {
retval = 1; retval = 1;
} }
else if (str_state == "Stopped") {
retval = 0;
}
else { else {
retval = -1; retval = 0;
} }
dhFreeString (state); dhFreeString (state);

View File

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

View File

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

View File

@ -141,14 +141,16 @@ function mainAgentsModules() {
} }
$count = 0; $count = 0;
foreach ($agents as $agent) { foreach ($agents as $agent) {
$module = agents_get_modules($agent, false, $filter_module_group, true, false); $module = agents_get_modules($agent, false,
$filter_module_group, true, false);
if ($module == false) { if ($module == false) {
unset($agents[$count]); unset($agents[$count]);
} }
$count++; $count++;
} }
$total_pagination = count($agents); $total_pagination = count($agents);
$all_modules = agents_get_modules($agents, false, $filter_module_group, true, false); $all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false);
$modules_by_name = array(); $modules_by_name = array();
$name = ''; $name = '';

View File

@ -116,7 +116,8 @@ function main_net_tools () {
echo "<table class='databox filters' width=100% id=netToolTable>"; echo "<table class='databox filters' width=100% id=netToolTable>";
echo "<tr><td>"; echo "<tr><td>";
echo __("Operation"); echo __("Operation");
ui_print_help_tip(__('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools')); ui_print_help_tip(
__('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools'));
echo "</td><td>"; echo "</td><td>";
echo "<select name='operation' onChange='mostrarColumns(this);'>"; echo "<select name='operation' onChange='mostrarColumns(this);'>";
echo "<option value='1'>" . __("Traceroute"); echo "<option value='1'>" . __("Traceroute");
@ -133,7 +134,8 @@ function main_net_tools () {
foreach ($ips as $ip) { foreach ($ips as $ip) {
if ($ip['ip'] == $principal_ip) { if ($ip['ip'] == $principal_ip) {
echo "<option value='". $ip['ip'] ."' selected = 'selected'>" . $ip['ip']; echo "<option value='". $ip['ip'] ."' selected = 'selected'>" . $ip['ip'];
}else{ }
else {
echo "<option value='". $ip['ip'] ."'>" . $ip['ip']; echo "<option value='". $ip['ip'] ."'>" . $ip['ip'];
} }
} }
@ -172,7 +174,7 @@ function main_net_tools () {
ui_print_error_message(__('Ping executable does not exist.')); ui_print_error_message(__('Ping executable does not exist.'));
} }
else { else {
echo "<h3>".__("Ping to "). $ip. "</h3>"; echo "<h3>" . __("Ping to %s", $ip) . "</h3>";
echo "<pre>"; echo "<pre>";
echo system ("$ping -c 5 $ip"); echo system ("$ping -c 5 $ip");
echo "</pre>"; echo "</pre>";

View File

@ -76,11 +76,15 @@ function pluginreg_extension_main () {
$file_exec_path = $exec_path; $file_exec_path = $exec_path;
if (isset($ini_array["plugin_definition"]["execution_command"]) && ($ini_array["plugin_definition"]["execution_command"] != "")){ if (isset($ini_array["plugin_definition"]["execution_command"])
&& ($ini_array["plugin_definition"]["execution_command"] != "")) {
$exec_path = $ini_array["plugin_definition"]["execution_command"] . " " . $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"]; $exec_path = $ini_array["plugin_definition"]["execution_command"] . " " . $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"];
} }
if (isset($ini_array["plugin_definition"]["execution_postcommand"]) && ($ini_array["plugin_definition"]["execution_postcommand"] != "")){ if (isset($ini_array["plugin_definition"]["execution_postcommand"])
&& ($ini_array["plugin_definition"]["execution_postcommand"] != "")) {
$exec_path = $exec_path . " " .$ini_array["plugin_definition"]["execution_postcommand"]; $exec_path = $exec_path . " " .$ini_array["plugin_definition"]["execution_postcommand"];
} }

View File

@ -136,6 +136,13 @@ UPDATE `trecon_script` SET
`macros` = '{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}' `macros` = '{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}'
WHERE `id_recon_script` = 2 AND `name` = 'IPMI&#x20;Recon'; WHERE `id_recon_script` = 2 AND `name` = 'IPMI&#x20;Recon';
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
UPDATE tnetwork_component SET snmp_oid ='SELECT&#x20;DNSHostName&#x20;FROM&#x20;Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname';
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207;
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tgis_map_has_tgis_map_con` (tgis_map_has_tgis_map_connection) -- Table `tgis_map_has_tgis_map_con` (tgis_map_has_tgis_map_connection)

View File

@ -109,3 +109,11 @@ UPDATE trecon_script SET
description = 'Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0', description = 'Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0',
macros = '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.:&#x20;192.168.100.0/24","value":"","hide":""},"2":{"macro":"_field2_","desc":"Username","help":"","value":"","hide":""},"3":{"macro":"_field3_","desc":"Password","help":"","value":"","hide":"1"},"4":{"macro":"_field4_","desc":"Additional&#x20;parameters","help":"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.","value":"","hide":""}}' macros = '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.:&#x20;192.168.100.0/24","value":"","hide":""},"2":{"macro":"_field2_","desc":"Username","help":"","value":"","hide":""},"3":{"macro":"_field3_","desc":"Password","help":"","value":"","hide":"1"},"4":{"macro":"_field4_","desc":"Additional&#x20;parameters","help":"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.","value":"","hide":""}}'
WHERE id_recon_script = 2 AND name = 'IPMI&#x20;Recon'; WHERE id_recon_script = 2 AND name = 'IPMI&#x20;Recon';
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
UPDATE tnetwork_component SET snmp_oid ='SELECT&#x20;DNSHostName&#x20;FROM&#x20;Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname';
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207;
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219;

View File

@ -107,3 +107,11 @@ UPDATE "trecon_script"SET
"description" = 'Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0', "description" = 'Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0',
"macros" = '{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}' "macros" = '{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}'
WHERE "id_recon_script" = 2 AND "name" = 'IPMI&#x20;Recon'; WHERE "id_recon_script" = 2 AND "name" = 'IPMI&#x20;Recon';
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
UPDATE tnetwork_component SET snmp_oid ='SELECT&#x20;DNSHostName&#x20;FROM&#x20;Win32_ComputerSystem' WHERE id_nc = 204 AND name = 'Hostname';
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=207;
UPDATE `tnetwork_component` set `tcp_port`=0 WHERE id_nc=219;

View File

@ -213,10 +213,12 @@ config_check();
$autorefresh_additional .= '</span>'; $autorefresh_additional .= '</span>';
unset ($values); unset ($values);
$autorefresh_link_open_img = '<a class="white autorefresh" href="' . ui_get_url_refresh ($ignored_params) . '">'; $autorefresh_link_open_img =
'<a class="white autorefresh" href="' . ui_get_url_refresh ($ignored_params) . '">';
if ($_GET['refr']) { if ($_GET['refr']) {
$autorefresh_link_open_txt = '<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">'; $autorefresh_link_open_txt =
'<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">';
} }
else { else {
$autorefresh_link_open_txt = '<a>'; $autorefresh_link_open_txt = '<a>';
@ -249,10 +251,18 @@ config_check();
$maintenance_title = __("System alerts detected - Please fix as soon as possible"); $maintenance_title = __("System alerts detected - Please fix as soon as possible");
$maintenance_class = $maintenance_id = 'show_systemalert_dialog white'; $maintenance_class = $maintenance_id = 'show_systemalert_dialog white';
$maintenance_link_open_txt = '<a href="' . $maintenance_link . '" title="' . $maintenance_title . '" class="' . $maintenance_class . '" id="show_systemalert_dialog">'; $maintenance_link_open_txt =
$maintenance_link_open_img = '<a href="' . $maintenance_link . '" title="' . $maintenance_title . '" class="' . $maintenance_class . '">'; '<a href="' . $maintenance_link . '" title="' . $maintenance_title . '" class="' . $maintenance_class . '" id="show_systemalert_dialog">';
$maintenance_link_open_img =
'<a href="' . $maintenance_link . '" title="' . $maintenance_title . '" class="' . $maintenance_class . '">';
$maintenance_link_close = '</a>'; $maintenance_link_close = '</a>';
$maintenance_img = $maintenance_link_open_img . html_print_image ("images/header_yellow.png", true, array ("title" => __('You have %d warning(s)', $config["alert_cnt"]), "id" => "yougotalert", "class" => "bot")) . $maintenance_link_close; $maintenance_img = $maintenance_link_open_img .
html_print_image("images/header_yellow.png",
true, array(
"title" => __('You have %d warning(s)',
$config["alert_cnt"]),
"id" => "yougotalert",
"class" => "bot")) . $maintenance_link_close;
} }
else { else {
$maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot")); $maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot"));

View File

@ -67,7 +67,8 @@ echo '<div class="databox_login" id="login">';
echo '<div id="login_inner">'; echo '<div id="login_inner">';
echo '<div id="login_in">'; echo '<div id="login_in">';
echo '<div class="version_login"><div style="padding-top: 2px; color: #FFF;">' . $pandora_version . '</div></div>'; echo '<div class="version_login">
<div style="padding-top: 2px; color: #FFF;">' . $pandora_version . '</div></div>';
echo '<form method="post" action="' . ui_get_full_url('index.php'.$url) . '" >'; echo '<form method="post" action="' . ui_get_full_url('index.php'.$url) . '" >';
//TODO: Put branding in variables (external file) or database //TODO: Put branding in variables (external file) or database

View File

@ -246,7 +246,7 @@ $table->data[3][1] = html_print_select_groups(false, "AR", false, 'grupo', $grup
$table->data[4][0] = __('Interval'); $table->data[4][0] = __('Interval');
$table->data[4][1] = html_print_extended_select_for_time ('intervalo', $intervalo, '', '', '0', 10, true); $table->data[4][1] = html_print_extended_select_for_time ('intervalo', $intervalo, '', '', '0', 10, true);
if($intervalo<300){ if ($intervalo < SECONDS_5MINUTES) {
$table->data[4][1] .= clippy_context_help("interval_agent_min"); $table->data[4][1] .= clippy_context_help("interval_agent_min");
} }
$table->data[5][0] = __('OS'); $table->data[5][0] = __('OS');

View File

@ -1052,7 +1052,10 @@ $(document).ready (function () {
}); });
$("#submit-create_modules_btn").click(function () { $("#submit-create_modules_btn").click(function () {
if($("#module option").length == 0 || ($("#module option").length == 1 && $("#module option").eq(0).val() == 0)) { if ($("#module option").length == 0
|| ($("#module option").length == 1
&& $("#module option").eq(0).val() == 0)) {
alert('<?php echo __('Modules list is empty'); ?>'); alert('<?php echo __('Modules list is empty'); ?>');
return false; return false;
} }

View File

@ -355,7 +355,9 @@ if ($wmiexplore && !$fail) {
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_disks wizard_mode_disks_arrow clickable">' . html_print_image('images/darrowright.png', true, array('title' => __('Add to modules list'))) . '</div>'; $table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_disks wizard_mode_disks_arrow clickable">' . html_print_image('images/darrowright.png', true, array('title' => __('Add to modules list'))) . '</div>';
$table->data[2][1] .= '<br><br><div class="wizard_mode_delete_arrow clickable">' . html_print_image('images/cross.png', true, array('title' => __('Remove from modules list'))) . '</div>'; $table->data[2][1] .= '<br><br><div class="wizard_mode_delete_arrow clickable">' .
html_print_image('images/cross.png', true, array('title' => __('Remove from modules list'))) .
'</div>';
$table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;'; $table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;';
$table->data[2][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px; height: 100%;'); $table->data[2][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px; height: 100%;');

View File

@ -205,7 +205,8 @@ if ($create_agent) {
// Create custom fields for this agent // Create custom fields for this agent
foreach ($field_values as $key => $value) { foreach ($field_values as $key => $value) {
db_process_sql_insert ('tagent_custom_data', db_process_sql_insert ('tagent_custom_data',
array('id_field' => $key,'id_agent' => $id_agente, 'description' => $value)); array('id_field' => $key, 'id_agent' => $id_agente,
'description' => $value));
} }
// Create address for this agent in taddress // Create address for this agent in taddress
if ( $direccion_agente != '') { if ( $direccion_agente != '') {

View File

@ -47,7 +47,8 @@ if ($create_field) {
ui_print_error_message(__('The name must be unique')); ui_print_error_message(__('The name must be unique'));
} }
else { else {
$result = db_process_sql_insert('tagent_custom_fields', array('name' => $name, 'display_on_front' => $display_on_front)); $result = db_process_sql_insert('tagent_custom_fields',
array('name' => $name, 'display_on_front' => $display_on_front));
ui_print_success_message(__('Field successfully created')); ui_print_success_message(__('Field successfully created'));
} }
} }
@ -74,7 +75,8 @@ if ($update_field) {
/* Delete field */ /* Delete field */
if ($delete_field) { if ($delete_field) {
$result = db_process_sql_delete('tagent_custom_fields', array('id_field' => $id_field)); $result = db_process_sql_delete('tagent_custom_fields',
array('id_field' => $id_field));
if (!$result) if (!$result)
ui_print_error_message(__('There was a problem deleting field')); ui_print_error_message(__('There was a problem deleting field'));

View File

@ -403,7 +403,8 @@ $table_advanced->colspan[4][4] = 3;
$table_advanced->data[5][0] = __('FF interval') . ' ' . ui_print_help_icon ('ff_interval', true); $table_advanced->data[5][0] = __('FF interval') . ' ' . ui_print_help_icon ('ff_interval', true);
$table_advanced->data[5][1] = html_print_input_text ('module_ff_interval', $ff_interval, $table_advanced->data[5][1] = html_print_input_text ('module_ff_interval', $ff_interval,
'', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true); '', 5, 10, true, $disabledBecauseInPolicy) .
ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true);
$table_advanced->colspan[5][1] = 2; $table_advanced->colspan[5][1] = 2;
$table_advanced->data[5][3] = __('FF timeout') . ' ' . ui_print_help_icon ('ff_timeout', true); $table_advanced->data[5][3] = __('FF timeout') . ' ' . ui_print_help_icon ('ff_timeout', true);
@ -544,7 +545,8 @@ $table_advanced->colspan[12][4] = 3;
if (check_acl ($config['id_user'], 0, "PM")) { if (check_acl ($config['id_user'], 0, "PM")) {
$table_advanced->data[13][0] = __('Category'); $table_advanced->data[13][0] = __('Category');
$table_advanced->data[13][1] = html_print_select(categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true); $table_advanced->data[13][1] = html_print_select(
categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true);
$table_advanced->colspan[13][1] = 6; $table_advanced->colspan[13][1] = 6;
} }
else { else {

View File

@ -544,10 +544,13 @@ else {
'&delete_downtime=1&id_downtime=' . $downtime['id'] . '&' . $filter_params_str . '">' . '&delete_downtime=1&id_downtime=' . $downtime['id'] . '&' . $filter_params_str . '">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))); html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete')));
} }
elseif ($downtime["executed"] == 1 && $downtime['type_execution'] == 'once'){ elseif ($downtime["executed"] == 1
&& $downtime['type_execution'] == 'once') {
$data[8] = '<a href="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor&amp;' . $data[8] = '<a href="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor&amp;' .
'edit_downtime=1&amp;id_downtime=' . $downtime['id'] . '">' . 'edit_downtime=1&amp;id_downtime=' . $downtime['id'] . '">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>'; html_print_image("images/config.png", true,
array("border" => '0', "alt" => __('Update'))) . '</a>';
$data[9]= "N/A"; $data[9]= "N/A";
} }
else { else {

View File

@ -142,7 +142,8 @@ if ( defined("METACONSOLE") ) {
$form_filter .= "</td>"; $form_filter .= "</td>";
$form_filter .= "</tr>"; $form_filter .= "</tr>";
$form_filter .= "</table>"; $form_filter .= "</table>";
}else{ }
else {
$form_filter .= "</table>"; $form_filter .= "</table>";
$form_filter .= "<div style='text-align:right; height:100%;'>"; $form_filter .= "<div style='text-align:right; height:100%;'>";
$form_filter .= html_print_submit_button (__('Update'), '', false, 'class="sub upd"', true); $form_filter .= html_print_submit_button (__('Update'), '', false, 'class="sub upd"', true);

View File

@ -124,7 +124,8 @@ if ($delete_alert) {
$id_agent_module = $temp["id_agent_module"]; $id_agent_module = $temp["id_agent_module"];
$alert_template_name = db_get_value ("name", "talert_templates","id", $id_alert_template); $alert_template_name = db_get_value ("name", "talert_templates","id", $id_alert_template);
$module_name = db_get_value ("nombre", "tagente_modulo","id_agente_modulo", $id_agent_module); $module_name = db_get_value ("nombre", "tagente_modulo","id_agente_modulo", $id_agent_module);
$agent_name = agents_get_name (db_get_value ("id_agente", "tagente_modulo","id_agente_modulo", $id_agent_module)); $agent_name = agents_get_name(
db_get_value("id_agente", "tagente_modulo","id_agente_modulo", $id_agent_module));
$result = alerts_delete_alert_agent_module ($id_alert_agent_module); $result = alerts_delete_alert_agent_module ($id_alert_agent_module);

View File

@ -431,13 +431,18 @@ $table->style[1] = 'width: 30%;';
$table->style[2] = 'width: 30%;'; $table->style[2] = 'width: 30%;';
$table->style[3] = 'font-weight: bold; width: 30%;'; $table->style[3] = 'font-weight: bold; width: 30%;';
$table->title = __('Firing fields') . ui_print_help_tip(__('Fields passed to the command executed by this action when the alert is fired'), true); $table->title = __('Firing fields') .
ui_print_help_tip(__('Fields passed to the command executed by this action when the alert is fired'), true);
$table->head[0] = __('Field') . ui_print_help_tip(__('Fields configured on the command associated to the action'), true); $table->head[0] = __('Field') .
$table->head[1] = __('Template fields') . ui_print_help_tip(__('Triggering fields configured in template'), true); ui_print_help_tip(__('Fields configured on the command associated to the action'), true);
$table->head[2] = __('Action fields') . ui_print_help_tip(__('Triggering fields configured in action'), true); $table->head[1] = __('Template fields') .
ui_print_help_tip(__('Triggering fields configured in template'), true);
$table->head[2] = __('Action fields') .
ui_print_help_tip(__('Triggering fields configured in action'), true);
$table->head[3] = __('Executed on firing') . ui_print_help_tip(__('Fields used on execution when the alert is fired'), true); $table->head[3] = __('Executed on firing') .
ui_print_help_tip(__('Fields used on execution when the alert is fired'), true);
$firing_fields = array(); $firing_fields = array();

View File

@ -307,8 +307,12 @@ $(document).ready (function () {
$("[name=field" + i + "_recovery_value]").val(old_recovery_value); $("[name=field" + i + "_recovery_value]").val(old_recovery_value);
} }
else { else {
$("[name=field" + i + "_value]").val($("[name=field" + i + "_value]").val()); $("[name=field" + i + "_value]")
$("[name=field" + i + "_recovery_value]").val($("[name=field" + i + "_recovery_value]").val()); .val($("[name=field" + i + "_value]")
.val());
$("[name=field" + i + "_recovery_value]")
.val($("[name=field" + i + "_recovery_value]")
.val());
} }
// Add help hint only in first field // Add help hint only in first field
if (i == 1) { if (i == 1) {

View File

@ -541,13 +541,15 @@ if ($step == 2) {
switch ($config['dbtype']) { switch ($config['dbtype']) {
case "mysql": case "mysql":
case "postgresql": case "postgresql":
$sql_query = sprintf('SELECT id, name $sql_query = sprintf('
SELECT id, name
FROM talert_actions FROM talert_actions
WHERE id_group IN (%s) WHERE id_group IN (%s)
ORDER BY name', $usr_groups); ORDER BY name', $usr_groups);
break; break;
case "oracle": case "oracle":
$sql_query = sprintf('SELECT id, $sql_query = sprintf('
SELECT id,
dbms_lob.substr(name,4000,1) AS nombre dbms_lob.substr(name,4000,1) AS nombre
FROM talert_actions FROM talert_actions
WHERE id_group IN (%s) WHERE id_group IN (%s)
@ -557,7 +559,8 @@ if ($step == 2) {
$table->data[4][1] = html_print_select_from_sql ($sql_query, $table->data[4][1] = html_print_select_from_sql ($sql_query,
'default_action', $default_action, '', __('None'), 0, 'default_action', $default_action, '', __('None'), 0,
true, false, false) . true, false, false) .
ui_print_help_tip (__('In case you fill any Field 1, Field 2 or Field 3 above, those will replace the corresponding fields of this associated "Default action".'), true); ui_print_help_tip (
__('In case you fill any Field 1, Field 2 or Field 3 above, those will replace the corresponding fields of this associated "Default action".'), true);
$table->data[5][0] = __('Condition type'); $table->data[5][0] = __('Condition type');
$table->data[5][1] = html_print_select (alerts_get_alert_templates_types (), 'type', $table->data[5][1] = html_print_select (alerts_get_alert_templates_types (), 'type',

View File

@ -95,7 +95,8 @@ if(!defined('METACONSOLE')){
echo "<td align=right>"; echo "<td align=right>";
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/category/edit_category&action=new&pure='.(int)$config['pure'].'">'; echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/category/edit_category&action=new&pure='.(int)$config['pure'].'">';
html_print_input_hidden ("create_category", "1", true); html_print_input_hidden ("create_category", "1", true);
html_print_submit_button (__('Create category'), 'create_button', false, 'class="sub next"'); html_print_submit_button (__('Create category'),
'create_button', false, 'class="sub next"');
echo "</form>"; echo "</form>";
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";

View File

@ -172,7 +172,8 @@ else
html_print_input_hidden ('update_category', 1); html_print_input_hidden ('update_category', 1);
echo "</td>"; echo "</td>";
echo "<td align=right>"; echo "<td align=right>";
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"'); html_print_submit_button (__('Update'), 'update_button',
false, 'class="sub next"');
echo "</td>"; echo "</td>";
} }
if ($action == "new") { if ($action == "new") {
@ -192,11 +193,13 @@ if(defined('METACONSOLE')){
echo "<td align=right>"; echo "<td align=right>";
if ($action == "update") { if ($action == "update") {
html_print_input_hidden ('update_category', 1); html_print_input_hidden ('update_category', 1);
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"'); html_print_submit_button (__('Update'), 'update_button', false,
'class="sub next"');
} }
if ($action == "new") { if ($action == "new") {
html_print_input_hidden ('create_category', 1); html_print_input_hidden ('create_category', 1);
html_print_submit_button (__('Create'), 'create_button', false, 'class="sub next"'); html_print_submit_button (__('Create'), 'create_button', false,
'class="sub next"');
} }
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";

View File

@ -18,7 +18,8 @@ global $config;
check_login (); check_login ();
ui_print_page_header (__('Database maintenance').' &raquo; '.__('Event database cleanup'), "images/gm_db.png", false, "", true); ui_print_page_header (__('Database maintenance').' &raquo; ' .
__('Event database cleanup'), "images/gm_db.png", false, "", true);
if (! check_acl ($config['id_user'], 0, "DM")) { if (! check_acl ($config['id_user'], 0, "DM")) {
db_pandora_audit("ACL Violation", "Trying to access Database Management Event"); db_pandora_audit("ACL Violation", "Trying to access Database Management Event");
@ -32,7 +33,8 @@ if (! check_acl ($config['id_user'], 0, "DM")) {
if (isset ($_POST["date_purge"])) { if (isset ($_POST["date_purge"])) {
$from_date = (int) get_parameter_post ("date_purge"); $from_date = (int) get_parameter_post ("date_purge");
$deleted = db_process_sql_delete('tevento', array('utimestamp' => '< ' . $from_date)); $deleted = db_process_sql_delete('tevento',
array('utimestamp' => '< ' . $from_date));
if ($deleted !== false) { if ($deleted !== false) {
ui_print_success_message(__('Successfully deleted old events')); ui_print_success_message(__('Successfully deleted old events'));
@ -43,7 +45,11 @@ if (isset ($_POST["date_purge"])){
} }
# End of get parameters block # End of get parameters block
$row = db_get_row_sql ("SELECT COUNT(*) AS total, MIN(timestamp) AS first_date, MAX(timestamp) AS latest_date FROM tevento"); $row = db_get_row_sql ("
SELECT COUNT(*) AS total,
MIN(timestamp) AS first_date,
MAX(timestamp) AS latest_date
FROM tevento");
$table->data = array (); $table->data = array ();
$table->cellpadding = 4; $table->cellpadding = 4;

View File

@ -178,12 +178,19 @@ foreach ($fields_available as $key=>$available) {
$table->data[0][0] = '<b>' . __('Fields available').'</b>'; $table->data[0][0] = '<b>' . __('Fields available').'</b>';
$table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 200px'); $table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
$table->data[1][1] = '<a href="javascript:">'.html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add fields to select'))).'</a>'; $table->data[1][1] = '<a href="javascript:">' .
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'. html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete fields to select'))).'</a>'; html_print_image('images/darrowright.png', true,
array('id' => 'right', 'title' => __('Add fields to select'))) .
'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">' .
html_print_image('images/darrowleft.png', true,
array('id' => 'left', 'title' => __('Delete fields to select'))) .
'</a>';
$table->data[0][1] = ''; $table->data[0][1] = '';
$table->data[0][2] = '<b>' . __('Fields selected') . '</b>'; $table->data[0][2] = '<b>' . __('Fields selected') . '</b>';
$table->data[1][2] = html_print_select($result_selected, 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px'); $table->data[1][2] = html_print_select($result_selected,
'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=fields&amp;pure='.$config['pure'].'">'; echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=fields&amp;pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);

View File

@ -327,7 +327,8 @@ if (check_acl($config['id_user'], 0, "PM")) {
echo '<br />'; echo '<br />';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group&pure='.$pure.'">'; echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group&pure='.$pure.'">';
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button (__('Create group'), 'crt', false, 'class="sub next"'); html_print_submit_button(__('Create group'), 'crt', false,
'class="sub next"');
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';
} }

View File

@ -517,7 +517,10 @@ $filter = array ();
if ($search_id_group) if ($search_id_group)
$filter['id_group'] = $search_id_group; $filter['id_group'] = $search_id_group;
if ($search_string != '') if ($search_string != '')
$filter[] = '(name LIKE "%'.$search_string.'%" OR description LIKE "%'.$search_string.'%" OR tcp_send LIKE "%'.$search_string.'%" OR tcp_rcv LIKE "%'.$search_string.'%")'; $filter[] = '(name LIKE "%' . $search_string . '%" ' .
'OR description LIKE "%'. $search_string . '%" ' .
'OR tcp_send LIKE "%' . $search_string . '%" ' .
'OR tcp_rcv LIKE "%' . $search_string . '%")';
$total_components = network_components_get_network_components (false, $filter, 'COUNT(*) AS total'); $total_components = network_components_get_network_components (false, $filter, 'COUNT(*) AS total');
$total_components = $total_components[0]['total']; $total_components = $total_components[0]['total'];

View File

@ -267,10 +267,18 @@ if ($id_np > 0) {
$group_filter .= '</div></form>'; $group_filter .= '</div></form>';
if ($ncgroup > 0) { if ($ncgroup > 0) {
$sql = sprintf ("SELECT id_nc, name, id_group FROM tnetwork_component WHERE id_group = %d AND name LIKE '%".$ncfilter."%' ORDER BY name", $ncgroup); $sql = sprintf ("
SELECT id_nc, name, id_group
FROM tnetwork_component
WHERE id_group = %d AND name LIKE '%" . $ncfilter . "%'
ORDER BY name", $ncgroup);
} }
else { else {
$sql = "SELECT id_nc, name, id_group FROM tnetwork_component WHERE name LIKE '%".$ncfilter."%' ORDER BY name"; $sql = "
SELECT id_nc, name, id_group
FROM tnetwork_component
WHERE name LIKE '%" . $ncfilter . "%'
ORDER BY name";
} }
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql);

View File

@ -963,7 +963,9 @@ else
} }
$result_servers = array(); $result_servers = array();
foreach ($metaconsole_connections as $metaconsole_element) { foreach ($metaconsole_connections as $metaconsole_element) {
$connection_data = enterprise_hook('metaconsole_get_connection', array($metaconsole_element)); $connection_data = enterprise_hook(
'metaconsole_get_connection',
array($metaconsole_element));
$result_servers[$connection_data['server_name']] = $connection_data['server_name']; $result_servers[$connection_data['server_name']] = $connection_data['server_name'];
} }
// Print select combo with metaconsole servers // Print select combo with metaconsole servers

View File

@ -594,6 +594,11 @@ function added_ids_sorted_items_to_hidden_input() {
function only_numbers(name) { function only_numbers(name) {
var value = $("input[name='" + name + "']").val(); var value = $("input[name='" + name + "']").val();
if (value == "") {
// Do none it is a empty field.
return;
}
value = parseInt(value); value = parseInt(value);
if (isNaN(value)) { if (isNaN(value)) {

View File

@ -276,7 +276,8 @@ if (($create != "") OR ($view != "")) {
$table->headstyle[0] = 'text-align: center'; $table->headstyle[0] = 'text-align: center';
echo '<br>'; echo '<br>';
html_print_table($table); html_print_table($table);
}else{ }
else {
echo '<fieldset style="width:96%"><legend>' . __('General') . '</legend>'; echo '<fieldset style="width:96%"><legend>' . __('General') . '</legend>';
html_print_table($table); html_print_table($table);
echo '</fieldset>'; echo '</fieldset>';
@ -338,7 +339,8 @@ if (($create != "") OR ($view != "")) {
$table->headstyle[0] = 'text-align: center'; $table->headstyle[0] = 'text-align: center';
echo '<br>'; echo '<br>';
html_print_table($table); html_print_table($table);
}else{ }
else {
echo '<fieldset style="width:96%"><legend>' . __('Command') . '</legend>'; echo '<fieldset style="width:96%"><legend>' . __('Command') . '</legend>';
html_print_table($table); html_print_table($table);
echo '</fieldset>'; echo '</fieldset>';
@ -457,8 +459,10 @@ if (($create != "") OR ($view != "")) {
$table->headstyle[0] = 'text-align: center'; $table->headstyle[0] = 'text-align: center';
echo '<br>'; echo '<br>';
html_print_table($table); html_print_table($table);
}else{ }
echo '<fieldset style="width:96%"><legend>'.__('Parameters macros').ui_print_help_icon ('macros', true).'</legend>'; else {
echo '<fieldset style="width:96%">' .
'<legend>' . __('Parameters macros') .ui_print_help_icon ('macros', true) . '</legend>';
html_print_table($table); html_print_table($table);
echo '</fieldset>'; echo '</fieldset>';
} }
@ -556,7 +560,8 @@ else {
$result = false; $result = false;
if ($values['name'] != '' && $values['execute'] != '') if ($values['name'] != '' && $values['execute'] != '')
$result = db_process_sql_update('tplugin', $values, array('id' => $plugin_id)); $result = db_process_sql_update('tplugin', $values,
array('id' => $plugin_id));
if (! $result) { if (! $result) {
ui_print_error_message(__('Problem updating plugin')); ui_print_error_message(__('Problem updating plugin'));

View File

@ -79,7 +79,9 @@ if ($mapsConnections !== false) {
ui_print_group_icon ($mapsConnection['group_id'], true), ui_print_group_icon ($mapsConnection['group_id'], true),
'<a href="index.php?sec=gsetup&sec2=godmode/setup/gis&amp;id_connection_map=' . '<a href="index.php?sec=gsetup&sec2=godmode/setup/gis&amp;id_connection_map=' .
$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection" $mapsConnection['id_tmap_connection'].'&amp;action=delete_connection"
onClick="javascript: if (!confirm(\'' . __('Do you wan delete this connection?') . '\')) return false;">' . html_print_image ("images/cross.png", true).'</a>'); onClick="javascript: if (!confirm(\'' .
__('Do you wan delete this connection?') . '\')) return false;">' .
html_print_image ("images/cross.png", true).'</a>');
} }
} }

View File

@ -98,7 +98,11 @@ $table->data[18][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('i
if ($config["integria_enabled"]) { if ($config["integria_enabled"]) {
require_once('include/functions_incidents.php'); require_once('include/functions_incidents.php');
$invent = incidents_call_api($config['integria_url']."/include/api.php?user=".$config['id_user']."&pass=".io_output_password($config['integria_api_password'])."&op=get_inventories"); $invent = incidents_call_api(
$config['integria_url'] . "/include/api.php?" .
"user=" . $config['id_user'] . "&" .
"pass=" . io_output_password($config['integria_api_password']) ."&" .
"op=get_inventories");
$bad_input = false; $bad_input = false;
// Wrong connection to api, bad password // Wrong connection to api, bad password
if (empty($invent)) { if (empty($invent)) {
@ -132,14 +136,17 @@ if ($config["integria_enabled"]) {
} }
} }
$table->data[20][0] = __('Integria URL') . ui_print_help_icon ("integria_url", true); $table->data[20][0] = __('Integria URL') . ui_print_help_icon ("integria_url", true);
$table->data[20][1] = html_print_input_text ('integria_url', $config["integria_url"], '', 25, 255, true); $table->data[20][1] = html_print_input_text('integria_url',
$config["integria_url"], '', 25, 255, true);
// If something goes wrong // If something goes wrong
if ($bad_input) { if ($bad_input) {
$table->data[20][1] .= html_print_image('images/error.png', true, array('title' => __('URL and/or Integria password are incorrect'))); $table->data[20][1] .= html_print_image('images/error.png',
true, array('title' => __('URL and/or Integria password are incorrect')));
} }
$table->data[21][0] = __('Integria API password'); $table->data[21][0] = __('Integria API password');
$table->data[21][1] = html_print_input_text ('integria_api_password', io_output_password($config["integria_api_password"]), '', 25, 25, true); $table->data[21][1] = html_print_input_text('integria_api_password',
io_output_password($config["integria_api_password"]), '', 25, 25, true);
if (!$bad_input) { if (!$bad_input) {
foreach ($invent as $inv) { foreach ($invent as $inv) {
@ -190,8 +197,11 @@ foreach ($timezones as $timezone) {
} }
} }
$table->data[23][0] = __('Timezone setup'). ' ' . ui_print_help_tip (__('Must have the same time zone as the system or database to avoid mismatches of time.'), true); $table->data[23][0] = __('Timezone setup'). ' ' . ui_print_help_tip(
$table->data[23][1] = html_print_input_text_extended ('timezone_text', $config["timezone"], 'text-timezone_text', '', 25, 25, false, '', 'readonly', true); __('Must have the same time zone as the system or database to avoid mismatches of time.'), true);
$table->data[23][1] = html_print_input_text_extended(
'timezone_text', $config["timezone"], 'text-timezone_text', '', 25,
25, false, '', 'readonly', true);
$table->data[23][1] .= '<a id="change_timezone">'.html_print_image ('images/pencil.png', true, array ('title' => __('Change timezone'))).'</a>'; $table->data[23][1] .= '<a id="change_timezone">'.html_print_image ('images/pencil.png', true, array ('title' => __('Change timezone'))).'</a>';
$table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true); $table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
$table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($timezone_n, 'timezone', $config["timezone"], '', '', '', true); $table->data[23][1] .= "&nbsp;&nbsp;". html_print_select($timezone_n, 'timezone', $config["timezone"], '', '', '', true);

801
pandora_console/godmode/setup/setup_visuals.php Normal file → Executable file
View File

@ -51,10 +51,436 @@ $table->data = array ();
$row = 0; $row = 0;
//----------------------------------------------------------------------
// BEHAVIOUR CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Behaviour configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Block size for pagination');
$table->data[$row][1] = html_print_input_text ('block_size', $config["global_block_size"], '', 5, 5, true);
$row++;
$values = array ();
$values[5] = human_time_description_raw (5);
$values[30] = human_time_description_raw (30);
$values[SECONDS_1MINUTE] = human_time_description_raw(SECONDS_1MINUTE);
$values[SECONDS_2MINUTES] = human_time_description_raw(SECONDS_2MINUTES);
$values[SECONDS_5MINUTES] = human_time_description_raw(SECONDS_5MINUTES);
$values[SECONDS_10MINUTES] = human_time_description_raw(SECONDS_10MINUTES);
$values[SECONDS_30MINUTES] = human_time_description_raw(SECONDS_30MINUTES);
$table->data[$row][0] = __('Default interval for refresh on Visual Console') . ui_print_help_tip(__('This interval will affect to Visual Console pages'), true);
$table->data[$row][1] = html_print_select ($values, 'vc_refr', $config["vc_refr"], '', 'N/A', 0, true, false, false);
$row++;
$table->data[$row][0] = __('Paginated module view');
$table->data[$row][1] = html_print_checkbox('paginate_module', 1,
$config['paginate_module'], true);
$row++;
$table->data[$row][0] = __('Render data of module type is proc.');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('render_proc', 1, '',
$config["render_proc"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('render_proc', 0, '',
$config["render_proc"], true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// STYLE CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Style configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Style template');
$table->data[$row][1] = html_print_select (themes_get_css (), 'style', $config["style"].'.css', '', '', '', true);
$row++;
$table->data[$row][0] = __('Status icon set');
$iconsets["default"] = __('Colors');
$iconsets["faces"] = __('Faces');
$iconsets["color_text"] = __('Colors and text');
$table->data[$row][1] = html_print_select ($iconsets, 'status_images_set', $config["status_images_set"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'status_set_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Login background') . ui_print_help_tip(__('You can place your custom images into the folder images/backgrounds/'), true);
$backgrounds_list_jpg = list_files("images/backgrounds", "jpg", 1, 0);
$backgrounds_list_gif = list_files("images/backgrounds", "gif", 1, 0);
$backgrounds_list_png = list_files("images/backgrounds", "png", 1, 0);
$backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
asort($backgrounds_list);
$table->data[$row][1] = html_print_select ($backgrounds_list,
'login_background', $config["login_background"], '', __('Default'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'login_background_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true);
$table->data[$row][1] = html_print_select(
list_files('images/custom_logo', "png", 1, 0), 'custom_logo',
$config["custom_logo"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'custom_logo_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Fixed header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_header', 1, '', $config["fixed_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_header', 0, '', $config["fixed_header"], true);
$row++;
$table->data[$row][0] = __('Fixed menu');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 1, '', $config["fixed_menu"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// GIS CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('GIS configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('GIS Labels') .
ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true);
$row++;
$listIcons = gis_get_array_list_icons();
$arraySelectIcon = array();
foreach ($listIcons as $index => $value)
$arraySelectIcon[$index] = $index;
$table->data[$row][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true);
$table->data[$row][1] = html_print_select($arraySelectIcon,
"gis_default_icon", $config["gis_default_icon"], "", __('None'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'gis_icon_preview', false, '', '', true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// FONT AND TEXT CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Font and Text configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Font path');
$fonts = load_fonts();
$table->data[$row][1] = html_print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true);
$row++;
$table->data[$row][0] = __('Font size');
$font_size_array = array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
10 => 10,
11 => 11,
12 => 12,
13 => 13,
14 => 14,
15 => 15);
$table->data[$row][1] = html_print_select($font_size_array, 'font_size',
$config["font_size"], '', '', 0, true);
$row++;
$table->data[$row][0] = __('Agent size text') . ui_print_help_tip(__('When the agent name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('agent_size_text_small', $config["agent_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('agent_size_text_medium', $config["agent_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Module size text') . ui_print_help_tip(__('When the module name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('module_size_text_small', $config["module_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('module_size_text_medium', $config["module_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Description size text') . ui_print_help_tip(__('When the description name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text ('description_size_text', $config["description_size_text"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Item title size text') .
ui_print_help_tip(__('When the item title name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text('item_title_size_text',
$config["item_title_size_text"], '', 3, 3, true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// CHARS CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Charts configuration') . '<hr>';
$row++;
$table->data[$row][0] = __('Graph color (min)');
$table->data[$row][1] = html_print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (avg)');
$table->data[$row][1] = html_print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (max)');
$table->data[$row][1] = html_print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #4');
$table->data[$row][1] = html_print_input_text ('graph_color4', $config["graph_color4"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #5');
$table->data[$row][1] = html_print_input_text ('graph_color5', $config["graph_color5"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #6');
$table->data[$row][1] = html_print_input_text ('graph_color6', $config["graph_color6"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #7');
$table->data[$row][1] = html_print_input_text ('graph_color7', $config["graph_color7"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #8');
$table->data[$row][1] = html_print_input_text ('graph_color8', $config["graph_color8"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #9');
$table->data[$row][1] = html_print_input_text ('graph_color9', $config["graph_color9"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #10');
$table->data[$row][1] = html_print_input_text ('graph_color10', $config["graph_color10"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph resolution (1-low, 5-high)');
$table->data[$row][1] = html_print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Default line thickness for the Custom Graph.');
$table->data[$row][1] = html_print_input_text ('custom_graph_width',
$config["custom_graph_width"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Use round corners');
$table->data[$row][1] = __('Yes').'&nbsp;'.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;'.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
$row++;
$table->data[$row][0] = __('Interactive charts') .
ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true);
$table->data[$row][1] = __('Yes').'&nbsp;' .
html_print_radio_button ('flash_charts', 1, '', $config["global_flash_charts"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;' .
html_print_radio_button ('flash_charts', 0, '', $config["global_flash_charts"], true);
$row++;
if (!isset($config["short_module_graph_data"]))
$config["short_module_graph_data"] = true;
$table->data[$row][0] = __('Shortened module graph data');
$table->data[$row][0] .= ui_print_help_tip(__('The data number of the module graphs will be rounded and shortened'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 1, '',
$config["short_module_graph_data"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 0, '',
$config["short_module_graph_data"], true);
$row++;
$table->data[$row][0] = __('Type of module charts');
$table->data[$row][1] = __('Area').'&nbsp;' .
html_print_radio_button ('type_module_charts', 'area', '',
$config["type_module_charts"] == 'area', true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('Line').'&nbsp;' .
html_print_radio_button ('type_module_charts', 'line', '',
$config["type_module_charts"] != 'area', true);
$row++;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// OTHER CONFIGURATION
//----------------------------------------------------------------------
$table->colspan[$row][0] = 2;
$table->data[$row][0] = __('Other configuration') . '<hr>';
$row++;
if (empty($config["vc_line_thickness"])) $config["vc_line_thickness"] = 2;
$table->data[$row][0] = __('Default line thickness for the Visual Console') . ui_print_help_tip(__('This interval will affect to the lines between elements on the Visual Console'), true);
$table->data[$row][1] = html_print_input_text ('vc_line_thickness', $config["vc_line_thickness"], '', 5, 5, true);
$row++;
// For 5.1 Autohidden menu feature
$table->data['autohidden'][0] = __('Autohidden menu');
$table->data['autohidden'][1] = html_print_checkbox('autohidden_menu',
1, $config['autohidden_menu'], true);
// Juanma (07/05/2014) New feature: Table for custom front page for reports
$table->data[$row][0] = __('Custom report front page') .
ui_print_help_tip(
__('Custom report front page. It will be applied to all reports and templates by default.'), true);
$table->data[$row][1] = html_print_checkbox('custom_report_front', 1,
$config['custom_report_front'], true);
$row++;
//----------------------------------------------------------------------
$dirItems = scandir($config['homedir'] . '/images/custom_logo');
foreach ($dirItems as $entryDir) {
if (strstr($entryDir, '.jpg') !== false) {
$customLogos['images/custom_logo/' . $entryDir] = $entryDir;
}
}
$_fonts = array();
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$_fonts[$entryDir] = $entryDir;
}
}
// Font
$table->data['custom_report_front-font'][0] = __('Custom report front') . ' - ' . __('Font family');
$table->data['custom_report_front-font'][1] = html_print_select ($_fonts,
'custom_report_front_font', $config['custom_report_front_font'],
false, __('Default'), '', true);
// Logo
$table->data['custom_report_front-logo'][0] = __('Custom report front') . ' - ' .
__('Custom logo') .
ui_print_help_tip(
__("The dir of custom logos is in your www Pandora Console in \"images/custom_logo\". You can upload more files (ONLY JPEG) in upload tool in console."), true);
$table->data['custom_report_front-logo'][1] = html_print_select(
$customLogos,
'custom_report_front_logo',
$config['custom_report_front_logo'],
'showPreview()',
__('Default'),
'',
true);
// Preview
$table->data['custom_report_front-preview'][0] = __('Custom report front') . ' - ' . 'Preview';
if (empty($config['custom_report_front_logo'])) {
$config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg';
}
$table->data['custom_report_front-preview'][1] = '<span id="preview_image">' .
html_print_image ($config['custom_report_front_logo'], true) . '</span>';
// Header
$table->data['custom_report_front-header'][0] = __('Custom report front') . ' - ' . __('Header');
$table->data['custom_report_front-header'][1] = html_print_textarea('custom_report_front_header', 5, 15,
$config['custom_report_front_header'], 'style="width: 38em;"', true);
// First page
$table->data['custom_report_front-first_page'][0] = __('Custom report front') . ' - ' . __('First page');
$table->data['custom_report_front-first_page'][1] = html_print_textarea('custom_report_front_firstpage', 15, 15,
$config['custom_report_front_firstpage'], 'style="width: 38em; height: 20em;"', true);
// Footer
$table->data['custom_report_front-footer'][0] = __('Custom report front') . ' - ' . __('Footer');
$table->data['custom_report_front-footer'][1] = html_print_textarea('custom_report_front_footer', 5, 15,
$config['custom_report_front_footer'], 'style="width: 38em;"', true);
$table->data[$row][0] = __('Show QR Code icon in the header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 1, '',
$config["show_qr_code_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 0, '',
$config["show_qr_code_header"], true);
$row++;
$table->data[$row][0] = __('Custom graphviz directory') .
ui_print_help_tip (__("Custom directory where the graphviz binaries are stored."), true);
$table->data[$row][1] = html_print_input_text ('graphviz_bin_dir',
$config["graphviz_bin_dir"], '', 50, 255, true);
$row++;
$table->data[$row][0] = __('Networkmap max width');
$table->data[$row][1] = html_print_input_text ('networkmap_max_width',
$config["networkmap_max_width"], '', 10, 20, true);
$row++;
$table->data[$row][0] = __('Show only the group name');
$table->data[$row][0] .= ui_print_help_tip(
__('Show the group name instead the group icon.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_group_name', 1, '',
$config["show_group_name"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_group_name', 0, '',
$config["show_group_name"], true);
$row++;
$table->data[$row][0] = __('Date format string') . ui_print_help_icon("date_format", true); $table->data[$row][0] = __('Date format string') . ui_print_help_icon("date_format", true);
$table->data[$row][1] = '<em>'.__('Example').'</em> '.date ($config["date_format"]); $table->data[$row][1] = '<em>'.__('Example').'</em> '.date ($config["date_format"]);
$table->data[$row][1] .= html_print_input_text ('date_format', $config["date_format"], '', 30, 100, true); $table->data[$row][1] .= html_print_input_text ('date_format', $config["date_format"], '', 30, 100, true);
$row++; $row++;
if ($config['prominent_time'] == 'comparation') { if ($config['prominent_time'] == 'comparation') {
@ -65,7 +491,6 @@ else if ($config['prominent_time'] == 'timestamp') {
$timestamp = true; $timestamp = true;
$comparation = false; $comparation = false;
} }
$table->data[$row][0] = __('Timestamp or time comparation') . ui_print_help_icon ("time_stamp-comparation", true); $table->data[$row][0] = __('Timestamp or time comparation') . ui_print_help_icon ("time_stamp-comparation", true);
$table->data[$row][1] = __('Comparation in rollover') . ' '; $table->data[$row][1] = __('Comparation in rollover') . ' ';
$table->data[$row][1] .= html_print_radio_button ('prominent_time', "comparation", '', $comparation, true); $table->data[$row][1] .= html_print_radio_button ('prominent_time', "comparation", '', $comparation, true);
@ -74,63 +499,9 @@ $table->data[$row][1] .= html_print_radio_button ('prominent_time', "timestamp",
$row++; $row++;
$table->data[$row][0] = __('Graph color (min)');
$table->data[$row][1] = html_print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (avg)');
$table->data[$row][1] = html_print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color (max)');
$table->data[$row][1] = html_print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #4');
$table->data[$row][1] = html_print_input_text ('graph_color4', $config["graph_color4"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #5');
$table->data[$row][1] = html_print_input_text ('graph_color5', $config["graph_color5"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #6');
$table->data[$row][1] = html_print_input_text ('graph_color6', $config["graph_color6"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #7');
$table->data[$row][1] = html_print_input_text ('graph_color7', $config["graph_color7"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #8');
$table->data[$row][1] = html_print_input_text ('graph_color8', $config["graph_color8"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #9');
$table->data[$row][1] = html_print_input_text ('graph_color9', $config["graph_color9"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graph color #10');
$table->data[$row][1] = html_print_input_text ('graph_color10', $config["graph_color10"], '', 8, 8, true);
$row++;
$table->data[$row][0] = __('Graphic resolution (1-low, 5-high)');
$table->data[$row][1] = html_print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// CUSTOM VALUES POST PROCESS // CUSTOM VALUES POST PROCESS
//---------------------------------------------------------------------- //----------------------------------------------------------------------
$row++;
$table->data[$row][0] = __('Custom values post process'); $table->data[$row][0] = __('Custom values post process');
$table->data[$row][1] = "<table>"; $table->data[$row][1] = "<table>";
$table->data[$row][1] .= __('Value') . ':&nbsp;' . $table->data[$row][1] .= __('Value') . ':&nbsp;' .
@ -187,324 +558,6 @@ $table->data[$row][1] .= html_print_input_hidden ('interval_values', $config["in
// This hidden field will be filled from jQuery before submit // This hidden field will be filled from jQuery before submit
$table->data[$row][1] .= html_print_input_hidden ('interval_to_delete', '', true); $table->data[$row][1] .= html_print_input_hidden ('interval_to_delete', '', true);
//---------------------------------------------------------------------- //----------------------------------------------------------------------
$row++;
$table->data[$row][0] = __('Style template');
$table->data[$row][1] = html_print_select (themes_get_css (), 'style', $config["style"].'.css', '', '', '', true);
$row++;
$table->data[$row][0] = __('Block size for pagination');
$table->data[$row][1] = html_print_input_text ('block_size', $config["global_block_size"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Use round corners');
$table->data[$row][1] = __('Yes').'&nbsp;'.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;'.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
$row++;
$table->data[$row][0] = __('Status icon set');
$iconsets["default"] = __('Colors');
$iconsets["faces"] = __('Faces');
$iconsets["color_text"] = __('Colors and text');
$table->data[$row][1] = html_print_select ($iconsets, 'status_images_set', $config["status_images_set"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'status_set_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Font path');
$fonts = load_fonts();
$table->data[$row][1] = html_print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true);
$row++;
$table->data[$row][0] = __('Font size');
$font_size_array = array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
10 => 10,
11 => 11,
12 => 12,
13 => 13,
14 => 14,
15 => 15);
$table->data[$row][1] = html_print_select($font_size_array, 'font_size', $config["font_size"], '', '', 0, true);
$row++;
$table->data[$row][0] = __('Interactive charts') . ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true);
$table->data[$row][1] = __('Yes').'&nbsp;'.html_print_radio_button ('flash_charts', 1, '', $config["global_flash_charts"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No').'&nbsp;'.html_print_radio_button ('flash_charts', 0, '', $config["global_flash_charts"], true);
$row++;
$table->data[$row][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true);
$table->data[$row][1] = html_print_select(
list_files('images/custom_logo', "png", 1, 0), 'custom_logo',
$config["custom_logo"], '', '', '', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'custom_logo_preview', false, '', '', true);
$row++;
$table->data[$row][0] = __('Login background') . ui_print_help_tip(__('You can place your custom images into the folder images/backgrounds/'), true);
$backgrounds_list_jpg = list_files("images/backgrounds", "jpg", 1, 0);
$backgrounds_list_gif = list_files("images/backgrounds", "gif", 1, 0);
$backgrounds_list_png = list_files("images/backgrounds", "png", 1, 0);
$backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
asort($backgrounds_list);
$table->data[$row][1] = html_print_select ($backgrounds_list,
'login_background', $config["login_background"], '', __('Default'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'login_background_preview', false, '', '', true);
$row++;
$values = array ();
$values[5] = human_time_description_raw (5);
$values[30] = human_time_description_raw (30);
$values[SECONDS_1MINUTE] = human_time_description_raw(SECONDS_1MINUTE);
$values[SECONDS_2MINUTES] = human_time_description_raw(SECONDS_2MINUTES);
$values[SECONDS_5MINUTES] = human_time_description_raw(SECONDS_5MINUTES);
$values[SECONDS_10MINUTES] = human_time_description_raw(SECONDS_10MINUTES);
$values[SECONDS_30MINUTES] = human_time_description_raw(SECONDS_30MINUTES);
$table->data[$row][0] = __('Default interval for refresh on Visual Console') . ui_print_help_tip(__('This interval will affect to Visual Console pages'), true);
$table->data[$row][1] = html_print_select ($values, 'vc_refr', $config["vc_refr"], '', 'N/A', 0, true, false, false);
$row++;
if (empty($config["vc_line_thickness"])) $config["vc_line_thickness"] = 2;
$table->data[$row][0] = __('Default line thickness for the Visual Console') . ui_print_help_tip(__('This interval will affect to the lines between elements on the Visual Console'), true);
$table->data[$row][1] = html_print_input_text ('vc_line_thickness', $config["vc_line_thickness"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Agent size text') . ui_print_help_tip(__('When the agent name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('agent_size_text_small', $config["agent_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('agent_size_text_medium', $config["agent_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Module size text') . ui_print_help_tip(__('When the module name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = __('Small:') . html_print_input_text ('module_size_text_small', $config["module_size_text_small"], '', 3, 3, true);
$table->data[$row][1] .= ' ' . __('Normal:') . html_print_input_text ('module_size_text_medium', $config["module_size_text_medium"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Description size text') . ui_print_help_tip(__('When the description name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text ('description_size_text', $config["description_size_text"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('Item title size text') .
ui_print_help_tip(__('When the item title name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true);
$table->data[$row][1] = html_print_input_text('item_title_size_text',
$config["item_title_size_text"], '', 3, 3, true);
$row++;
$table->data[$row][0] = __('GIS Labels') .
ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true);
$row++;
$listIcons = gis_get_array_list_icons();
$arraySelectIcon = array();
foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index;
$table->data[$row][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true);
$table->data[$row][1] = html_print_select($arraySelectIcon,
"gis_default_icon", $config["gis_default_icon"], "", __('None'),
'', true);
$table->data[$row][1] .= "&nbsp;" . html_print_button(__("View"), 'gis_icon_preview', false, '', '', true);
$row++;
// For 5.1 Autohidden menu feature
$table->data['autohidden'][0] = __('Autohidden menu');
$table->data['autohidden'][1] = html_print_checkbox('autohidden_menu',
1, $config['autohidden_menu'], true);
// Juanma (07/05/2014) New feature: Table for custom front page for reports
$table->data[$row][0] = __('Custom report front page') .
ui_print_help_tip(__('Custom report front page. It will be applied to all reports and templates by default.'), true);
$table->data[$row][1] = html_print_checkbox('custom_report_front', 1,
$config['custom_report_front'], true);
$row++;
$dirItems = scandir($config['homedir'] . '/images/custom_logo');
foreach ($dirItems as $entryDir) {
if (strstr($entryDir, '.jpg') !== false) {
$customLogos['images/custom_logo/' . $entryDir] = $entryDir;
}
}
$_fonts = array();
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$_fonts[$entryDir] = $entryDir;
}
}
// Font
$table->data['custom_report_front-font'][0] = __('Custom report front') . ' - ' . __('Font family');
$table->data['custom_report_front-font'][1] = html_print_select ($_fonts,
'custom_report_front_font', $config['custom_report_front_font'],
false, __('Default'), '', true);
// Logo
$table->data['custom_report_front-logo'][0] = __('Custom report front') . ' - ' .
__('Custom logo') .
ui_print_help_tip(
__("The dir of custom logos is in your www Pandora Console in \"images/custom_logo\". You can upload more files (ONLY JPEG) in upload tool in console."), true);
$table->data['custom_report_front-logo'][1] = html_print_select(
$customLogos,
'custom_report_front_logo',
$config['custom_report_front_logo'],
'showPreview()',
__('Default'),
'',
true);
// Preview
$table->data['custom_report_front-preview'][0] = __('Custom report front') . ' - ' . 'Preview';
if (empty($config['custom_report_front_logo'])) {
$config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg';
}
$table->data['custom_report_front-preview'][1] = '<span id="preview_image">' .
html_print_image ($config['custom_report_front_logo'], true) . '</span>';
// Header
$table->data['custom_report_front-header'][0] = __('Custom report front') . ' - ' . __('Header');
$table->data['custom_report_front-header'][1] = html_print_textarea('custom_report_front_header', 5, 15,
$config['custom_report_front_header'], 'style="width: 38em;"', true);
// First page
$table->data['custom_report_front-first_page'][0] = __('Custom report front') . ' - ' . __('First page');
$table->data['custom_report_front-first_page'][1] = html_print_textarea('custom_report_front_firstpage', 15, 15,
$config['custom_report_front_firstpage'], 'style="width: 38em; height: 20em;"', true);
// Footer
$table->data['custom_report_front-footer'][0] = __('Custom report front') . ' - ' . __('Footer');
$table->data['custom_report_front-footer'][1] = html_print_textarea('custom_report_front_footer', 5, 15,
$config['custom_report_front_footer'], 'style="width: 38em;"', true);
$table->data[$row][0] = __('Paginate module view');
$table->data[$row][1] = html_print_checkbox('paginate_module', 1,
$config['paginate_module'], true);
$row++;
$table->data[$row][0] = __('Show QR Code icon in the header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 1, '',
$config["show_qr_code_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_qr_code_header', 0, '',
$config["show_qr_code_header"], true);
$row++;
$table->data[$row][0] = __('Custom graphviz directory') .
ui_print_help_tip (__("Custom directory where the graphviz binaries are stored."), true);
$table->data[$row][1] = html_print_input_text ('graphviz_bin_dir',
$config["graphviz_bin_dir"], '', 50, 255, true);
$row++;
$table->data[$row][0] = __('Networkmap max width');
$table->data[$row][1] = html_print_input_text ('networkmap_max_width',
$config["networkmap_max_width"], '', 10, 20, true);
$row++;
$table->data[$row][0] = __('Fixed header');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_header', 1, '', $config["fixed_header"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_header', 0, '', $config["fixed_header"], true);
$row++;
$table->data[$row][0] = __('Fixed menu');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 1, '', $config["fixed_menu"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true);
$row++;
if (!isset($config["short_module_graph_data"]))
$config["short_module_graph_data"] = true;
$table->data[$row][0] = __('Shortened module graph data');
$table->data[$row][0] .= ui_print_help_tip(__('The data number of the module graphs will be rounded and shortened'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 1, '',
$config["short_module_graph_data"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('short_module_graph_data', 0, '',
$config["short_module_graph_data"], true);
$row++;
$table->data[$row][0] = __('Show only the group name');
$table->data[$row][0] .= ui_print_help_tip(
__('Show the group name instead the group icon.'), true);
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('show_group_name', 1, '',
$config["show_group_name"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('show_group_name', 0, '',
$config["show_group_name"], true);
$row++;
$table->data[$row][0] = __('Default line thickness for the Custom Graph.');
$table->data[$row][1] = html_print_input_text ('custom_graph_widht',
$config["custom_graph_widht"], '', 5, 5, true);
$row++;
$table->data[$row][0] = __('Render data of module type is proc.');
$table->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('render_proc', 1, '',
$config["render_proc"], true) .
'&nbsp;&nbsp;';
$table->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('render_proc', 0, '',
$config["render_proc"], true);
$row++; $row++;

View File

@ -181,7 +181,8 @@ else
echo "<tr>"; echo "<tr>";
echo "<td align='left'>"; echo "<td align='left'>";
echo '<b>' . __("Url") . '</b>'; echo '<b>' . __("Url") . '</b>';
echo ui_print_help_tip (__("Hyperlink to help information that has to exist previously."), true); echo ui_print_help_tip(
__("Hyperlink to help information that has to exist previously."), true);
echo "</td>"; echo "</td>";
echo "<td align='left'>"; echo "<td align='left'>";
html_print_input_text ('url_tag', $url_tag); html_print_input_text ('url_tag', $url_tag);
@ -190,7 +191,8 @@ else
echo "<tr>"; echo "<tr>";
echo "<td align='left'>"; echo "<td align='left'>";
echo '<b>' . __("Email") . '</b>'; echo '<b>' . __("Email") . '</b>';
echo ui_print_help_tip (__("Associated Email direction to use later in alerts associated to Tags."), true); echo ui_print_help_tip(
__("Associated Email direction to use later in alerts associated to Tags."), true);
echo "</td>"; echo "</td>";
echo "<td align='left'>"; echo "<td align='left'>";
html_print_textarea('email_tag', 5, 20, $email_tag); html_print_textarea('email_tag', 5, 20, $email_tag);
@ -199,7 +201,8 @@ else
echo "<tr>"; echo "<tr>";
echo "<td align='left'>"; echo "<td align='left'>";
echo '<b>' . __("Phone") . '</b>'; echo '<b>' . __("Phone") . '</b>';
echo ui_print_help_tip (__("Associated phone number to use later in alerts associated to Tags."), true); echo ui_print_help_tip(
__("Associated phone number to use later in alerts associated to Tags."), true);
echo "</td>"; echo "</td>";
echo "<td align='left'>"; echo "<td align='left'>";
html_print_textarea('phone_tag', 5, 20, $phone_tag); html_print_textarea('phone_tag', 5, 20, $phone_tag);

View File

@ -140,7 +140,8 @@ if (!defined('METACONSOLE')) {
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";
echo "</table>"; echo "</table>";
}else{ }
else {
$filters = '<form method=post class="filters_form" action="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag=0">'; $filters = '<form method=post class="filters_form" action="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag=0">';
$filters .= "<table border=0 cellpadding=0 cellspacing=0 class=databox_filters width=70%>"; $filters .= "<table border=0 cellpadding=0 cellspacing=0 class=databox_filters width=70%>";

View File

@ -511,7 +511,8 @@ if (!$meta) {
$table->data[11][0] = __('Interactive charts'). ' ' .ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true) ; $table->data[11][0] = __('Interactive charts'). ' ' .ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true) ;
$values = array(-1 => __('Use global conf'), 1 => __('Yes'), 0 => __('No')); $values = array(-1 => __('Use global conf'), 1 => __('Yes'), 0 => __('No'));
$table->data[11][1] = html_print_select($values, 'flash_charts', $user_info["flash_chart"], '', '', -1, true, false, false); $table->data[11][1] = html_print_select($values, 'flash_charts',
$user_info["flash_chart"], '', '', -1, true, false, false);
$table->data[12][0] = __('Block size for pagination'); $table->data[12][0] = __('Block size for pagination');
$table->data[12][1] = html_print_input_text ('block_size', $user_info["block_size"], '', 5, 5, true); $table->data[12][1] = html_print_input_text ('block_size', $user_info["block_size"], '', 5, 5, true);

View File

@ -241,7 +241,8 @@ if(defined('METACONSOLE')){
$form_filter .= html_print_table($table, true); $form_filter .= html_print_table($table, true);
$form_filter .= "</form>"; $form_filter .= "</form>";
ui_toggle($form_filter, __('Show Options')); ui_toggle($form_filter, __('Show Options'));
}else{ }
else {
$form_filter = "<form method='post'>"; $form_filter = "<form method='post'>";
$form_filter .= html_print_table($table, true); $form_filter .= html_print_table($table, true);
$form_filter .= "</form>"; $form_filter .= "</form>";

View File

@ -181,7 +181,8 @@ if ($get_module_detail) {
"modules_format_time", "modules_format_time",
"align" => "left", "align" => "left",
"width" => "50px"); "width" => "50px");
}else{ }
else {
$columns["Timestamp"] = array( $columns["Timestamp"] = array(
"utimestamp", "utimestamp",
"modules_format_timestamp", "modules_format_timestamp",
@ -904,7 +905,8 @@ if ($list_modules) {
$salida = format_numeric($module["datos"]); $salida = format_numeric($module["datos"]);
break; break;
} }
}else{ }
else {
$salida = format_numeric($module["datos"]); $salida = format_numeric($module["datos"]);
} }
// Show units ONLY in numeric data types // Show units ONLY in numeric data types

View File

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

View File

@ -314,6 +314,7 @@ define ('MODULE_PREDICTION_NETFLOW', 4);
/* SNMP CONSTANTS */ /* SNMP CONSTANTS */
define('SNMP_DIR_MIBS', "attachment/mibs"); define('SNMP_DIR_MIBS', "attachment/mibs");
define('SNMP_TRAP_TYPE_NONE', -1); define('SNMP_TRAP_TYPE_NONE', -1);
define('SNMP_TRAP_TYPE_COLD_START', 0); define('SNMP_TRAP_TYPE_COLD_START', 0);
define('SNMP_TRAP_TYPE_WARM_START', 1); define('SNMP_TRAP_TYPE_WARM_START', 1);
@ -428,4 +429,8 @@ define("COLLECTION_UNSAVED", 3);
/* PAGINATION */ /* PAGINATION */
define("PAGINATION_BLOCKS_LIMIT", 15); define("PAGINATION_BLOCKS_LIMIT", 15);
/* CHARTS */
define("CHART_DEFAULT_WIDTH", 150);
define("CHART_DEFAULT_HEIGHT", 110);
?> ?>

View File

@ -223,7 +223,7 @@ function oracle_db_process_sql($sql, $rettype = "affected_rows", $dbconnection =
if ($sql == '') if ($sql == '')
return false; return false;
$cache = false;
if ($cache && ! empty ($sql_cache[$sql])) { if ($cache && ! empty ($sql_cache[$sql])) {
$retval = $sql_cache[$sql]; $retval = $sql_cache[$sql];
$sql_cache['saved']++; $sql_cache['saved']++;
@ -433,9 +433,6 @@ function oracle_db_process_sql_insert($table, $values, $autocommit = true) {
$query .= ' VALUES (' . $values_str . ')'; $query .= ' VALUES (' . $values_str . ')';
$status = ''; $status = '';
return db_process_sql($query, 'insert_id', '', true, $status, $autocommit); return db_process_sql($query, 'insert_id', '', true, $status, $autocommit);
} }
@ -1209,10 +1206,6 @@ function oracle_db_process_sql_update($table, $values, $where = false, $where_jo
} }
$status = ''; $status = '';
return db_process_sql ($query, "affected_rows", '', true, $status, $autocommit); return db_process_sql ($query, "affected_rows", '', true, $status, $autocommit);
} }

View File

@ -2241,7 +2241,11 @@ function print_audit_csv ($data) {
header("Expires: 0"); header("Expires: 0");
if ($data) { if ($data) {
echo __('User') . ';' . __('Action') . ';' . __('Date') . ';' . __('Source ID') . ';'. __('Comments') ."\n"; echo __('User') . ';' .
__('Action') . ';' .
__('Date') . ';' .
__('Source ID') . ';' .
__('Comments') ."\n";
foreach ($data as $line) { foreach ($data as $line) {
echo io_safe_output($line['id_usuario']) . ';' . io_safe_output($line['accion']) . ';' . $line['fecha'] . ';' . $line['ip_origen'] . ';'. io_safe_output($line['descripcion']). "\n"; echo io_safe_output($line['id_usuario']) . ';' . io_safe_output($line['accion']) . ';' . $line['fecha'] . ';' . $line['ip_origen'] . ';'. io_safe_output($line['descripcion']). "\n";
} }

View File

@ -1644,14 +1644,16 @@ function api_set_update_network_module($id_module, $thrash1, $other, $thrash3){
if ($id_module == "") { if ($id_module == "") {
returnError('error_update_network_module', __('Error updating network module. Module name cannot be left blank.')); returnError('error_update_network_module',
__('Error updating network module. Module name cannot be left blank.'));
return; return;
} }
$check_id_module = db_get_value ('id_agente_modulo', 'tagente_modulo', 'id_agente_modulo', $id_module); $check_id_module = db_get_value ('id_agente_modulo', 'tagente_modulo', 'id_agente_modulo', $id_module);
if (!$check_id_module) { if (!$check_id_module) {
returnError('error_update_network_module', __('Error updating network module. Id_module doesn\'t exists.')); returnError('error_update_network_module',
__('Error updating network module. Id_module doesn\'t exists.'));
return; return;
} }
@ -1660,7 +1662,9 @@ function api_set_update_network_module($id_module, $thrash1, $other, $thrash3){
$id_agent_old = db_get_value ('id_agente', 'tagente_modulo', 'id_agente_modulo', $id_module); $id_agent_old = db_get_value ('id_agente', 'tagente_modulo', 'id_agente_modulo', $id_module);
if ($id_agent_old != $other['data'][0]) { if ($id_agent_old != $other['data'][0]) {
$id_module_exists = db_get_value_filter ('id_agente_modulo', 'tagente_modulo', array('nombre' => $module_name, 'id_agente' => $other['data'][0])); $id_module_exists = db_get_value_filter ('id_agente_modulo',
'tagente_modulo',
array('nombre' => $module_name, 'id_agente' => $other['data'][0]));
if ($id_module_exists) { if ($id_module_exists) {
returnError('error_update_network_module', returnError('error_update_network_module',
@ -2298,21 +2302,28 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) {
if ($other['data'][13] == "3") { if ($other['data'][13] == "3") {
if ($other['data'][22] != "AES" and $other['data'][22] != "DES") { if ($other['data'][22] != "AES" and $other['data'][22] != "DES") {
returnError('error_create_snmp_module', __('Error in creation SNMP module. snmp3_priv_method doesn\'t exists. Set it to \'AES\' or \'DES\'. ')); returnError('error_create_snmp_module',
__('Error in creation SNMP module. snmp3_priv_method doesn\'t exists. Set it to \'AES\' or \'DES\'. '));
return; return;
} }
if ($other['data'][24] != "authNoPriv" and $other['data'][24] != "authPriv" and $other['data'][24] != "noAuthNoPriv"){ if ($other['data'][24] != "authNoPriv"
returnError('error_create_snmp_module', __('Error in creation SNMP module. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. ')); and $other['data'][24] != "authPriv"
and $other['data'][24] != "noAuthNoPriv") {
returnError('error_create_snmp_module',
__('Error in creation SNMP module. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. '));
return; return;
} }
if ($other['data'][25] != "MD5" and $other['data'][25] != "SHA") { if ($other['data'][25] != "MD5" and $other['data'][25] != "SHA") {
returnError('error_create_snmp_module', __('Error in creation SNMP module. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. ')); returnError('error_create_snmp_module',
__('Error in creation SNMP module. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. '));
return; return;
} }
$snmp_module_fields = array('id_agente', $snmp_module_fields = array(
'id_agente',
'disabled', 'disabled',
'id_module_group', 'id_module_group',
'min_warning', 'min_warning',
@ -2347,7 +2358,8 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) {
'min_ff_event_critical'); 'min_ff_event_critical');
} }
else { else {
$snmp_module_fields = array('id_agente', $snmp_module_fields = array(
'id_agente',
'disabled', 'disabled',
'id_module_group', 'id_module_group',
'min_warning', 'min_warning',
@ -2618,13 +2630,18 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) {
return; return;
} }
if ($other['data'][25] != "authNoPriv" and $other['data'][25] != "authPriv" and $other['data'][25] != "noAuthNoPriv"){ if ($other['data'][25] != "authNoPriv"
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. ')); and $other['data'][25] != "authPriv"
and $other['data'][25] != "noAuthNoPriv") {
returnError('error_set_new_snmp_component',
__('Error creating SNMP component. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. '));
return; return;
} }
if ($other['data'][24] != "MD5" and $other['data'][24] != "SHA") { if ($other['data'][24] != "MD5" and $other['data'][24] != "SHA") {
returnError('error_set_new_snmp_component', __('Error creating SNMP component. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. ')); returnError('error_set_new_snmp_component',
__('Error creating SNMP component. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. '));
return; return;
} }
@ -3275,24 +3292,28 @@ function api_set_create_module_template($id, $thrash1, $other, $thrash3) {
} }
if ($id == "") { if ($id == "") {
returnError('error_module_to_template', __('Error assigning module to template. Id_template cannot be left blank.')); returnError('error_module_to_template',
__('Error assigning module to template. Id_template cannot be left blank.'));
return; return;
} }
if ($other['data'][0] == "") { if ($other['data'][0] == "") {
returnError('error_module_to_template', __('Error assigning module to template. Id_module cannot be left blank.')); returnError('error_module_to_template',
__('Error assigning module to template. Id_module cannot be left blank.'));
return; return;
} }
if ($other['data'][1] == "") { if ($other['data'][1] == "") {
returnError('error_module_to_template', __('Error assigning module to template. Id_agent cannot be left blank.')); returnError('error_module_to_template',
__('Error assigning module to template. Id_agent cannot be left blank.'));
return; return;
} }
$result_template = alerts_get_alert_template($id); $result_template = alerts_get_alert_template($id);
if (!$result_template) { if (!$result_template) {
returnError('error_module_to_template', __('Error assigning module to template. Id_template doensn\'t exists.')); returnError('error_module_to_template',
__('Error assigning module to template. Id_template doensn\'t exists.'));
return; return;
} }
@ -3472,7 +3493,8 @@ function api_set_validate_all_alerts($id, $thrash1, $other, $thrash3) {
$agents_string = implode(',', $result_agents); $agents_string = implode(',', $result_agents);
$sql = sprintf ("SELECT talert_template_modules.id $sql = sprintf ("
SELECT talert_template_modules.id
FROM talert_template_modules FROM talert_template_modules
INNER JOIN tagente_modulo t2 INNER JOIN tagente_modulo t2
ON talert_template_modules.id_agent_module = t2.id_agente_modulo ON talert_template_modules.id_agent_module = t2.id_agente_modulo
@ -3556,7 +3578,8 @@ function api_set_validate_all_policy_alerts($id, $thrash1, $other, $thrash3) {
// If the policy has alerts // If the policy has alerts
if (count($result_pol_alerts) != 0) { if (count($result_pol_alerts) != 0) {
$sql = sprintf ("SELECT id $sql = sprintf ("
SELECT id
FROM talert_template_modules FROM talert_template_modules
WHERE id_policy_alerts IN (%s)", WHERE id_policy_alerts IN (%s)",
$id_pol_alerts); $id_pol_alerts);
@ -3899,13 +3922,17 @@ function api_set_update_data_module_policy($id, $thrash1, $other, $thrash3) {
} }
if ($module_policy[0]['id_module'] != 1) { if ($module_policy[0]['id_module'] != 1) {
returnError('error_update_data_module_policy', __('Error updating data module in policy. Module type is not network type.')); returnError('error_update_data_module_policy',
__('Error updating data module in policy. Module type is not network type.'));
return; return;
} }
$fields_data_module = array('id','description', 'id_module_group', 'min', 'max', 'post_process', 'module_interval', $fields_data_module = array(
'min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'id','description', 'id_module_group', 'min', 'max',
'history_data', 'configuration_data', 'disabled_types_event', 'module_macros'); 'post_process', 'module_interval', 'min_warning', 'max_warning',
'str_warning', 'min_critical', 'max_critical', 'str_critical',
'history_data', 'configuration_data', 'disabled_types_event',
'module_macros');
$cont = 0; $cont = 0;
foreach ($fields_data_module as $field) { foreach ($fields_data_module as $field) {
@ -3917,13 +3944,15 @@ function api_set_update_data_module_policy($id, $thrash1, $other, $thrash3) {
} }
$result_update = enterprise_hook('policies_update_module', array($other['data'][0], $values, false)); $result_update = enterprise_hook('policies_update_module',
array($other['data'][0], $values, false));
if ($result_update < 0) if ($result_update < 0)
returnError('error_update_data_module_policy', 'Error updating policy module.'); returnError('error_update_data_module_policy', 'Error updating policy module.');
else else
returnData('string', array('type' => 'string', 'data' => __('Data policy module updated.'))); returnData('string',
array('type' => 'string', 'data' => __('Data policy module updated.')));
} }
/** /**
@ -4630,32 +4659,45 @@ function api_set_update_snmp_module_policy($id, $thrash1, $other, $thrash3) {
if ($other['data'][12] == "3") { if ($other['data'][12] == "3") {
if ($other['data'][21] != "AES" and $other['data'][21] != "DES") { if ($other['data'][21] != "AES" and $other['data'][21] != "DES") {
returnError('error_update_snmp_module_policy', __('Error updating SNMP module. snmp3_priv_method doesn\'t exists. Set it to \'AES\' or \'DES\'. ')); returnError('error_update_snmp_module_policy',
__('Error updating SNMP module. snmp3_priv_method doesn\'t exists. Set it to \'AES\' or \'DES\'. '));
return; return;
} }
if ($other['data'][23] != "authNoPriv" and $other['data'][23] != "authPriv" and $other['data'][23] != "noAuthNoPriv"){ if ($other['data'][23] != "authNoPriv"
returnError('error_update_snmp_module_policy', __('Error updating SNMP module. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. ')); and $other['data'][23] != "authPriv"
and $other['data'][23] != "noAuthNoPriv") {
returnError('error_update_snmp_module_policy',
__('Error updating SNMP module. snmp3_sec_level doesn\'t exists. Set it to \'authNoPriv\' or \'authPriv\' or \'noAuthNoPriv\'. '));
return; return;
} }
if ($other['data'][24] != "MD5" and $other['data'][24] != "SHA") { if ($other['data'][24] != "MD5" and $other['data'][24] != "SHA") {
returnError('error_update_snmp_module_policy', __('Error updating SNMP module. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. ')); returnError('error_update_snmp_module_policy',
__('Error updating SNMP module. snmp3_auth_method doesn\'t exists. Set it to \'MD5\' or \'SHA\'. '));
return; return;
} }
$fields_snmp_module = array('id','disabled', 'id_module_group', 'min_warning', 'max_warning', 'str_warning', 'min_critical', $fields_snmp_module = array('id','disabled', 'id_module_group',
'max_critical', 'str_critical', 'min_ff_event', 'history_data', 'tcp_port', 'tcp_send', 'snmp_community', 'min_warning', 'max_warning', 'str_warning', 'min_critical',
'snmp_oid', 'module_interval', 'post_process', 'min', 'max', 'custom_id', 'description', 'custom_string_1', 'max_critical', 'str_critical', 'min_ff_event',
'custom_string_2', 'custom_string_3', 'plugin_parameter', 'plugin_user', 'plugin_pass'); 'history_data', 'tcp_port', 'tcp_send', 'snmp_community',
'snmp_oid', 'module_interval', 'post_process', 'min', 'max',
'custom_id', 'description', 'custom_string_1',
'custom_string_2', 'custom_string_3', 'plugin_parameter',
'plugin_user', 'plugin_pass');
} }
else { else {
$fields_snmp_module = array('id','disabled', 'id_module_group', 'min_warning', 'max_warning', 'str_warning', 'min_critical', $fields_snmp_module = array('id','disabled', 'id_module_group',
'max_critical', 'str_critical', 'min_ff_event', 'history_data', 'tcp_port', 'tcp_send', 'snmp_community', 'min_warning', 'max_warning', 'str_warning', 'min_critical',
'snmp_oid', 'module_interval', 'post_process', 'min', 'max', 'custom_id', 'description'); 'max_critical', 'str_critical', 'min_ff_event',
'history_data', 'tcp_port', 'tcp_send', 'snmp_community',
'snmp_oid', 'module_interval', 'post_process', 'min', 'max',
'custom_id', 'description');
} }
$cont = 0; $cont = 0;
@ -4667,13 +4709,15 @@ function api_set_update_snmp_module_policy($id, $thrash1, $other, $thrash3) {
$cont++; $cont++;
} }
$result_update = enterprise_hook('policies_update_module', array($other['data'][0], $values, false)); $result_update = enterprise_hook('policies_update_module',
array($other['data'][0], $values, false));
if ($result_update < 0) if ($result_update < 0)
returnError('error_update_snmp_module_policy', 'Error updating policy module.'); returnError('error_update_snmp_module_policy', 'Error updating policy module.');
else else
returnData('string', array('type' => 'string', 'data' => __('SNMP policy module updated.'))); returnData('string',
array('type' => 'string', 'data' => __('SNMP policy module updated.')));
} }
@ -4720,7 +4764,8 @@ function api_set_apply_policy($id, $thrash1, $other, $thrash3) {
return -1; return -1;
} }
else { else {
returnError('error_apply_policy', __('Error applying policy. This policy is already pending to apply.')); returnError('error_apply_policy',
__('Error applying policy. This policy is already pending to apply.'));
return; return;
} }
} }
@ -5236,18 +5281,21 @@ function api_set_enable_disable_user ($id, $thrash2, $other, $thrash3) {
} }
if ($id == "") { if ($id == "") {
returnError('error_enable_disable_user', 'Error enable/disable user. Id_user cannot be left blank.'); returnError('error_enable_disable_user',
__('Error enable/disable user. Id_user cannot be left blank.'));
return; return;
} }
if ($other['data'][0] != "0" and $other['data'][0] != "1") { if ($other['data'][0] != "0" and $other['data'][0] != "1") {
returnError('error_enable_disable_user', 'Error enable/disable user. Enable/disable value cannot be left blank.'); returnError('error_enable_disable_user',
__('Error enable/disable user. Enable/disable value cannot be left blank.'));
return; return;
} }
if (users_get_user_by_id($id) == false) { if (users_get_user_by_id($id) == false) {
returnError('error_enable_disable_user', 'Error enable/disable user. The user doesn\'t exists.'); returnError('error_enable_disable_user',
__('Error enable/disable user. The user doesn\'t exists.'));
return; return;
} }
@ -5255,14 +5303,17 @@ function api_set_enable_disable_user ($id, $thrash2, $other, $thrash3) {
if (is_error($result)) { if (is_error($result)) {
// TODO: Improve the error returning more info // TODO: Improve the error returning more info
returnError('error_enable_disable_user', __('Error in user enabling/disabling.')); returnError('error_enable_disable_user',
__('Error in user enabling/disabling.'));
} }
else { else {
if ($other['data'][0] == "0") { if ($other['data'][0] == "0") {
returnData('string', array('type' => 'string', 'data' => __('Enabled user.'))); returnData('string',
array('type' => 'string', 'data' => __('Enabled user.')));
} }
else { else {
returnData('string', array('type' => 'string', 'data' => __('Disabled user.'))); returnData('string',
array('type' => 'string', 'data' => __('Disabled user.')));
} }
} }
} }
@ -7697,24 +7748,28 @@ function api_set_enable_disable_agent ($id, $thrash2, $other, $thrash3) {
} }
if ($id == "") { if ($id == "") {
returnError('error_enable_disable_agent', 'Error enable/disable agent. Id_agent cannot be left blank.'); returnError('error_enable_disable_agent',
__('Error enable/disable agent. Id_agent cannot be left blank.'));
return; return;
} }
if ($other['data'][0] != "0" and $other['data'][0] != "1") { if ($other['data'][0] != "0" and $other['data'][0] != "1") {
returnError('error_enable_disable_agent', 'Error enable/disable agent. Enable/disable value cannot be left blank.'); returnError('error_enable_disable_agent',
__('Error enable/disable agent. Enable/disable value cannot be left blank.'));
return; return;
} }
if (agents_get_name($id) == false) { if (agents_get_name($id) == false) {
returnError('error_enable_disable_agent', 'Error enable/disable agent. The agent doesn\'t exists.'); returnError('error_enable_disable_agent',
__('Error enable/disable agent. The agent doesn\'t exists.'));
return; return;
} }
$disabled = ( $other['data'][0] ? 0 : 1 ); $disabled = ( $other['data'][0] ? 0 : 1 );
$result = db_process_sql_update('tagente', array('disabled' => $disabled), array('id_agente' => $id)); $result = db_process_sql_update('tagente',
array('disabled' => $disabled), array('id_agente' => $id));
if (is_error($result)) { if (is_error($result)) {
// TODO: Improve the error returning more info // TODO: Improve the error returning more info
@ -7722,10 +7777,14 @@ function api_set_enable_disable_agent ($id, $thrash2, $other, $thrash3) {
} }
else { else {
if ($disabled == 0) { if ($disabled == 0) {
returnData('string', array('type' => 'string', 'data' => __('Enabled agent.'))); returnData('string',
array('type' => 'string',
'data' => __('Enabled agent.')));
} }
else { else {
returnData('string', array('type' => 'string', 'data' => __('Disabled agent.'))); returnData('string',
array('type' => 'string',
'data' => __('Disabled agent.')));
} }
} }
} }
@ -7923,7 +7982,8 @@ function api_set_update_special_day($id_special_day, $thrash2, $other, $thrash3)
} }
$return = db_process_sql_update('talert_special_days', $return = db_process_sql_update('talert_special_days',
array('date' => $special_day, array(
'date' => $special_day,
'same_day' => $same_day, 'same_day' => $same_day,
'description' => $description, 'description' => $description,
'id_group' => $idGroup), 'id_group' => $idGroup),

View File

@ -365,8 +365,6 @@ function config_update_config () {
$error_update[] = __('Batch statistics period (secs)'); $error_update[] = __('Batch statistics period (secs)');
if (!config_update_value ('agentaccess', (int) get_parameter ('agentaccess'))) if (!config_update_value ('agentaccess', (int) get_parameter ('agentaccess')))
$error_update[] = __('Use agent access graph'); $error_update[] = __('Use agent access graph');
if (!config_update_value ('compact_header', (bool) get_parameter ('compact_header')))
$error_update[] = 'Deprecated compact_header';
if (!config_update_value ('num_files_attachment', (int) get_parameter ('num_files_attachment'))) if (!config_update_value ('num_files_attachment', (int) get_parameter ('num_files_attachment')))
$error_update[] = __('Max. recommended number of files in attachment directory'); $error_update[] = __('Max. recommended number of files in attachment directory');
if (!config_update_value ('delete_notinit', get_parameter ('delete_notinit'))) if (!config_update_value ('delete_notinit', get_parameter ('delete_notinit')))
@ -461,8 +459,10 @@ function config_update_config () {
$error_update[] = __('Shortened module graph data'); $error_update[] = __('Shortened module graph data');
if (!config_update_value ('show_group_name', get_parameter('show_group_name'))) if (!config_update_value ('show_group_name', get_parameter('show_group_name')))
$error_update[] = __('Show the group name instead the group icon.'); $error_update[] = __('Show the group name instead the group icon.');
if (!config_update_value ('custom_graph_widht', (int) get_parameter('custom_graph_widht', 1))) if (!config_update_value ('custom_graph_width', (int) get_parameter('custom_graph_width', 1)))
$error_update[] = __('Default line thickness for the Custom Graph.'); $error_update[] = __('Default line thickness for the Custom Graph.');
if (!config_update_value ('type_module_charts', (string) get_parameter('type_module_charts', 'area')))
$error_update[] = __('Default type of module charts.');
if (!config_update_value ('render_proc', (bool) get_parameter('render_proc', false))) if (!config_update_value ('render_proc', (bool) get_parameter('render_proc', false)))
$error_update[] = __('Render data of module type is proc.'); $error_update[] = __('Render data of module type is proc.');
@ -692,10 +692,6 @@ function config_process_config () {
config_update_value ('https', false); config_update_value ('https', false);
} }
if (!isset ($config["compact_header"])) {
config_update_value ('compact_header', false);
}
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);
} }
@ -1260,9 +1256,14 @@ function config_process_config () {
config_update_value ('show_group_name', 0); config_update_value ('show_group_name', 0);
} }
if (!isset($config['custom_graph_widht'])) { if (!isset($config['custom_graph_width'])) {
config_update_value ('custom_graph_widht', 1); config_update_value ('custom_graph_width', 1);
} }
if (!isset($config['type_module_charts'])) {
config_update_value ('type_module_charts', 'area');
}
if (!isset($config['render_proc'])) { if (!isset($config['render_proc'])) {
config_update_value ('render_proc', 0); config_update_value ('render_proc', 0);
} }

View File

@ -1474,7 +1474,8 @@ function events_get_severity_types ($severity_id){
if (isset($config['text_char_long'])) { if (isset($config['text_char_long'])) {
foreach ($diferent_types as $key => $type) { foreach ($diferent_types as $key => $type) {
if ($key == $severity_id) { if ($key == $severity_id) {
$severity_desc = ui_print_truncate_text($type, $config['text_char_long'], false, true, false); $severity_desc = ui_print_truncate_text($type,
$config['text_char_long'], false, true, false);
} }
} }
} }
@ -2872,11 +2873,12 @@ function events_get_count_events_validated ($filter, $period = null, $date = nul
' OR id_evento LIKE "%%' . io_safe_input($filter_event_search) . '%%")'; ' OR id_evento LIKE "%%' . io_safe_input($filter_event_search) . '%%")';
} }
$sql = sprintf ('SELECT estado, COUNT(*) AS count $sql = sprintf ('SELECT estado,
FROM tevento COUNT(*) AS count
WHERE 1=1 %s %s %s FROM tevento WHERE
%s ' . $sql_where . '
GROUP BY estado', GROUP BY estado',
$date_filter, $sql_filter, $sql_where); $sql_filter);
$rows = db_get_all_rows_sql ($sql); $rows = db_get_all_rows_sql ($sql);

View File

@ -430,7 +430,7 @@ function filemanager_delete_directory($dir) {
* *
* @return array The files in the dirs, empty array for empty dir of files. * @return array The files in the dirs, empty array for empty dir of files.
*/ */
function filemanager_read_recursive_dir($dir, $relative_path = '') { function filemanager_read_recursive_dir($dir, $relative_path = '', $add_empty_dirs = false) {
$return = array(); $return = array();
// Windows compatibility // Windows compatibility
@ -442,10 +442,21 @@ function filemanager_read_recursive_dir($dir, $relative_path = '') {
while (false !== ($entry = readdir($handle))) { while (false !== ($entry = readdir($handle))) {
if (($entry != ".") && ($entry != "..")) { if (($entry != ".") && ($entry != "..")) {
if (is_dir($dir . $entry)) { if (is_dir($dir . $entry)) {
$return = array_merge($return, filemanager_read_recursive_dir($dir . $entry . '/', $relative_path . $entry . '/' )); $return[] = array(
'relative' => $relative_path . $entry,
'absolute' => $dir . $entry,
'dir' => true);
$return = array_merge($return,
filemanager_read_recursive_dir(
$dir . $entry . '/', $relative_path . $entry . '/',
'', $add_empty_dirs));
} }
else { else {
$return[] = array('relative' => $relative_path . $entry, 'absolute' => $dir . $entry); $return[] = array(
'relative' => $relative_path . $entry,
'absolute' => $dir . $entry,
'dir' => false);
} }
} }
} }
@ -540,6 +551,8 @@ function filemanager_file_explorer($real_directory, $relative_directory,
$files = filemanager_list_dir ($real_directory); $files = filemanager_list_dir ($real_directory);
$table = new stdClass();
$table->width = '98%';
$table->id = 'table_filemanager'; $table->id = 'table_filemanager';
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
$table->width = '100%'; $table->width = '100%';

View File

@ -31,7 +31,10 @@
* *
* @return array Void array or prediction of the module data. * @return array Void array or prediction of the module data.
*/ */
function forecast_projection_graph($module_id, $period = 5184000, $prediction_period, $max_value = false, $min_value = false, $csv = false){ function forecast_projection_graph($module_id,
$period = SECONDS_2MONTHS, $prediction_period, $max_value = false,
$min_value = false, $csv = false) {
global $config; global $config;
$max_exec_time = ini_get('max_execution_time'); $max_exec_time = ini_get('max_execution_time');
@ -269,7 +272,8 @@ function forecast_projection_graph($module_id, $period = 5184000, $prediction_pe
* *
* @return mixed timestamp with the prediction date or false * @return mixed timestamp with the prediction date or false
*/ */
function forecast_prediction_date ($module_id, $period = 5184000, $max_value = 0, $min_value = 0){ function forecast_prediction_date ($module_id,
$period = SECONDS_2MONTHS, $max_value = 0, $min_value = 0) {
// Checks interval // Checks interval
if ($min_value > $max_value) { if ($min_value > $max_value) {
return false; return false;

View File

@ -742,12 +742,12 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$series_suffix_str = ' (' . __('Previous') . ')'; $series_suffix_str = ' (' . __('Previous') . ')';
// Build the data of the previous period // Build the data of the previous period
grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, grafico_modulo_sparse_data ($agent_module_id, $period,
$width, $height, $title, $unit_name, $show_events, $width, $height, $title, $unit_name,
$show_alerts, $avg_only, $show_alerts, $avg_only, $date-$period, $unit, $baseline,
$date-$period, $unit, $baseline, $return_data, $show_title, $return_data, $show_title, $projection, $adapt_key,
$projection, $adapt_key, $compare, $compare, $series_suffix, $series_suffix_str,
$series_suffix, $series_suffix_str, $show_unknown); $show_unknown);
switch ($compare) { switch ($compare) {
case 'separated': case 'separated':
@ -759,7 +759,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$color_prev = $color; $color_prev = $color;
break; break;
case 'overlapped': case 'overlapped':
// Store the chart calculated deleting index, because will be over the current period // Store the chart calculated deleting index,
// because will be over the current period
$chart_prev = array_values($chart); $chart_prev = array_values($chart);
$legend_prev = $legend; $legend_prev = $legend;
$series_type_prev = $series_type; $series_type_prev = $series_type;
@ -806,26 +807,64 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$config['homedir'] . "/images/logo_vertical_water.png", $config['homedir'] . "/images/logo_vertical_water.png",
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false)); 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
if ($config['type_module_charts'] === 'area') {
if ($compare === 'separated') { if ($compare === 'separated') {
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend, return
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false), area_graph($flash_chart, $chart, $width, $height/2, $color,
"", $unit, $homeurl, $water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl, $legend, $long_index,
$series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
$series_suffix_str, $menu, $backgroundColor). "", $unit, $homeurl, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $series_type,
$chart_extra_data, $warning_min, $critical_min,
$adapt_key, false, $series_suffix_str, $menu,
$backgroundColor).
'<br>'. '<br>'.
area_graph($flash_chart, $chart_prev, $width, $height/2, $color_prev, $legend_prev, area_graph($flash_chart, $chart_prev, $width, $height/2,
$long_index_prev, ui_get_full_url("images/image_problem.opaque.png", false, false, false), $color_prev, $legend_prev, $long_index_prev,
"", $unit, $homeurl, $water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
$series_type_prev, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false, "", $unit, $homeurl, $water_mark, $config['fontpath'],
$series_suffix_str, $menu, $backgroundColor); $config['font_size'], $unit, $ttl, $series_type_prev,
$chart_extra_data, $warning_min, $critical_min,
$adapt_key, false, $series_suffix_str, $menu,
$backgroundColor);
} }
else { else {
// Color commented not to restrict serie colors // Color commented not to restrict serie colors
return area_graph($flash_chart, $chart, $width, $height, $color, $legend, return
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false), area_graph($flash_chart, $chart, $width, $height, $color,
"", $unit, $homeurl, $water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl, $legend, $long_index,
$series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
$series_suffix_str, $menu, $backgroundColor); "", $unit, $homeurl, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $series_type,
$chart_extra_data, $warning_min, $critical_min,
$adapt_key, false, $series_suffix_str, $menu,
$backgroundColor);
}
}
elseif ($config['type_module_charts'] === 'line') {
if ($compare === 'separated') {
return
line_graph($flash_chart, $chart, $width, $height/2, $color,
$legend, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $homeurl, $backgroundColor).
'<br>'.
line_graph($flash_chart, $chart_prev, $width, $height/2, $color,
$legend, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $homeurl, $backgroundColor);
}
else {
// Color commented not to restrict serie colors
return
line_graph($flash_chart, $chart, $width, $height, $color,
$legend, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $homeurl, $backgroundColor);
}
} }
} }
@ -1968,14 +2007,16 @@ function graph_db_agentes_modulos($width, $height) {
switch ($config['dbtype']) { switch ($config['dbtype']) {
case "mysql": case "mysql":
case "postgresql": case "postgresql":
$modules = db_get_all_rows_sql ('SELECT COUNT(id_agente_modulo), id_agente $modules = db_get_all_rows_sql ('
SELECT COUNT(id_agente_modulo), id_agente
FROM tagente_modulo FROM tagente_modulo
WHERE delete_pending = 0 WHERE delete_pending = 0
GROUP BY id_agente GROUP BY id_agente
ORDER BY 1 DESC LIMIT 10'); ORDER BY 1 DESC LIMIT 10');
break; break;
case "oracle": case "oracle":
$modules = db_get_all_rows_sql ('SELECT COUNT(id_agente_modulo), id_agente $modules = db_get_all_rows_sql ('
SELECT COUNT(id_agente_modulo), id_agente
FROM tagente_modulo FROM tagente_modulo
WHERE rownum <= 10 WHERE rownum <= 10
AND delete_pending = 0 AND delete_pending = 0
@ -3306,6 +3347,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false)); 'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false));
if ($config['type_module_charts'] === 'area') {
if ($compare === 'separated') { if ($compare === 'separated') {
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend, return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false), $long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
@ -3327,6 +3369,32 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu); $chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu);
} }
} }
elseif ($config['type_module_charts'] === 'line') {
if ($compare === 'separated') {
return
line_graph($flash_chart, $chart, $width, $height/2, $color,
$legend, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $homeurl, $backgroundColor).
'<br>'.
line_graph($flash_chart, $chart_prev, $width, $height/2, $color,
$legend, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $homeurl, $backgroundColor);
}
else {
// Color commented not to restrict serie colors
return
line_graph($flash_chart, $chart, $width, $height, $color,
$legend, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $homeurl, $backgroundColor);
}
}
}
/** /**
@ -3827,11 +3895,21 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false)); 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
if ($config['type_module_charts'] === 'area') {
return area_graph($flash_chart, $chart, $width, $height, $color, return area_graph($flash_chart, $chart, $width, $height, $color,
$legend, array(), '', "", $unit, $homeurl, $legend, array(), '', "", $unit, $homeurl,
$water_mark, $config['fontpath'], $config['font_size'], $unit, $water_mark, $config['fontpath'], $config['font_size'], $unit,
1, array(), array(), 0, 0, $adapt_key, true, '', $menu); 1, array(), array(), 0, 0, $adapt_key, true, '', $menu);
} }
else {
return
line_graph($flash_chart, $chart, $width, $height, $color,
$legend, $long_index,
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $water_mark, $config['fontpath'],
$config['font_size'], $unit, $ttl, $homeurl, $backgroundColor);
}
}
/** /**
* Print a graph with event data of module * Print a graph with event data of module

View File

@ -175,15 +175,22 @@ function html_print_side_layer ($params) {
$table->cellpadding = 2; $table->cellpadding = 2;
$table->class = 'none'; $table->class = 'none';
$top = '<div id="side_top_text" style="width: 100%";">' . $params['top_text'] . '</div>'; $top = '<div id="side_top_text" style="width: 100%";">' .
$params['top_text'] . '</div>';
$button = '<div id="show_menu" style="vertical-align: middle; position: relative; width: ' . $params['icon_width'] . 'px; padding-right: 17px; text-align: right; height: ' . $params['icon_height'] . 'px;">'; $button = '<div id="show_menu" style="vertical-align: middle; position: relative; width: ' . $params['icon_width'] . 'px; padding-right: 17px; text-align: right; height: ' . $params['icon_height'] . 'px;">';
$button .= html_print_image($params['position'] == 'left' ? $params['icon_open'] : $params['icon_closed'], true, array('id' => 'graph_menu_arrow')); $button .= html_print_image(
$params['position'] == 'left' ?
$params['icon_open']
:
$params['icon_closed'],
true, array('id' => 'graph_menu_arrow'));
$button .= '</div>'; $button .= '</div>';
$body = '<div id="side_body_text" style="width: 100%;">' . $params['body_text'] . '</div>'; $body = '<div id="side_body_text" style="width: 100%;">' . $params['body_text'] . '</div>';
$bottom = '<div id="side_bottom_text" style="text-align: ' . $params['position'] . ';">' . $params['bottom_text'] . '</div>'; $bottom = '<div id="side_bottom_text" style="text-align: ' . $params['position'] . ';">' .
$params['bottom_text'] . '</div>';
switch ($params['position']) { switch ($params['position']) {
case 'left': case 'left':

View File

@ -731,7 +731,8 @@ function modules_get_agentmodule ($id_agentmodule) {
return db_get_row ('tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule); return db_get_row ('tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule);
break; break;
case "oracle": case "oracle":
$fields = db_get_all_rows_filter('USER_TAB_COLUMNS', 'TABLE_NAME = \'TAGENTE_MODULO\' AND COLUMN_NAME <> \'MAX_CRITICAL\' AND COLUMN_NAME <> \'MIN_CRITICAL\' AND COLUMN_NAME <> \'POST_PROCESS\' AND COLUMN_NAME <> \'MAX_WARNING\' AND COLUMN_NAME <> \'MIN_WARNING\'', 'COLUMN_NAME'); $fields = db_get_all_rows_filter('USER_TAB_COLUMNS',
'TABLE_NAME = \'TAGENTE_MODULO\' AND COLUMN_NAME <> \'MAX_CRITICAL\' AND COLUMN_NAME <> \'MIN_CRITICAL\' AND COLUMN_NAME <> \'POST_PROCESS\' AND COLUMN_NAME <> \'MAX_WARNING\' AND COLUMN_NAME <> \'MIN_WARNING\'', 'COLUMN_NAME');
foreach ($fields as $field) { foreach ($fields as $field) {
$fields_[] = $field['column_name']; $fields_[] = $field['column_name'];
} }
@ -1627,14 +1628,17 @@ function modules_get_agentmodule_data ($id_agent_module, $period,
case 21: case 21:
case 31: case 31:
if ( $config["render_proc"] ) { if ( $config["render_proc"] ) {
$sql = sprintf ("SELECT IF(datos >= 1, 'OK', 'FAIL') as data, utimestamp $sql = sprintf ("
SELECT IF(datos >= 1, 'OK', 'FAIL') as data, utimestamp
FROM tagente_datos FROM tagente_datos
WHERE id_agente_modulo = %d WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp %s", ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date, $order); $id_agent_module, $datelimit, $date, $order);
}else{ }
$sql = sprintf ("SELECT datos AS data, utimestamp else {
$sql = sprintf ("
SELECT datos AS data, utimestamp
FROM tagente_datos FROM tagente_datos
WHERE id_agente_modulo = %d WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d AND utimestamp > %d AND utimestamp <= %d
@ -1643,7 +1647,8 @@ function modules_get_agentmodule_data ($id_agent_module, $period,
} }
break; break;
default: default:
$sql = sprintf ("SELECT datos AS data, utimestamp $sql = sprintf ("
SELECT datos AS data, utimestamp
FROM tagente_datos FROM tagente_datos
WHERE id_agente_modulo = %d WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d AND utimestamp > %d AND utimestamp <= %d

View File

@ -502,7 +502,8 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a
if (isset ($filter[$extra_filter]) && $filter[$extra_filter] != '') { if (isset ($filter[$extra_filter]) && $filter[$extra_filter] != '') {
$filter[$extra_filter] .= ','; $filter[$extra_filter] .= ',';
} }
$filter[$extra_filter] = implode (',', array_keys ($values['sources'])); $filter[$extra_filter] = implode (',',
array_keys($values['sources']));
} }
else { else {
$values = array (); $values = array ();
@ -571,7 +572,11 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a
$values['data'][$interval_start][$source] = 0; $values['data'][$interval_start][$source] = 0;
} }
$data = netflow_get_stats ($interval_start, $interval_end, $filter, $aggregate, $max, $unit, $connection_name);
$data = netflow_get_stats($interval_start,
$interval_end, $filter, $aggregate, $max, $unit,
$connection_name);
foreach ($data as $line) { foreach ($data as $line) {
// Address resolution start // Address resolution start

View File

@ -409,19 +409,6 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
} }
} }
// Addded the relationship of parents of agents
foreach ($agents as $agent) {
if ($agent['id_parent'] != "0" &&
array_key_exists($agent['id_parent'], $node_ref)) {
$parents[$node_ref[$agent['id_agente']]] = $node_ref[$agent['id_parent']];
}
else {
$orphans[$node_ref[$agent['id_agente']]] = 1;
}
}
// Drop the modules without a partner if l2_network is true // Drop the modules without a partner if l2_network is true
// and the snmp interfaces token is false // and the snmp interfaces token is false
if ($l2_network) { if ($l2_network) {
@ -450,6 +437,19 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
} }
} }
} }
} else {
// Addded the relationship of parents of agents
foreach ($agents as $agent) {
if ($agent['id_parent'] != "0" &&
array_key_exists($agent['id_parent'], $node_ref)) {
$parents[$node_ref[$agent['id_agente']]] = $node_ref[$agent['id_parent']];
}
else {
$orphans[$node_ref[$agent['id_agente']]] = 1;
}
}
} }
// Create void statistics array // Create void statistics array

View File

@ -481,8 +481,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
'treport_content_sla_combined', 'treport_content_sla_combined',
'id_report_content', $content['id_rc']); 'id_report_content', $content['id_rc']);
if (empty($slas)) { if (empty($slas)) {
$return['failed'] = __('There are no SLAs defined'); $return['failed'] = __('There are no SLAs defined');
} }
@ -503,8 +501,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
$return['planned_downtimes'] = array(); $return['planned_downtimes'] = array();
if ($metaconsole_on) { if ($metaconsole_on) {
$id_agent_modules_by_server = array(); $id_agent_modules_by_server = array();
@ -622,9 +618,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
} }
} }
else { else {
$id_agent_modules = array(); $id_agent_modules = array();
foreach ($slas as $sla) { foreach ($slas as $sla) {
if (!empty($sla['id_agent_module'])) if (!empty($sla['id_agent_module']))
@ -632,13 +625,8 @@ function reporting_SLA($report, $content, $type = 'dinamic',
} }
$planned_downtimes = reporting_get_planned_downtimes(($report['datetime']-$content['period']), $report['datetime'], $id_agent_modules); $planned_downtimes = reporting_get_planned_downtimes(($report['datetime']-$content['period']), $report['datetime'], $id_agent_modules);
$malformed_planned_downtimes = planned_downtimes_get_malformed(); $malformed_planned_downtimes = planned_downtimes_get_malformed();
if (!empty($planned_downtimes)) if (!empty($planned_downtimes))
$planned_downtimes_empty = false; $planned_downtimes_empty = false;
if (!empty($malformed_planned_downtimes)) if (!empty($malformed_planned_downtimes))
@ -733,8 +721,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
$sla_showed = array(); $sla_showed = array();
$sla_showed_values = array(); $sla_showed_values = array();
foreach ($slas as $sla) { foreach ($slas as $sla) {
$server_name = $sla ['server_name']; $server_name = $sla ['server_name'];
//Metaconsole connection //Metaconsole connection
@ -755,8 +741,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
continue; continue;
} }
//Get the sla_value in % and store it on $sla_value //Get the sla_value in % and store it on $sla_value
$sla_value = reporting_get_agentmodule_sla( $sla_value = reporting_get_agentmodule_sla(
$sla['id_agent_module'], $sla['id_agent_module'],
@ -795,8 +779,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
} }
} }
$return['data'] = array(); $return['data'] = array();
$return['charts'] = null; $return['charts'] = null;
@ -873,15 +855,12 @@ function reporting_SLA($report, $content, $type = 'dinamic',
} }
// Slice graphs calculation // Slice graphs calculation
if ($show_graphs) { if ($show_graphs) {
$dataslice = array(); $dataslice = array();
$dataslice['agent'] = modules_get_agentmodule_agent_name ($sla['id_agent_module']); $dataslice['agent'] = modules_get_agentmodule_agent_name ($sla['id_agent_module']);
$dataslice['module'] = modules_get_agentmodule_name ($sla['id_agent_module']); $dataslice['module'] = modules_get_agentmodule_name ($sla['id_agent_module']);
$dataslice['chart'] = graph_sla_slicebar( $dataslice['chart'] = graph_sla_slicebar(
$sla['id_agent_module'], $sla['id_agent_module'],
$content['period'], $content['period'],
@ -901,8 +880,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
$return['charts'][] = $dataslice; $return['charts'][] = $dataslice;
} }
if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) { if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) {
//Restore db connection //Restore db connection
metaconsole_restore_db(); metaconsole_restore_db();
@ -912,7 +889,6 @@ function reporting_SLA($report, $content, $type = 'dinamic',
} }
return reporting_check_structure_content($return); return reporting_check_structure_content($return);
} }
@ -2392,8 +2368,6 @@ function reporting_group_configuration($report, $content) {
$group_name = groups_get_name($content['id_group'], true); $group_name = groups_get_name($content['id_group'], true);
$return['title'] = $content['name']; $return['title'] = $content['name'];
$return['subtitle'] = $group_name; $return['subtitle'] = $group_name;
$return["description"] = $content["description"]; $return["description"] = $content["description"];
@ -2419,14 +2393,10 @@ function reporting_group_configuration($report, $content) {
WHERE id_grupo=" . $content['id_group']; WHERE id_grupo=" . $content['id_group'];
} }
$agents_list = db_get_all_rows_sql($sql); $agents_list = db_get_all_rows_sql($sql);
if ($agents_list === false) if ($agents_list === false)
$agents_list = array(); $agents_list = array();
$return['data'] = array(); $return['data'] = array();
foreach ($agents_list as $agent) { foreach ($agents_list as $agent) {
$content_agent = $content; $content_agent = $content;
@ -2446,8 +2416,6 @@ function reporting_group_configuration($report, $content) {
$return['data'][] = $agent_report['data']; $return['data'][] = $agent_report['data'];
} }
if ($config['metaconsole']) { if ($config['metaconsole']) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
@ -2621,15 +2589,12 @@ function reporting_alert_report_group($report, $content) {
array('id' => $alert['id_alert_template'])); array('id' => $alert['id_alert_template']));
$actions = db_get_all_rows_sql('SELECT name $actions = db_get_all_rows_sql('SELECT name
FROM talert_actions FROM talert_actions
WHERE id IN (SELECT id_alert_action WHERE id IN (SELECT id_alert_action
FROM talert_template_module_actions FROM talert_template_module_actions
WHERE id_alert_template_module = ' . $alert['id_alert_template'] . ')'); WHERE id_alert_template_module = ' . $alert['id_alert_template'] . ')');
if (!empty($actions)) { if (!empty($actions)) {
$row = db_get_row_sql('SELECT id_alert_action $row = db_get_row_sql('SELECT id_alert_action
FROM talert_templates FROM talert_templates
@ -2654,8 +2619,6 @@ function reporting_alert_report_group($report, $content) {
} }
} }
$data_row['action'] = array(); $data_row['action'] = array();
foreach ($actions as $action) { foreach ($actions as $action) {
$data_row['action'][] = $action['name']; $data_row['action'][] = $action['name'];
@ -3346,8 +3309,6 @@ function reporting_agent_configuration($report, $content) {
$return["description"] = $content["description"]; $return["description"] = $content["description"];
$return["date"] = reporting_get_date_text($report, $content); $return["date"] = reporting_get_date_text($report, $content);
if ($config['metaconsole']) { if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]); $id_meta = metaconsole_get_id_server($content["server_name"]);
@ -3377,8 +3338,6 @@ function reporting_agent_configuration($report, $content) {
$modules = agents_get_modules ($content['id_agent']); $modules = agents_get_modules ($content['id_agent']);
$agent_configuration['modules'] = array(); $agent_configuration['modules'] = array();
//Agent's modules //Agent's modules
if (!empty($modules)) { if (!empty($modules)) {
@ -3812,8 +3771,6 @@ function reporting_availability($report, $content) {
$text = ""; $text = "";
// HACK it is saved in show_graph field. // HACK it is saved in show_graph field.
// Show interfaces instead the modules // Show interfaces instead the modules
if ($content['show_graph']) { if ($content['show_graph']) {
@ -3839,7 +3796,6 @@ function reporting_availability($report, $content) {
$report["datetime"]); $report["datetime"]);
if (empty($count_checks)) { if (empty($count_checks)) {
$row['checks'] = __('Unknown'); $row['checks'] = __('Unknown');
$row['failed'] = __('Unknown'); $row['failed'] = __('Unknown');
@ -4797,7 +4753,6 @@ function reporting_get_module_detailed_event ($id_modules, $period = 0,
} }
$events = array (); $events = array ();
foreach ($id_modules as $id_module) { foreach ($id_modules as $id_module) {
@ -6635,8 +6590,6 @@ function reporting_get_agentmodule_sla ($id_agent_module, $period = 0,
$timeTo); $timeTo);
} }
else { else {
// Extract the data each day // Extract the data each day
$sla = 0; $sla = 0;
@ -7509,8 +7462,6 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_
AND utimestamp > %d AND utimestamp <= %d', AND utimestamp > %d AND utimestamp <= %d',
$id_agent_module, $datelimit, $date); $id_agent_module, $datelimit, $date);
//Add the working times (mon - tue - wed ...) and from time to time //Add the working times (mon - tue - wed ...) and from time to time
$days = array(); $days = array();
//Translate to mysql week days //Translate to mysql week days
@ -7562,22 +7513,15 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_
$sql .= ' ORDER BY utimestamp ASC'; $sql .= ' ORDER BY utimestamp ASC';
$interval_data = db_get_all_rows_sql ($sql, $search_in_history_db); $interval_data = db_get_all_rows_sql ($sql, $search_in_history_db);
if ($interval_data === false) { if ($interval_data === false) {
$interval_data = array (); $interval_data = array ();
} }
// Calculate planned downtime dates // Calculate planned downtime dates
$downtime_dates = reporting_get_planned_downtimes_intervals($id_agent_module, $datelimit, $date); $downtime_dates = reporting_get_planned_downtimes_intervals($id_agent_module, $datelimit, $date);
// Get previous data // Get previous data
$previous_data = modules_get_previous_data ($id_agent_module, $datelimit); $previous_data = modules_get_previous_data ($id_agent_module, $datelimit);
@ -7601,8 +7545,6 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_
array_push ($interval_data, $next_data); array_push ($interval_data, $next_data);
} }
if (count ($interval_data) < 2) { if (count ($interval_data) < 2) {
return false; return false;
} }
@ -7706,8 +7648,6 @@ function reporting_get_agentmodule_sla_array ($id_agent_module, $period = 0, $mi
AND utimestamp > %d AND utimestamp <= %d', AND utimestamp > %d AND utimestamp <= %d',
$id_agent_module, $datelimit, $date); $id_agent_module, $datelimit, $date);
//Add the working times (mon - tue - wed ...) and from time to time //Add the working times (mon - tue - wed ...) and from time to time
$days = array(); $days = array();
//Translate to mysql week days //Translate to mysql week days
@ -7762,8 +7702,6 @@ function reporting_get_agentmodule_sla_array ($id_agent_module, $period = 0, $mi
$sql .= ' ORDER BY utimestamp ASC'; $sql .= ' ORDER BY utimestamp ASC';
$interval_data = db_get_all_rows_sql ($sql, $search_in_history_db); $interval_data = db_get_all_rows_sql ($sql, $search_in_history_db);
if ($interval_data === false) { if ($interval_data === false) {
$interval_data = array (); $interval_data = array ();
} }
@ -8150,4 +8088,54 @@ function reporting_get_stats_servers($tiny = true) {
return $output; return $output;
} }
/**
* Get all the template graphs a user can see.
*
* @param $id_user User id to check.
* @param $only_names Wheter to return only graphs names in an associative array
* or all the values.
* @param $returnAllGroup Wheter to return graphs of group All or not.
* @param $privileges Privileges to check in user group
*
* @return template graphs of a an user. Empty array if none.
*/
function reporting_template_graphs_get_user ($id_user = 0, $only_names = false, $returnAllGroup = true, $privileges = 'RR') {
global $config;
if (!$id_user) {
$id_user = $config['id_user'];
}
$groups = users_get_groups ($id_user, $privileges, $returnAllGroup);
$all_templates = db_get_all_rows_in_table ('tgraph_template', 'name');
if ($all_templates === false)
return array ();
$templates = array ();
foreach ($all_templates as $template) {
if (!in_array($template['id_group'], array_keys($groups)))
continue;
if ($template["id_user"] != $id_user && $template['private'])
continue;
if ($template["id_group"] > 0)
if (!isset($groups[$template["id_group"]])) {
continue;
}
if ($only_names) {
$templates[$template['id_graph_template']] = $template['name'];
}
else {
$templates[$template['id_graph_template']] = $template;
$templatesCount = db_get_value_sql("SELECT COUNT(id_gs_template) FROM tgraph_source_template WHERE id_template = " . $template['id_graph_template']);
$templates[$template['id_graph_template']]['graphs_template_count'] = $templatesCount;
}
}
return $templates;
}
?> ?>

View File

@ -2526,55 +2526,7 @@ function reporting_header_content($mini, $content, $report, &$table,
/**
* Get all the template graphs a user can see.
*
* @param $id_user User id to check.
* @param $only_names Wheter to return only graphs names in an associative array
* or all the values.
* @param $returnAllGroup Wheter to return graphs of group All or not.
* @param $privileges Privileges to check in user group
*
* @return template graphs of a an user. Empty array if none.
*/
function reporting_template_graphs_get_user ($id_user = 0, $only_names = false, $returnAllGroup = true, $privileges = 'RR') {
global $config;
if (!$id_user) {
$id_user = $config['id_user'];
}
$groups = users_get_groups ($id_user, $privileges, $returnAllGroup);
$all_templates = db_get_all_rows_in_table ('tgraph_template', 'name');
if ($all_templates === false)
return array ();
$templates = array ();
foreach ($all_templates as $template) {
if (!in_array($template['id_group'], array_keys($groups)))
continue;
if ($template["id_user"] != $id_user && $template['private'])
continue;
if ($template["id_group"] > 0)
if (!isset($groups[$template["id_group"]])){
continue;
}
if ($only_names) {
$templates[$template['id_graph_template']] = $template['name'];
}
else {
$templates[$template['id_graph_template']] = $template;
$templatesCount = db_get_value_sql("SELECT COUNT(id_gs_template) FROM tgraph_source_template WHERE id_template = " . $template['id_graph_template']);
$templates[$template['id_graph_template']]['graphs_template_count'] = $templatesCount;
}
}
return $templates;
}
@ -2678,7 +2630,8 @@ function reporting_get_total_servers ($num_servers) {
__('Node overview') . __('Node overview') .
'</legend>' . '</legend>' .
html_print_table($table_node, true) . '</fieldset>'; html_print_table($table_node, true) . '</fieldset>';
}else{ }
else {
$table_node->style = array(); $table_node->style = array();
$table_node->class = "tactical_view"; $table_node->class = "tactical_view";
$node_overview = '<fieldset class="tactical_set"> $node_overview = '<fieldset class="tactical_set">

View File

@ -787,7 +787,8 @@ function tags_get_acl_tags_event_condition($acltags, $meta = false, $force_group
$tags_condition = ''; $tags_condition = '';
if (empty($group_tags)) { if (empty($group_tags)) {
$tags_condition = "id_grupo = ".$group_id; $tags_condition = "id_grupo = ".$group_id;
} else { }
else {
if (!is_array($group_tags)) { if (!is_array($group_tags)) {
$group_tags = explode(',', $group_tags); $group_tags = explode(',', $group_tags);
} }
@ -1187,7 +1188,8 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p =
//return false; //return false;
$return = false; $return = false;
} }
} else { }
else {
foreach($acls as $acl_tags) { foreach($acls as $acl_tags) {
foreach($tags as $tag) { foreach($tags as $tag) {
$tag = tags_get_id($tag); $tag = tags_get_id($tag);
@ -1200,7 +1202,8 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p =
} }
} else { }
else {
if($id_group > 0) { if($id_group > 0) {
if(isset($acls[$id_group])) { if(isset($acls[$id_group])) {
foreach($tags as $tag) { foreach($tags as $tag) {
@ -1264,7 +1267,10 @@ function tags_checks_event_acl($id_user, $id_group, $access, $tags = array(), $c
//check user without tags //check user without tags
$sql = "SELECT id_usuario FROM tusuario_perfil $sql = "SELECT id_usuario FROM tusuario_perfil
WHERE id_usuario = '".$config["id_user"]."' AND tags = '' WHERE id_usuario = '".$config["id_user"]."' AND tags = ''
AND id_perfil IN (SELECT id_perfil FROM tperfil WHERE ".get_acl_column($access)."=1) AND id_perfil IN (
SELECT id_perfil
FROM tperfil
WHERE ".get_acl_column($access)." = 1)
AND id_grupo = ".$id_group; AND id_grupo = ".$id_group;
$user_has_perm_without_tags = db_get_all_rows_sql ($sql); $user_has_perm_without_tags = db_get_all_rows_sql ($sql);

View File

@ -1380,19 +1380,10 @@ function ui_process_page_head ($string, $bitfield) {
continue; continue;
array_push ($loaded, $name); array_push ($loaded, $name);
if (!empty ($config["compact_header"])) {
$output .= '<style type="text/css">';
$style = file_get_contents ($config["homedir"] . "/" . $filename);
//Replace paths
$style = str_replace (array ("@import url(", "../../images"), array ("@import url(include/styles/", "images"), $style);
//Remove comments
$output .= preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $style);
$output .= '</style>';
}
else {
$url_css = ui_get_full_url($filename); $url_css = ui_get_full_url($filename);
$output .= '<link rel="stylesheet" href="' . $url_css . '" type="text/css" />'."\n\t"; $output .= '<link rel="stylesheet" href="' . $url_css . '" type="text/css" />'."\n\t";
}
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
//End load CSS //End load CSS
@ -1430,16 +1421,10 @@ function ui_process_page_head ($string, $bitfield) {
continue; continue;
array_push ($loaded, $name); array_push ($loaded, $name);
if (!empty ($config["compact_header"])) {
$output .= '<script type="text/javascript">/* <![CDATA[ */'."\n";
$output .= file_get_contents ($config["homedir"]."/".$filename);
$output .= "\n".'/* ]]> */</script>';
}
else {
$url_js = ui_get_full_url($filename); $url_js = ui_get_full_url($filename);
$output .= '<script type="text/javascript" src="' . $url_js . '"></script>'."\n\t"; $output .= '<script type="text/javascript" src="' . $url_js . '"></script>'."\n\t";
} }
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
//End load JS //End load JS
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -1488,16 +1473,10 @@ function ui_process_page_head ($string, $bitfield) {
continue; continue;
array_push ($loaded, $name); array_push ($loaded, $name);
if (!empty ($config["compact_header"])) {
$output .= '<script type="text/javascript">/* <![CDATA[ */'."\n";
$output .= file_get_contents ($config["homedir"]."/".$filename);
$output .= "\n".'/* ]]> */</script>';
}
else {
$url_js = ui_get_full_url($filename); $url_js = ui_get_full_url($filename);
$output .= '<script type="text/javascript" src="' . $url_js . '"></script>'."\n\t"; $output .= '<script type="text/javascript" src="' . $url_js . '"></script>'."\n\t";
} }
}
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
//End load JQuery //End load JQuery
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -1518,10 +1497,6 @@ function ui_process_page_head ($string, $bitfield) {
$output .= $string; $output .= $string;
if (!empty ($config["compact_header"])) {
$output = str_replace(array("\r\n", "\r", "\n", "\t", ' ',
' ', ' '), '', $output);
}
return $output; return $output;
} }
@ -1545,14 +1520,9 @@ function ui_process_page_body ($string, $bitfield) {
// Show custom background // Show custom background
$output = '<body'.($config["pure"] ? ' class="pure"' : '').'>'; $output = '<body'.($config["pure"] ? ' class="pure"' : '').'>';
if (!empty ($config["compact_header"])) {
require_once ($config["homedir"]."/include/htmlawed.php");
$htmLawedconfig = array ("valid_xhtml" => 1, "tidy" => -1);
$output .= htmLawed ($string, $htmLawedconfig);
}
else {
$output .= $string; $output .= $string;
}
$output .= '</body>'; $output .= '</body>';

View File

@ -2136,7 +2136,8 @@ function visual_map_get_layoutdata_x ($id_layoutdata) {
* @return int The Y axis coordinate value. * @return int The Y axis coordinate value.
*/ */
function visual_map_get_layoutdata_y ($id_layoutdata) { function visual_map_get_layoutdata_y ($id_layoutdata) {
return (float) db_get_value ('pos_y', 'tlayout_data', 'id', (int) $id_layoutdata); return (float) db_get_value ('pos_y', 'tlayout_data', 'id',
(int)$id_layoutdata);
} }
function visual_map_type_in_js($type) { function visual_map_type_in_js($type) {

View File

@ -216,13 +216,13 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
setup_watermark($water_mark, $water_mark_file, $water_mark_url); setup_watermark($water_mark, $water_mark_file, $water_mark_url);
// ATTENTION: The min size is 110x150 // ATTENTION: The min size is in constants.php
// It's not the same minsize for all graphs, but we are choosed a prudent minsize for all // It's not the same minsize for all graphs, but we are choosed a prudent minsize for all
if ($height <= 110) { if ($height <= CHART_DEFAULT_HEIGHT) {
$height = 110; $height = CHART_DEFAULT_HEIGHT;
} }
if ($width < 150) { if ($width < CHART_DEFAULT_WIDTH) {
$width = 150; $width = CHART_DEFAULT_WIDTH;
} }
if (empty($chart_data)) { if (empty($chart_data)) {

View File

@ -5,194 +5,407 @@
?> ?>
<h1>Pandora FMS Alert Configuration Quick Guide </h1> <h1>Pandora FMS Alert Configuration Quick Guide </h1>
<br> <br>
<b>Introduction to the Current Alert System</b><br>
<b>Introduction to the Current Alert System </b><br><br> <br>
People usually complains about the complexity of defining alerts in
People usually complains about the complexity of defining alerts in Pandora FMS. Before, until version 2.0, alerts were more simple to configure. For each alert, it was defined the condition and what it did when the action was not done, for each case. It was a more "intuitive" thing ( but it had also fields such as the "threshold" alert that caused lot of headaches to more than one people!). It was very simple, but, was it worth it ? <br><br> Pandora FMS. Before, until version 2.0, alerts were more simple to
configure. For each alert, it was defined the condition and what it did
One of our best users ( because he had lots of agents installed and managed very well Pandora FMS too), mention us that for creating an alert in 2000 modules it was very difficult, specially when you have to modify something in all of them. Due to this and other problems, we had to modify the alert system to it would be a modular one and to it could separate the definition of the alert firing condition (Alter template) from the action to execute when it is fired (Alert action) and from the command that is executed in the action (Alert command). The combination of an alert template with a module triggers the alert.<br><br> when the action was not done, for each case. It was a more "intuitive"
thing ( but it had also fields such as the "threshold" alert that caused
This way, if I have 1000 systems with a module called "Host alive" and all of them have associated an alert template called "Host down", then an alert called " Call to the operator" will be executed by default, and if I want to change the minimum number of alerts that should be fired before notifying it to the operator, I will only need to make a change in the definition of the template, not doing it one by one, in the 1000 alerts to modify this condition. <br><br> lot of headaches to more than one people!). It was very simple, but, was
it worth it ?<br>
Several users only manage a few tens of machines, but there are users with hundreds, even thousands of systems monitored with Pandora FMS, and we have to try making possible that with Pandora FMS it would be possible to manage all kind of environments.<br><br><br><br> <br>
<b>Alert structure </b><br><br> One of our best users ( because he had lots of agents installed and
managed very well Pandora FMS too), mention us that for creating an
<?php html_print_image ("images/help/alert01.png", false, array('width' => '550px')); ?> alert in 2000 modules it was very difficult, specially when you have to
modify something in all of them. Due to this and other problems, we had
to modify the alert system to it would be a modular one and to it could
separate the definition of the alert firing condition (Alter template)
from the action to execute when it is fired (Alert action) and from the
command that is executed in the action (Alert command). The combination
of an alert template with a module triggers the alert.<br>
<br>
This way, if I have 1000 systems with a module called "Host alive" and
all of them have associated an alert template called "Host down", then
an alert called " Call to the operator" will be executed by default, and
if I want to change the minimum number of alerts that should be fired
before notifying it to the operator, I will only need to make a change
in the definition of the template, not doing it one by one, in the 1000
alerts to modify this condition.<br>
<br>
Several users only manage a few tens of machines, but there are users
with hundreds, even thousands of systems monitored with Pandora FMS, and
we have to try making possible that with Pandora FMS it would be
possible to manage all kind of environments.<br>
<br>
<br>
<br>
<b>Alert structure </b><br>
<br>
<?php
html_print_image("images/help/alert01.png", false,
array('width' => '550px'));
?>
<br>
An alert is compound by:<br>
<br> <br>
An alert is compound by:<br><br>
<i>Commands</i><br> <i>Commands</i><br>
<i>Actions</i><br> <i>Actions</i><br>
<i>Templates </i> <br><br> <i>Templates </i><br>
A command defines the operation to perform when the alert is fired. Some examples of command coudl be: write in a log, send an email or SMS, execute a script or a program, etc. <br><br>
An action links a command with a template and allow you to customize the command execution using three generic parameters: Field 1, Field 2 and Field 3. These parameters allow you to customize the command execution because they are passed as input parameters in command execution.<br><br>
In the template you defined the alert generic parameters which are: firing conditions, firing actions and alert recovery. <br><br>
<i>Firing conditions:</i> the conditions when the alert will be fired, for example: when the data is above a threshold, when the status is critical, etc. <br>
<i>Firing actions:</i> configuration for the action that will be performed when the alert is fired. <br>
<i>Alert recovery</i> configuration for actions performed when the system is recovered after the alert was fired. <br><br>
<b>Alert system information flow </b><br><br>
When you define the actions and the templates you have some generic fields called: Field1, Field2 and Field3. They are the parameters passed as input parameters in command execution. The values of this parameters are propagated from template to action and then to the command. The value propagation from template to action will only be peformed if the field defined in the action hasn't got any value, otherwise the value is used. <br><br>
<?php html_print_image ("images/help/alert02.png", false, array('width' => '550px')); ?>
<br> <br>
This is an example of how template values are ovewritten by the action values. <br><br> A command defines the operation to perform when the alert is fired. Some
examples of command coudl be: write in a log, send an email or SMS,
<?php html_print_image ("images/help/alert03.png", false, array('width' => '550px')); ?> execute a script or a program, etc.<br>
<br>
An action links a command with a template and allow you to customize the
command execution using three generic parameters: Field 1, Field 2 and
Field 3. These parameters allow you to customize the command execution
because they are passed as input parameters in command execution.<br>
<br>
In the template you defined the alert generic parameters which are:
firing conditions, firing actions and alert recovery.<br>
<br>
<i>Firing conditions:</i> the conditions when the alert will be fired,
for example: when the data is above a threshold, when the status is
critical, etc.<br>
<i>Firing actions:</i> configuration for the action that will be
performed when the alert is fired.<br>
<i>Alert recovery</i> configuration for actions performed when the
system is recovered after the alert was fired.<br>
<br>
<b>Alert system information flow</b><br>
<br>
When you define the actions and the templates you have some generic
fields called: Field1, Field2 and Field3. They are the parameters passed
as input parameters in command execution. The values of this parameters
are propagated from template to action and then to the command. The
value propagation from template to action will only be peformed if the
field defined in the action hasn't got any value, otherwise the value is
used.<br>
<br>
<?php
html_print_image("images/help/alert02.png", false,
array('width' => '550px'));
?>
<br>
This is an example of how template values are ovewritten by the action
values.<br>
<br>
<?php
html_print_image("images/help/alert03.png", false,
array('width' => '550px'));
?>
<br>
For example we can create a template that fires an alert and sends and
email with the following fields:<br>
<br> <br>
For example we can create a template that fires an alert and sends and email with the following fields:<br><br>
<b>Template:</b><br> <b>Template:</b><br>
Field1: <i>myemail@domain.com</i><br> Field1: <i>myemail@domain.com</i><br>
Field2: <i>[Alert] The alert was fired</i><br> Field2: <i>[Alert] The alert was fired</i><br>
Field3: <i>The alert was fired!!! SOS!!! </i><br><br> Field3: <i>The alert was fired!!! SOS!!!</i><br>
<br>
<b>Action:</b><br> <b>Action:</b><br>
Field1: <i>myboss@domain.com</i><br> Field1: <i>myboss@domain.com</i><br>
Field2:<br> Field2:<br>
Field3: <br><br> Field3:<br>
<br>
The value that will be passed to the command are: <br><br> The value that will be passed to the command are:<br>
<br>
<b>Command:</b><br> <b>Command:</b><br>
Field1: myboss@domain.com<br> Field1: myboss@domain.com<br>
Field2: [Alert] The alert was fired<br> Field2: [Alert] The alert was fired<br>
Field3: The alert was fired!!! SOS!!! <br><br> Field3: The alert was fired!!! SOS!!!<br>
<b>Defining one Alert </b><br><br>
Now, supposing we are in the previous case, we have one need: to monitor one module that has numerical values. In our case, it's a module that evaluates the system CPU, in other case, it could be a temperature sensor that puts the value in degrees Celsius. Let's see first that our module receives the data correctly: <br><br>
<?php html_print_image ("images/help/alert04.png", false, array('width' => '550px')); ?>
<br> <br>
In this screenshot, we can see that we have a module called sys_cpu with a current value of 7. In our case, we want that it fires an alert when it would be higher than 20. For it, we're going to configure the module to it goes on CRITICAl status when it gets higher than 20. For it, we should do click in the adjustable wrench to configure the monitor performance:<br><br> <b>Defining one Alert</b><br>
<?php html_print_image ("images/help/alert05.png", false, array('width' => '550px')); ?>
<br> <br>
For it, we modify the value selected in red in the following screenshot: <br><br> Now, supposing we are in the previous case, we have one need: to monitor
<br><br> one module that has numerical values. In our case, it's a module that
evaluates the system CPU, in other case, it could be a temperature
<?php html_print_image ("images/help/alert06.png", false, array('width' => '550px')); ?> sensor that puts the value in degrees Celsius. Let's see first that our
module receives the data correctly:<br>
<br> <br>
Agree and record the change. Now, when the value of the CPU module would be 20 or higher, it will change its status to CRITICAL and it will be seen in red color, as we can see here. <br><br> <?php
html_print_image("images/help/alert04.png", false,
array('width' => '550px'));
<?php html_print_image ("images/help/alert07.png", false, array('width' => '550px')); ?> ?>
<br> <br>
We have already done that the system knows how to recognize when something is right (OK, green color) and when is wrong (CRITICAL, red color). Now, what we should do is that it send us an email when the module changes to this status. For it, we will use the Pandora FMS alert system.<br><br> In this screenshot, we can see that we have a module called sys_cpu with
a current value of 7. In our case, we want that it fires an alert when
To do this, the first thing we should do is to make sure that there is one command that does what we need (to send an email). This example is easy because it's a predefined command in Pandora FMS to send mails. <br><br> it would be higher than 20. For it, we're going to configure the module
<b>Configuring the Alert</b><br><br> to it goes on CRITICAl status when it gets higher than 20. For it, we
should do click in the adjustable wrench to configure the monitor
Now, we have to create an action called "Send an email to the operator". Let's do it: go to the menu -> Alerts -> Actions and click to create a new action:<br><br> performance:<br>
<?php html_print_image ("images/help/alert08.png", false, array('width' => '550px')); ?>
<br> <br>
This action uses the command "Send email" and it's really simple, so I only need to fill in one field (Field 1) and leave the other two empties. This is one of the most confused parts of the Pandora FMS alert system: What are the fields:field1, field2 and field3?.<br><br> <?php
html_print_image("images/help/alert05.png", false,
These fields are the ones that are used to "pass" the information of the alert template to the command, and also from it to the command, so both the Template and the Command can give different information to the command. In this case, the command only fix the field 1, and we leave the field2 and the field 3 to the template, as we see next. <br><br> array('width' => '550px'));
?>
The field 1 is the one we use to define the operator email, in this case, a false mail to "sancho.lerena@notexist.com". <br><br>
<b>Configuring the Template (Alert template)</b><br><br>
Now, we have to create an alert template, as generic as possible, in order to could use it later. That would be "This is wrong, because I have a module in Critical status" and that by default, send an email to the operator. Let's go to the administration menu-> Alerts-> Templates and click on the button to create a new alert template: <br><br>
<?php html_print_image ("images/help/alert09.png", false, array('width' => '550px')); ?>
<br> <br>
The element that defines the condition is the field "Condition". In this case, it is selected to "Critical status" so this template, when it would be associated to a module, will be fired when the associated module would be in critical status. We have configured the "cpu_sys" module before in order it becomes to critical status when it would be 20 or more. <br><br> For it, we modify the value selected in red in the following
screenshot:<br>
The priority defined here as "Critical" is the priority of the alert, that has nothing to do with the "Critical" status of the module. The criticity of alerts is to could visualize them after, in other views, such as the event view, with different criticities.<br><br> <br>
<br>
Go to step 2, clicking on the "next" button:<br><br> <br>
<?php
<?php html_print_image ("images/help/alert10.png", false, array('width' => '550px')); ?> html_print_image("images/help/alert06.png", false,
array('width' => '550px'));
?>
<br>
Agree and record the change. Now, when the value of the CPU module would
be 20 or higher, it will change its status to CRITICAL and it will be
seen in red color, as we can see here.<br>
<br>
<?php
html_print_image("images/help/alert07.png", false,
array('width' => '550px'));
?>
<br>
We have already done that the system knows how to recognize when
something is right (OK, green color) and when is wrong (CRITICAL, red
color). Now, what we should do is that it send us an email when the
module changes to this status. For it, we will use the Pandora FMS alert
system.<br>
<br>
To do this, the first thing we should do is to make sure that there is
one command that does what we need (to send an email). This example is
easy because it's a predefined command in Pandora FMS to send mails.<br>
<br>
<b>Configuring the Alert</b><br>
<br>
Now, we have to create an action called "Send an email to the operator".
Let's do it: go to the menu -> Alerts -> Actions and click to create a
new action:<br>
<br>
<?php
html_print_image("images/help/alert08.png", false,
array('width' => '550px'));
?>
<br>
This action uses the command "Send email" and it's really simple, so I
only need to fill in one field (Field 1) and leave the other two
empties. This is one of the most confused parts of the Pandora FMS alert
system: What are the fields:field1, field2 and field3?.<br>
<br>
These fields are the ones that are used to "pass" the information of the
alert template to the command, and also from it to the command, so both
the Template and the Command can give different information to the
command. In this case, the command only fix the field 1, and we leave
the field2 and the field 3 to the template, as we see next.<br>
<br>
The field 1 is the one we use to define the operator email, in this
case, a false mail to "sancho.lerena@notexist.com".<br>
<br>
<b>Configuring the Template (Alert template)</b><br>
<br>
Now, we have to create an alert template, as generic as possible, in
order to could use it later. That would be "This is wrong, because I
have a module in Critical status" and that by default, send an email to
the operator. Let's go to the administration menu-> Alerts-> Templates
and click on the button to create a new alert template:<br>
<br>
<?php
html_print_image("images/help/alert09.png", false,
array('width' => '550px'));
?>
<br>
The element that defines the condition is the field "Condition". In this
case, it is selected to "Critical status" so this template, when it
would be associated to a module, will be fired when the associated
module would be in critical status. We have configured the "cpu_sys"
module before in order it becomes to critical status when it would be 20
or more.<br>
<br>
The priority defined here as "Critical" is the priority of the alert,
that has nothing to do with the "Critical" status of the module. The
criticity of alerts is to could visualize them after, in other views,
such as the event view, with different criticities.<br>
<br>
Go to step 2, clicking on the "next" button:<br>
<br>
<?php
html_print_image("images/help/alert10.png", false,
array('width' => '550px'));
?>
<br>
The step 2 defines all the "fines" configuration "values" of the alert
template in the trigger condition. Some of them, the first ones, are
quite simple, and they limit the moment of the action of this alert to
some specific days between different hours.<br>
<br>
The most critical parameters here are these:<br>
<br>
<i>Time threshold:</i> It's one day by default. If one module is always
down, during, for example one day, and we have here a value of 5
minutes, then, it means that it would be sending us alerts every 5
minutes. If we adjust it for one day (24 hours), it will only send us
the alert once, when it downs. If the module recovers and get down
again, it will send us an alert again, but if it continues down from the
second down, then it won't send us alerts any more until 24 hours.<br>
<br>
<i>Min. Number of alerts:</i> Minimum number of times that the condition
should be ( in this case, that the module would be in CRITICAL status)
before Pandora FMS executes the actions associated to the alert
template. Is a way to avoid that false positives "overflow" me with
alerts, or that an erratic performance (now well, now wrong) does that
many alerts would be fired. If we put here 1, it means that until it
happens at least once, I won't consider it. If we put 0, the first time
the module would be wrong, then it will fired the alert.<br>
<br>
<i>Max. Number of alerts:</i> 1 means that it will execute the action
only once. If we have here 10, it will execute the action 10 times. It's
a way to limit the number of times an alert could be executed.<br>
<br>
Now we have fields "field1, field2 and field3" again. Now we can see
that the field1 is blank, that is exactly the one that we've defined
when we configured the action. The field2 and the field3 are used in the
action of sending an email to define the subject and the message text,
whereas the field1 is used to define the receivers (separated by
commas). So the template, using some macros, is defining the subject and
the message alert as in our case we'll receive a message as the one that
follows (supposing that the agent where it's the module is called
"Farscape"):<br>
<br> <br>
The step 2 defines all the "fines" configuration "values" of the alert template in the trigger condition. Some of them, the first ones, are quite simple, and they limit the moment of the action of this alert to some specific days between different hours. <br><br>
The most critical parameters here are these:
<br><br>
<i>Time threshold:</i> It's one day by default. If one module is always down, during, for example one day, and we have here a value of 5 minutes, then, it means that it would be sending us alerts every 5 minutes. If we adjust it for one day (24 hours), it will only send us the alert once, when it downs. If the module recovers and get down again, it will send us an alert again, but if it continues down from the second down, then it won't send us alerts any more until 24 hours. <br><br>
<i>Min. Number of alerts:</i> Minimum number of times that the condition should be ( in this case, that the module would be in CRITICAL status) before Pandora FMS executes the actions associated to the alert template. Is a way to avoid that false positives "overflow" me with alerts, or that an erratic performance (now well, now wrong) does that many alerts would be fired. If we put here 1, it means that until it happens at least once, I won't consider it. If we put 0, the first time the module would be wrong, then it will fired the alert. <br><br>
<i>Max. Number of alerts:</i> 1 means that it will execute the action only once. If we have here 10, it will execute the action 10 times. It's a way to limit the number of times an alert could be executed. <br><br>
Now we have fields "field1, field2 and field3" again. Now we can see that the field1 is blank, that is exactly the one that we've defined when we configured the action. The field2 and the field3 are used in the action of sending an email to define the subject and the message text, whereas the field1 is used to define the receivers (separated by commas). So the template, using some macros, is defining the subject and the message alert as in our case we'll receive a message as the one that follows (supposing that the agent where it's the module is called "Farscape"): <br><br>
<i>To: sancho.lerena@notexist.ocm<br> <i>To: sancho.lerena@notexist.ocm<br>
Subject: [PANDORA] Farscape cpu_sys is in CRITICAL status with value 20<br> Subject: [PANDORA] Farscape cpu_sys is in CRITICAL status with value
Texto email:<br><br> 20<br>
Texto email:<br>
<br>
This is an automated alert generated by Pandora FMS<br> This is an automated alert generated by Pandora FMS<br>
Please contact your Pandora FMS for more information. *DO NOT* reply this email.<br></i><br> Please contact your Pandora FMS for more information. *DO NOT* reply
this email.<br>
Given that the default action is the one we have defined previously, all the alerts that use this template will use this predefined action by default, unless it would be modified. <br><br> </i><br>
Given that the default action is the one we have defined previously, all
In case 3, we'll see that it's possible to configure the alert system in order to it notify when the alert has stopped. <br><br> the alerts that use this template will use this predefined action by
default, unless it would be modified.<br>
<?php html_print_image ("images/help/alert11.png", false, array('width' => '550px')); ?>
<br> <br>
It's almost the same, but in field1 it's not defined, because it'll be used the same that comes defined in the action that has been executed previously (when firing the alert). In this case it'll send only an email when a subject that says that the condition in the cpu-syst module has been recovered) <br><br> In case 3, we'll see that it's possible to configure the alert system in
order to it notify when the alert has stopped.<br>
The alert recovery is optional. It's important to say that if in the alert recovery data are fields (field2 and field3) that are defined, these "ignore and overwrite the action fields, that's to say, that they have preference over them. The only valid field that can't be modified is the field1.<br><br>
<b>Associating the Alert to the Command </b><br><br>
Now, we have all that we need, we only have to associate the alert template to the module. For it, go to the alert tab in the agent where the module is:<br><br>
<?php html_print_image ("images/help/alert12.png", false, array('width' => '550px')); ?>
<br> <br>
It's easy. In this screenshot we can see an alert already configured for a module named "Last_Backup_Unixtime" to the same template that we have defined before as "Module critical". Now, in the controls that are below, we are going to create an association between the module "cpu-sys" and the alert template "Module critical". By default it'll show the action that we've defined in this template "Send email to Sancho Lerena". <br><br> <?php
<b>Scaling Alerts</b><br><br> html_print_image("images/help/alert11.png", false,
array('width' => '550px'));
The values that are in the "Number of alerts match from" are to define the alert scaling. This allows to "redefine" a little more the alert performance, so if we have defined a maximum of 5 times the times that an alert could be fired, and we only want that it send us an email, then we should put here one 0 and one 1, to order it that only send us an email from time 0 to 1 (that is, once). <br><br> ?>
Now we see that we can add more actions to the same alert, defining with this fields "Number of alerts match from" the alert performance depending on how many times it would be fired. <br><br>
For example: we want that it sends an email to XXXXX the first time it happens, and if the monitor continues being down, it sends an email to ZZZZ. For it, after associating the alert, in the assigned alerts table, I can add more actions to a previously defined alert, as we can see in the following screenshot: <br><br>
<?php html_print_image ("images/help/alert13.png", false, array('width' => '550px')); ?>
<?php html_print_image ("images/help/alert14.png", false, array('width' => '550px')); ?>
<br> <br>
It's almost the same, but in field1 it's not defined, because it'll be
<b>Standby alerts</b><br><br> used the same that comes defined in the action that has been executed
previously (when firing the alert). In this case it'll send only an
Alerts can be enable, disable or in standby mode. The difference between the disabled and standby alerts is that the disable alerts just do not work and therefore will not showed in the alerts view. Standby alerts will be showed in the alerts view and work, but only at display level. It will show if are fired or not but will do not engage in configured actions and will do not generate events. <br><br> email when a subject that says that the condition in the cpu-syst module
has been recovered).<br>
Stanby alerts are useful for viewing them without bothering other aspects <br><br>
<b>Using Alert Commands different from the email</b><br><br>
The email, as a command is internal to Pandora FMS and can't be configured, that is, field1, field2 and field3 are fields that are defined that are used as receiver, subject and text of the message. But, what happens if I want a different action that is defined by me? <br><br>
We're going to define a new command, something completely defined by us. Imagine that we want to create a lof file with each alert that we find. The format of this log file should be something like: <br><br>
<i>DATE_ HOUR - NAME_AGENT - NAME_MODULE - VALUE - PROBLEM DESCRIPTION
</i><br><br>
Where VALUE is the value of the module at this moment. It'll be several log files, depending on the action that calls to the command. The action will define the description and the file to which the events go to. <br><br>
For it, first we are going to create a command as follows: <br><br>
<?php html_print_image ("images/help/alert15.png", false, array('width' => '550px')); ?>
<br> <br>
And we're going to define an action: <br><br> The alert recovery is optional. It's important to say that if in the
alert recovery data are fields (field2 and field3) that are defined,
<?php html_print_image ("images/help/alert16.png", false, array('width' => '550px')); ?> these "ignore and overwrite the action fields, that's to say, that they
have preference over them. The only valid field that can't be modified
is the field1.<br>
<br> <br>
If we take a look at the log that we've created: <br><br> <b>Associating the Alert to the Command</b><br>
<br>
<i>2010-05-25 18:17:10 - farscape - cpu_sys - 23.00 - Custom alert for LOG#1</i><br><br> Now, we have all that we need, we only have to associate the alert
template to the module. For it, go to the alert tab in the agent where
the module is:<br>
<br>
<?php
html_print_image("images/help/alert12.png", false,
array('width' => '550px'));
?>
<br>
It's easy. In this screenshot we can see an alert already configured for
a module named "Last_Backup_Unixtime" to the same template that we have
defined before as "Module critical". Now, in the controls that are
below, we are going to create an association between the module
"cpu-sys" and the alert template "Module critical". By default it'll
show the action that we've defined in this template "Send email to
Sancho Lerena".<br>
<br>
<b>Scaling Alerts</b><br>
<br>
The values that are in the "Number of alerts match from" are to define
the alert scaling. This allows to "redefine" a little more the alert
performance, so if we have defined a maximum of 5 times the times that
an alert could be fired, and we only want that it send us an email, then
we should put here one 0 and one 1, to order it that only send us an
email from time 0 to 1 (that is, once).<br>
<br>
Now we see that we can add more actions to the same alert, defining with
this fields "Number of alerts match from" the alert performance
depending on how many times it would be fired.<br>
<br>
For example: we want that it sends an email to XXXXX the first time it
happens, and if the monitor continues being down, it sends an email to
ZZZZ. For it, after associating the alert, in the assigned alerts table,
I can add more actions to a previously defined alert, as we can see in
the following screenshot:<br>
<br>
<?php
html_print_image("images/help/alert13.png", false,
array('width' => '550px'));
?>
<?php
html_print_image("images/help/alert14.png", false,
array('width' => '550px'));
?>
<br>
<b>Standby alerts</b><br>
<br>
Alerts can be enable, disable or in standby mode. The difference between
the disabled and standby alerts is that the disable alerts just do not
work and therefore will not showed in the alerts view. Standby alerts
will be showed in the alerts view and work, but only at display level.
It will show if are fired or not but will do not engage in configured
actions and will do not generate events.<br>
<br>
Stanby alerts are useful for viewing them without bothering other
aspects<br>
<br>
<b>Using Alert Commands different from the email</b><br>
<br>
The email, as a command is internal to Pandora FMS and can't be
configured, that is, field1, field2 and field3 are fields that are
defined that are used as receiver, subject and text of the message. But,
what happens if I want a different action that is defined by me?<br>
<br>
We're going to define a new command, something completely defined by us.
Imagine that we want to create a lof file with each alert that we find.
The format of this log file should be something like:<br>
<br>
<i>DATE_ HOUR - NAME_AGENT - NAME_MODULE - VALUE - PROBLEM
DESCRIPTION</i><br>
<br>
Where VALUE is the value of the module at this moment. It'll be several
log files, depending on the action that calls to the command. The action
will define the description and the file to which the events go to.<br>
<br>
For it, first we are going to create a command as follows:<br>
<br>
<?php
html_print_image("images/help/alert15.png", false,
array('width' => '550px'));
?>
<br>
And we're going to define an action:<br>
<br>
<?php
html_print_image("images/help/alert16.png", false,
array('width' => '550px'));
?>
<br>
If we take a look at the log that we've created:<br>
<br>
<i>2010-05-25 18:17:10 - farscape - cpu_sys - 23.00 - Custom alert for
LOG#1</i><br>
<br>
<br>
We can see that the alert was fired at 18:17:10 in the " farscape"
agent, in the "cpu_sys" module, with a data of "23.00" and with the
description that we chose when we defined the action.<br>
<br>
As the command execution, the field order and other things could do that
we don't understand well how the command is finally executed, the
easiest thing is to activate the debug traces of the pandora server
(verbose 10) in the pandora server configuration file
/etc/pandora/pandora_server.conf, and restart the server
(/etc/init.d/pandora_server restart) and we take a look to the file
/var/log/pandora/pandora_server.log looking for the exact line with the
alert command execution that we've defined, to see how the Pandora FMS
server is firing the command.<br>
<br> <br>
We can see that the alert was fired at 18:17:10 in the " farscape" agent, in the "cpu_sys" module, with a data of "23.00" and with the description that we chose when we defined the action. <br><br>
As the command execution, the field order and other things could do that we don't understand well how the command is finally executed, the easiest thing is to activate the debug traces of the pandora server (verbose 10) in the pandora server configuration file /etc/pandora/pandora_server.conf, and restart the server (/etc/init.d/pandora_server restart) and we take a look to the file /var/log/pandora/pandora_server.log looking for the exact line with the alert command execution that we've defined, to see how the Pandora FMS server is firing the command. <br><br>

View File

@ -7,337 +7,471 @@
The format of the outputted date string. See the formatting The format of the outputted date string. See the formatting
options below. options below.
</p> </p>
<p class="para"> <p class="para"></p>
<table border="5">
</p><table border="5"> <caption>
<caption><b>The following characters are recognized in the <b>
The following characters are recognized in the
<i><tt class="parameter">format</tt></i> <i><tt class="parameter">format</tt></i>
parameter string</b></caption> parameter string
<colgroup> </b>
</caption>
</colgroup><thead valign="middle"> <colgroup></colgroup>
<thead valign="middle">
<tr valign="middle"> <tr valign="middle">
<th colspan="1"><i><tt class="parameter">format</tt></i> <th colspan="1">
<i><tt class="parameter">format</tt></i>character
character</th> </th>
<th colspan="1">Description</th> <th colspan="1">Description</th>
<th colspan="1">Example returned values</th> <th colspan="1">Example returned values</th>
</tr> </tr>
</thead> </thead>
<tbody class="tbody" valign="middle"> <tbody class="tbody" valign="middle">
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="center"><em class="emphasis">Day</em></td> <td colspan="1" rowspan="1" align="center">
<em class="emphasis">Day</em>
</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>d</i></td> <td colspan="1" rowspan="1" align="left"><i>d</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Day of the month, 2 digits with leading zeros</td> Day of the month, 2 digits with leading zeros
<td colspan="1" rowspan="1" align="left"><i>01</i> to <i>31</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>01</i> to <i>31</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>D</i></td> <td colspan="1" rowspan="1" align="left"><i>D</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">A textual representation of a day, three letters</td> A textual representation of a day, three letters
<td colspan="1" rowspan="1" align="left"><i>Mon</i> through <i>Sun</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>Mon</i> through <i>Sun</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>j</i></td> <td colspan="1" rowspan="1" align="left"><i>j</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Day of the month without leading zeros</td> Day of the month without leading zeros
<td colspan="1" rowspan="1" align="left"><i>1</i> to <i>31</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>1</i> to <i>31</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>l</i> (lowercase 'L')</td> <td colspan="1" rowspan="1" align="left">
<i>l</i> (lowercase 'L')
<td colspan="1" rowspan="1" align="left">A full textual representation of the day of the week</td> </td>
<td colspan="1" rowspan="1" align="left"><i>Sunday</i> through <i>Saturday</i></td> <td colspan="1" rowspan="1" align="left">
A full textual representation of the day of the week
</td>
<td colspan="1" rowspan="1" align="left">
<i>Sunday</i> through <i>Saturday</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>N</i></td> <td colspan="1" rowspan="1" align="left"><i>N</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">ISO-8601 numeric representation of the day of the week (added in ISO-8601 numeric representation of the day of the week
PHP 5.1.0)</td> (added in PHP 5.1.0)
<td colspan="1" rowspan="1" align="left"><i>1</i> (for Monday) through <i>7</i> (for Sunday)</td> </td>
<td colspan="1" rowspan="1" align="left">
<i>1</i> (for Monday) through <i>7</i> (for Sunday)
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>S</i></td> <td colspan="1" rowspan="1" align="left"><i>S</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">English ordinal suffix for the day of the month, 2 characters</td> English ordinal suffix for the day of the month, 2 characters
</td>
<td colspan="1" rowspan="1" align="left"> <td colspan="1" rowspan="1" align="left">
<i>st</i>, <i>nd</i>, <i>rd</i> or <i>st</i>, <i>nd</i>, <i>rd</i> or
<i>th</i>. Works well with <i>j</i> <i>th</i>. Works well with <i>j</i>
</td> </td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>w</i></td> <td colspan="1" rowspan="1" align="left"><i>w</i></td>
<td colspan="1" rowspan="1" align="left">Numeric representation of the day of the week</td> <td colspan="1" rowspan="1" align="left">Numeric representation of the day of the week</td>
<td colspan="1" rowspan="1" align="left"><i>0</i> (for Sunday) through <i>6</i> (for Saturday)</td> <td colspan="1" rowspan="1" align="left">
<i>0</i> (for Sunday) through <i>6</i> (for Saturday)
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>z</i></td> <td colspan="1" rowspan="1" align="left"><i>z</i></td>
<td colspan="1" rowspan="1" align="left">The day of the year (starting from 0)</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>0</i> through <i>365</i></td> The day of the year (starting from 0)
</td>
<td colspan="1" rowspan="1" align="left">
<i>0</i> through <i>365</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="center"><em class="emphasis">Week</em></td> <td colspan="1" rowspan="1" align="center">
<em class="emphasis">Week</em>
</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>W</i></td> <td colspan="1" rowspan="1" align="left"><i>W</i></td>
<td colspan="1" rowspan="1" align="left">ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Example: <i>42</i> (the 42nd week in the year)</td> ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)
</td>
<td colspan="1" rowspan="1" align="left">
Example: <i>42</i> (the 42nd week in the year)
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="center"><em class="emphasis">Month</em></td> <td colspan="1" rowspan="1" align="center">
<em class="emphasis">Month</em>
</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>F</i></td> <td colspan="1" rowspan="1" align="left"><i>F</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">A full textual representation of a month, such as January or March</td> A full textual representation of a month, such as January or March
<td colspan="1" rowspan="1" align="left"><i>January</i> through <i>December</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>January</i> through <i>December</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>m</i></td> <td colspan="1" rowspan="1" align="left"><i>m</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Numeric representation of a month, with leading zeros</td> Numeric representation of a month, with leading zeros
<td colspan="1" rowspan="1" align="left"><i>01</i> through <i>12</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>01</i> through <i>12</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>M</i></td> <td colspan="1" rowspan="1" align="left"><i>M</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">A short textual representation of a month, three letters</td> A short textual representation of a month, three letters
<td colspan="1" rowspan="1" align="left"><i>Jan</i> through <i>Dec</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>Jan</i> through <i>Dec</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>n</i></td> <td colspan="1" rowspan="1" align="left"><i>n</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Numeric representation of a month, without leading zeros</td> Numeric representation of a month, without leading zeros
<td colspan="1" rowspan="1" align="left"><i>1</i> through <i>12</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>1</i> through <i>12</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>t</i></td> <td colspan="1" rowspan="1" align="left"><i>t</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Number of days in the given month</td> Number of days in the given month
<td colspan="1" rowspan="1" align="left"><i>28</i> through <i>31</i></td> </td>
<td colspan="1" rowspan="1" align="left">
<i>28</i> through <i>31</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="center"><em class="emphasis">Year</em></td> <td colspan="1" rowspan="1" align="center">
<em class="emphasis">Year</em>
</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>L</i></td> <td colspan="1" rowspan="1" align="left"><i>L</i></td>
<td colspan="1" rowspan="1" align="left">Whether it's a leap year</td> <td colspan="1" rowspan="1" align="left">
Whether it's a leap year
<td colspan="1" rowspan="1" align="left"><i>1</i> if it is a leap year, <i>0</i> otherwise.</td> </td>
<td colspan="1" rowspan="1" align="left">
<i>1</i> if it is a leap year, <i>0</i> otherwise.
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>o</i></td> <td colspan="1" rowspan="1" align="left"><i>o</i></td>
<td colspan="1" rowspan="1" align="left">ISO-8601 year number. This has the same value as <td colspan="1" rowspan="1" align="left">
ISO-8601 year number. This has the same value as
<i>Y</i>, except that if the ISO week number <i>Y</i>, except that if the ISO week number
(<i>W</i>) belongs to the previous or next year, that year (<i>W</i>) belongs to the previous or next year,
is used instead. (added in PHP 5.1.0)</td> that year is used instead. (added in PHP 5.1.0)
</td>
<td colspan="1" rowspan="1" align="left">Examples: <i>1999</i> or <i>2003</i></td> <td colspan="1" rowspan="1" align="left">
Examples: <i>1999</i> or <i>2003</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>Y</i></td> <td colspan="1" rowspan="1" align="left"><i>Y</i></td>
<td colspan="1" rowspan="1" align="left">A full numeric representation of a year, 4 digits</td> <td colspan="1" rowspan="1" align="left">
A full numeric representation of a year, 4 digits
<td colspan="1" rowspan="1" align="left">Examples: <i>1999</i> or <i>2003</i></td> </td>
<td colspan="1" rowspan="1" align="left">
Examples: <i>1999</i> or <i>2003</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>y</i></td> <td colspan="1" rowspan="1" align="left"><i>y</i></td>
<td colspan="1" rowspan="1" align="left">A two digit representation of a year</td> <td colspan="1" rowspan="1" align="left">
A two digit representation of a year
<td colspan="1" rowspan="1" align="left">Examples: <i>99</i> or <i>03</i></td> </td>
<td colspan="1" rowspan="1" align="left">
Examples: <i>99</i> or <i>03</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="center"><em class="emphasis">Time</em></td> <td colspan="1" rowspan="1" align="center">
<em class="emphasis">Time</em>
</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>a</i></td> <td colspan="1" rowspan="1" align="left"><i>a</i></td>
<td colspan="1" rowspan="1" align="left">Lowercase Ante meridiem and Post meridiem</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>am</i> or <i>pm</i></td> Lowercase Ante meridiem and Post meridiem
</td>
<td colspan="1" rowspan="1" align="left">
<i>am</i> or <i>pm</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>A</i></td> <td colspan="1" rowspan="1" align="left"><i>A</i></td>
<td colspan="1" rowspan="1" align="left">Uppercase Ante meridiem and Post meridiem</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>AM</i> or <i>PM</i></td> Uppercase Ante meridiem and Post meridiem
</td>
<td colspan="1" rowspan="1" align="left">
<i>AM</i> or <i>PM</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>B</i></td> <td colspan="1" rowspan="1" align="left"><i>B</i></td>
<td colspan="1" rowspan="1" align="left">Swatch Internet time</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>000</i> through <i>999</i></td> Swatch Internet time
</td>
<td colspan="1" rowspan="1" align="left">
<i>000</i> through <i>999</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>g</i></td> <td colspan="1" rowspan="1" align="left"><i>g</i></td>
<td colspan="1" rowspan="1" align="left">12-hour format of an hour without leading zeros</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>1</i> through <i>12</i></td> 12-hour format of an hour without leading zeros
</td>
<td colspan="1" rowspan="1" align="left">
<i>1</i> through <i>12</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>G</i></td> <td colspan="1" rowspan="1" align="left"><i>G</i></td>
<td colspan="1" rowspan="1" align="left">24-hour format of an hour without leading zeros</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>0</i> through <i>23</i></td> 24-hour format of an hour without leading zeros
</td>
<td colspan="1" rowspan="1" align="left">
<i>0</i> through <i>23</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>h</i></td> <td colspan="1" rowspan="1" align="left"><i>h</i></td>
<td colspan="1" rowspan="1" align="left">12-hour format of an hour with leading zeros</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>01</i> through <i>12</i></td> 12-hour format of an hour with leading zeros
</td>
<td colspan="1" rowspan="1" align="left">
<i>01</i> through <i>12</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>H</i></td> <td colspan="1" rowspan="1" align="left"><i>H</i></td>
<td colspan="1" rowspan="1" align="left">24-hour format of an hour with leading zeros</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>00</i> through <i>23</i></td> 24-hour format of an hour with leading zeros
</td>
<td colspan="1" rowspan="1" align="left">
<i>00</i> through <i>23</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>i</i></td> <td colspan="1" rowspan="1" align="left"><i>i</i></td>
<td colspan="1" rowspan="1" align="left">Minutes with leading zeros</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>00</i> to <i>59</i></td> Minutes with leading zeros
</td>
<td colspan="1" rowspan="1" align="left">
<i>00</i> to <i>59</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>s</i></td> <td colspan="1" rowspan="1" align="left"><i>s</i></td>
<td colspan="1" rowspan="1" align="left">Seconds, with leading zeros</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left"><i>00</i> through <i>59</i></td> Seconds, with leading zeros
</td>
<td colspan="1" rowspan="1" align="left">
<i>00</i> through <i>59</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>u</i></td> <td colspan="1" rowspan="1" align="left"><i>u</i></td>
<td colspan="1" rowspan="1" align="left">Milliseconds (added in PHP 5.2.2)</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Example: <i>54321</i></td> Milliseconds (added in PHP 5.2.2)
</td>
<td colspan="1" rowspan="1" align="left">
Example: <i>54321</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="center"><em class="emphasis">Timezone</em></td> <td colspan="1" rowspan="1" align="center">
<em class="emphasis">Timezone</em>
</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>e</i></td> <td colspan="1" rowspan="1" align="left"><i>e</i></td>
<td colspan="1" rowspan="1" align="left">Timezone identifier (added in PHP 5.1.0)</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Examples: <i>UTC</i>, <i>GMT</i>, <i>Atlantic/Azores</i></td> Timezone identifier (added in PHP 5.1.0)
</td>
<td colspan="1" rowspan="1" align="left">
Examples: <i>UTC</i>, <i>GMT</i>, <i>Atlantic/Azores</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>I</i> (capital i)</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Whether or not the date is in daylight saving time</td> <i>I</i> (capital i)
<td colspan="1" rowspan="1" align="left"><i>1</i> if Daylight Saving Time, <i>0</i> otherwise.</td> </td>
<td colspan="1" rowspan="1" align="left">
Whether or not the date is in daylight saving time
</td>
<td colspan="1" rowspan="1" align="left">
<i>1</i> if Daylight Saving Time, <i>0</i> otherwise.
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>O</i></td> <td colspan="1" rowspan="1" align="left"><i>O</i></td>
<td colspan="1" rowspan="1" align="left">Difference to Greenwich time (GMT) in hours</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Example: <i>+0200</i></td> Difference to Greenwich time (GMT) in hours
</td>
<td colspan="1" rowspan="1" align="left">
Example: <i>+0200</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>P</i></td> <td colspan="1" rowspan="1" align="left"><i>P</i></td>
<td colspan="1" rowspan="1" align="left">Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Example: <i>+02:00</i></td> Difference to Greenwich time (GMT) with colon between
hours and minutes (added in PHP 5.1.3)
</td>
<td colspan="1" rowspan="1" align="left">
Example: <i>+02:00</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>T</i></td> <td colspan="1" rowspan="1" align="left"><i>T</i></td>
<td colspan="1" rowspan="1" align="left">Timezone abbreviation</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">Examples: <i>EST</i>, <i>MDT</i> ...</td> Timezone abbreviation
</td>
<td colspan="1" rowspan="1" align="left">
Examples: <i>EST</i>, <i>MDT</i> ...
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>Z</i></td> <td colspan="1" rowspan="1" align="left"><i>Z</i></td>
<td colspan="1" rowspan="1" align="left">Timezone offset in seconds. The offset for timezones west of UTC is always <td colspan="1" rowspan="1" align="left">
negative, and for those east of UTC is always positive.</td> Timezone offset in seconds. The offset for timezones
<td colspan="1" rowspan="1" align="left"><i>-43200</i> through <i>50400</i></td> west of UTC is always negative, and for those east of
UTC is always positive.
</td>
<td colspan="1" rowspan="1" align="left">
<i>-43200</i> through <i>50400</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="center"><em class="emphasis">Full Date/Time</em></td> <td colspan="1" rowspan="1" align="center">
<em class="emphasis">Full Date/Time</em>
</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
<td colspan="1" rowspan="1" align="left">---</td> <td colspan="1" rowspan="1" align="left">---</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>c</i></td> <td colspan="1" rowspan="1" align="left"><i>c</i></td>
<td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">ISO 8601 date (added in PHP 5)</td> ISO 8601 date (added in PHP 5)
<td colspan="1" rowspan="1" align="left">2004-02-12T15:19:21+00:00</td> </td>
<td colspan="1" rowspan="1" align="left">
2004-02-12T15:19:21+00:00
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>r</i></td> <td colspan="1" rowspan="1" align="left"><i>r</i></td>
<td colspan="1" rowspan="1" align="left"><a href="http://www.faqs.org/rfcs/rfc2822" class="link external">» RFC 2822</a> formatted date</td> <td colspan="1" rowspan="1" align="left">
<a href="http://www.faqs.org/rfcs/rfc2822"
<td colspan="1" rowspan="1" align="left">Example: <i>Thu, 21 Dec 2000 16:01:07 +0200</i></td> class="link external">
» RFC 2822
</a> formatted date
</td>
<td colspan="1" rowspan="1" align="left">
Example: <i>Thu, 21 Dec 2000 16:01:07 +0200</i>
</td>
</tr> </tr>
<tr valign="middle"> <tr valign="middle">
<td colspan="1" rowspan="1" align="left"><i>U</i></td> <td colspan="1" rowspan="1" align="left"><i>U</i></td>
<td colspan="1" rowspan="1" align="left">Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)</td> <td colspan="1" rowspan="1" align="left">
<td colspan="1" rowspan="1" align="left">See also <a href="http://es.php.net/manual/en/function.time.php" class="function">time()</a></td> Seconds since the Unix Epoch
(January 1 1970 00:00:00 GMT)
</td>
<td colspan="1" rowspan="1" align="left">
See also
<a href="http://es.php.net/manual/en/function.time.php"
class="function">
time()
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h3 class="title">Examples</h3> <h3 class="title">Examples</h3>

View File

@ -2,20 +2,40 @@
/* Include package help/es /* Include package help/es
*/ */
?> ?>
<p>El inventario te permite tener una lista completa de todos los
dispositivos de los servidores monitorizados. Con esto se puede tener
informacion de CPU, memoria RAM, parches, software, etc. de tus
servidores.<br>
</p>
<p>El inventario te permite tener una lista completa de todos los dispositivos de los servidores monitorizados. Con esto se puede tener informacion de CPU, memoria RAM, parches, software, etc. de tus servidores.<br></p> <p>A continuación se describen los campos que hay que completar para
añadir un módulo de inventario.<br>
<p>A continuación se describen los campos que hay que completar para añadir un módulo de inventario.<br> <li>
<ul>
<ul><b>Module:</b> Combo donde se elige el módulo de inventario que se quiere añadir. Sólo aparecerán los módulos cuyo Sistema Operativo coincide con el del agente.</ul> <b>Module:</b> Combo donde se elige el módulo de inventario que
<ul><b>Target:</b> IP o nombre del servidor del que se quiere sacar el inventario.</ul> se quiere añadir. Sólo aparecerán los módulos cuyo Sistema
<ul><b>Interval:</b> Combo donde se elige el intervalo de tiempo en que se ejecutará el módulo de inventario.</ul> Operativo coincide con el del agente.
<ul><b>Username:</b> Usuario que se usara para ejecutar el módulo de inventario.</ul> </ul>
<ul><b>Password:</b> Password del usuario que se usara para ejecutar el módulo de inventario. </ul> <ul>
<b>Target:</b> IP o nombre del servidor del que se quiere sacar
<p>Una vez completado el formulario se pulsa en “Add” para que el módulo se añada a los módulos de inventario.<br></p> el inventario.
</ul>
<p>Puede aplicar cambios en todos los módulos haciendo clic en "Actualizar todo" cuando se actualice cualquiera de los módulos.</p> <ul>
<b>Interval:</b> Combo donde se elige el intervalo de tiempo en
que se ejecutará el módulo de inventario.
</ul>
<ul>
<b>Username:</b> Usuario que se usara para ejecutar el módulo de
inventario.
</ul>
<ul>
<b>Password:</b> Password del usuario que se usara para ejecutar
el módulo de inventario.
</ul>
</li>
<p>Una vez completado el formulario se pulsa en “Add” para que el módulo
se añada a los módulos de inventario.<br>
</p>
<p>Puede aplicar cambios en todos los módulos haciendo clic en
"Actualizar todo" cuando se actualice cualquiera de los módulos.</p>

View File

@ -1,749 +0,0 @@
<?php
/**
* @package Include
* @subpackage External_Scripts
*/
/**
* htmLawed 1.1.7.2, 12 March 2009
* Copyright Santosh Patnaik
* Modified for Pandora FMS by Evi Vanoost
*
* GPL v3 license
* A PHP Labware internal utility; www.bioinformatics.org/phplabware/internal_utilities/htmLawed
*
* See htmLawed_README.txt/htm
*/
function hl_attrval($t, $p){
// check attr val against $S
$o = 1; $l = strlen($t);
foreach($p as $k=>$v){
switch($k){
case 'maxlen':if($l > $v){$o = 0;}
break; case 'minlen': if($l < $v){$o = 0;}
break; case 'maxval': if((float)($t) > $v){$o = 0;}
break; case 'minval': if((float)($t) < $v){$o = 0;}
break; case 'match': if(!preg_match($v, $t)){$o = 0;}
break; case 'nomatch': if(preg_match($v, $t)){$o = 0;}
break; case 'oneof':
$m = 0;
foreach(explode('|', $v) as $n){if($t == $n){$m = 1; break;}}
$o = $m;
break; case 'noneof':
$m = 1;
foreach(explode('|', $v) as $n){if($t == $n){$m = 0; break;}}
$o = $m;
break; default:
break;
}
if(!$o){break;}
}
return ($o ? $t : (isset($p['default']) ? $p['default'] : 0));
// eof
}
function hl_bal($t, $do=1, $in='div'){
// balance tags
// by content
$cB = array('blockquote'=>1, 'form'=>1, 'map'=>1, 'noscript'=>1); // Block
$cE = array('area'=>1, 'br'=>1, 'col'=>1, 'embed'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'isindex'=>1, 'param'=>1); // Empty
$cF = array('button'=>1, 'del'=>1, 'div'=>1, 'dd'=>1, 'fieldset'=>1, 'iframe'=>1, 'ins'=>1, 'li'=>1, 'noscript'=>1, 'object'=>1, 'td'=>1, 'th'=>1); // Flow; later context-wise dynamic move of ins & del to $cI
$cI = array('a'=>1, 'abbr'=>1, 'acronym'=>1, 'address'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'caption'=>1, 'cite'=>1, 'code'=>1, 'dfn'=>1, 'dt'=>1, 'em'=>1, 'font'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'i'=>1, 'kbd'=>1, 'label'=>1, 'legend'=>1, 'p'=>1, 'pre'=>1, 'q'=>1, 'rb'=>1, 'rt'=>1, 's'=>1, 'samp'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'tt'=>1, 'u'=>1, 'var'=>1); // Inline
$cN = array('a'=>array('a'=>1), 'button'=>array('a'=>1, 'button'=>1, 'fieldset'=>1, 'form'=>1, 'iframe'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'fieldset'=>array('fieldset'=>1), 'form'=>array('form'=>1), 'label'=>array('label'=>1), 'noscript'=>array('script'=>1), 'pre'=>array('big'=>1, 'font'=>1, 'img'=>1, 'object'=>1, 'script'=>1, 'small'=>1, 'sub'=>1, 'sup'=>1), 'rb'=>array('ruby'=>1), 'rt'=>array('ruby'=>1)); // Illegal
$cN2 = array_keys($cN);
$cR = array('blockquote'=>1, 'dir'=>1, 'dl'=>1, 'form'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'optgroup'=>1, 'rbc'=>1, 'rtc'=>1, 'ruby'=>1, 'select'=>1, 'table'=>1, 'tbody'=>1, 'tfoot'=>1, 'thead'=>1, 'tr'=>1, 'ul'=>1);
$cS = array('colgroup'=>array('col'=>1), 'dir'=>array('li'), 'dl'=>array('dd'=>1, 'dt'=>1), 'menu'=>array('li'=>1), 'ol'=>array('li'=>1), 'optgroup'=>array('option'=>1), 'option'=>array('#pcdata'=>1), 'rbc'=>array('rb'=>1), 'rp'=>array('#pcdata'=>1), 'rtc'=>array('rt'=>1), 'ruby'=>array('rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1), 'select'=>array('optgroup'=>1, 'option'=>1), 'script'=>array('#pcdata'=>1), 'table'=>array('caption'=>1, 'col'=>1, 'colgroup'=>1, 'tfoot'=>1, 'tbody'=>1, 'tr'=>1, 'thead'=>1), 'tbody'=>array('tr'=>1), 'tfoot'=>array('tr'=>1), 'textarea'=>array('#pcdata'=>1), 'thead'=>array('tr'=>1), 'tr'=>array('td'=>1, 'th'=>1), 'ul'=>array('li'=>1)); // Specific - immediate parent-child
$cO = array('address'=>array('p'=>1), 'applet'=>array('param'=>1), 'blockquote'=>array('script'=>1), 'fieldset'=>array('legend'=>1, '#pcdata'=>1), 'form'=>array('script'=>1), 'map'=>array('area'=>1), 'object'=>array('param'=>1, 'embed'=>1)); // Other
$cT = array('colgroup'=>1, 'dd'=>1, 'dt'=>1, 'li'=>1, 'option'=>1, 'p'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1); // Omitable closing
// block/inline type; ins & del both type; #pcdata: text
$eB = array('address'=>1, 'blockquote'=>1, 'center'=>1, 'del'=>1, 'dir'=>1, 'dl'=>1, 'div'=>1, 'fieldset'=>1, 'form'=>1, 'ins'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'isindex'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'p'=>1, 'pre'=>1, 'table'=>1, 'ul'=>1);
$eI = array('#pcdata'=>1, 'a'=>1, 'abbr'=>1, 'acronym'=>1, 'applet'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'br'=>1, 'button'=>1, 'cite'=>1, 'code'=>1, 'del'=>1, 'dfn'=>1, 'em'=>1, 'embed'=>1, 'font'=>1, 'i'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'ins'=>1, 'kbd'=>1, 'label'=>1, 'map'=>1, 'object'=>1, 'param'=>1, 'q'=>1, 'ruby'=>1, 's'=>1, 'samp'=>1, 'select'=>1, 'script'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'textarea'=>1, 'tt'=>1, 'u'=>1, 'var'=>1);
$eN = array('a'=>1, 'big'=>1, 'button'=>1, 'fieldset'=>1, 'font'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'label'=>1, 'object'=>1, 'ruby'=>1, 'script'=>1, 'select'=>1, 'small'=>1, 'sub'=>1, 'sup'=>1, 'textarea'=>1); // Exclude from specific ele; $cN values
$eO = array('area'=>1, 'caption'=>1, 'col'=>1, 'colgroup'=>1, 'dd'=>1, 'dt'=>1, 'legend'=>1, 'li'=>1, 'optgroup'=>1, 'option'=>1, 'rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1, 'script'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'thead'=>1, 'th'=>1, 'tr'=>1); // Missing in $eB & $eI
$eF = $eB + $eI;
// $in sets allowed child
$in = ((isset($eF[$in]) && $in != '#pcdata') or isset($eO[$in])) ? $in : 'div';
if(isset($cE[$in])){
return (!$do ? '' : str_replace(array('<', '>'), array('&lt;', '&gt;'), $t));
}
if(isset($cS[$in])){$inOk = $cS[$in];}
elseif(isset($cI[$in])){$inOk = $eI; $cI['del'] = 1; $cI['ins'] = 1;}
elseif(isset($cF[$in])){$inOk = $eF; unset($cI['del'], $cI['ins']);}
elseif(isset($cB[$in])){$inOk = $eB; unset($cI['del'], $cI['ins']);}
if(isset($cO[$in])){$inOk = $inOk + $cO[$in];}
if(isset($cN[$in])){$inOk = array_diff_assoc($inOk, $cN[$in]);}
$t = explode('<', $t);
$ok = $q = array(); // $q seq list of open non-empty ele
$o = "";
for($i=-1, $ci=count($t); ++$i<$ci;) {
// allowed $ok in parent $p
if($ql = count($q)) {
$p = array_pop($q);
$q[] = $p;
if(isset($cS[$p])){$ok = $cS[$p];}
elseif(isset($cI[$p])){$ok = $eI; $cI['del'] = 1; $cI['ins'] = 1;}
elseif(isset($cF[$p])){$ok = $eF; unset($cI['del'], $cI['ins']);}
elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);}
if(isset($cO[$p])){$ok = $ok + $cO[$p];}
if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);}
}
else {
$ok = $inOk; unset($cI['del'], $cI['ins']);
}
// bad tags, & ele content
if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){
$o .= '&lt;'.$s.$e.$a.'&gt;';
}
if(isset($x[0])){
if($do < 3 or isset($ok['#pcdata'])){$o .= $x;}
elseif(strpos($x, "\x02\x04")){
foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){
$o .= (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : ''));
}
}
elseif ($do > 4) {
$o .= preg_replace('`\S`', '', $x);
}
}
// get markup
if(!preg_match('`^(/?)([a-zA-Z1-6]+)([^>]*)>(.*)`sm', $t[$i], $r)){$x = $t[$i]; continue;}
$s = null; $e = null; $a = null; $x = null; list($all, $s, $e, $a, $x) = $r;
// close tag
if($s){
if(isset($cE[$e]) or !in_array($e, $q)){continue;} // Empty/unopen
if($p == $e){array_pop($q); $o .= '</'.$e.'>'; unset($e); continue;} // Last open
$add = ''; // Nesting - close open tags that need to be
for($j=-1, $cj=count($q); ++$j<$cj;){
if(($d = array_pop($q)) == $e){break;}
else{$add .= "</{$d}>";}
}
$o .= $add.'</'.$e.'>';
unset($e);
continue;
}
// open tag
// $cB ele needs $eB ele as child
if(isset($cB[$e]) && strlen(trim($x))){
$t[$i] = "{$e}{$a}>";
array_splice($t, $i+1, 0, 'div>'. $x); unset($e, $x); ++$ci; --$i; continue;
}
if((($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql)) && !isset($eB[$e]) && !isset($ok[$e])){
array_splice($t, $i, 0, 'div>'); unset($e, $x); ++$ci; --$i; continue;
}
// if no open ele, $in = parent; mostly immediate parent-child relation should hold
if(!$ql or !isset($eN[$e]) or !array_intersect($q, $cN2)){
if(!isset($ok[$e])){
if($ql && isset($cT[$p])){$o .= '</'.array_pop($q).'>'; unset($e, $x); --$i;}
continue;
}
if(!isset($cE[$e])){$q[] = $e;}
$o .= '<'.$e.$a.'>'; unset($e); continue;
}
// specific parent-child
if(isset($cS[$p][$e])){
if(!isset($cE[$e])){$q[] = $e;}
$o .= '<'.$e.$a.'>'; unset($e); continue;
}
// nesting
$add = '';
$q2 = array();
for($k=-1, $kc=count($q); ++$k<$kc;){
$d = $q[$k];
$ok2 = array();
if(isset($cS[$d])){$q2[] = $d; continue;}
$ok2 = isset($cI[$d]) ? $eI : $eF;
if(isset($cO[$d])){$ok2 = $ok2 + $cO[$d];}
if(isset($cN[$d])){$ok2 = array_diff_assoc($ok2, $cN[$d]);}
if(!isset($ok2[$e])){
if(!$k && !isset($inOk[$e])){continue 2;}
$add = "</{$d}>";
for(;++$k<$kc;){$add = "</{$q[$k]}>{$add}";}
break;
}
else{$q2[] = $d;}
}
$q = $q2;
if(!isset($cE[$e])){$q[] = $e;}
$o .= $add.'<'.$e.$a.'>';
unset($e);
continue;
}
// end
if($ql = count($q)){
$p = array_pop($q);
$q[] = $p;
if(isset($cS[$p])){$ok = $cS[$p];}
elseif(isset($cI[$p])){$ok = $eI; $cI['del'] = 1; $cI['ins'] = 1;}
elseif(isset($cF[$p])){$ok = $eF; unset($cI['del'], $cI['ins']);}
elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);}
if(isset($cO[$p])){$ok = $ok + $cO[$p];}
if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);}
}
else {
$ok = $inOk; unset($cI['del'], $cI['ins']);}
if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){
$o .= '&lt;'.$s.$e.$a.'&gt;';
}
if(isset($x[0])){
if(strlen(trim($x)) && (($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql))){
$o .= '<div>'.$x.'</div>';
}
elseif($do < 3 or isset($ok['#pcdata'])){$o .= $x;}
elseif(strpos($x, "\x02\x04")){
foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){
$o .= (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : ''));
}
}
elseif($do > 4){$o .= preg_replace('`\S`', '', $x);}
}
while(!empty($q) && ($e = array_pop($q))){$o .= '</'.$e.'>';}
return $o;
// eof
}
function hl_cmtcd($t){
// comment/CDATA sec handler
$t = $t[0];
global $C;
if($t[3] == '-'){
if(!$C['comment']){return $t;}
if($C['comment'] == 1){return '';}
if(substr(($t = preg_replace('`--+`', '-', substr($t, 4, -3))), -1) != ' '){$t .= ' ';}
$t = $C['comment'] == 2 ? str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $t) : $t;
$t = "\x01\x02\x04!--$t--\x05\x02\x01";
}
else { // CDATA
if(!$C['cdata']){return $t;}
if($C['cdata'] == 1){return '';}
$t = substr($t, 1, -1);
$t = $C['cdata'] == 2 ? str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $t) : $t;
$t = "\x01\x01\x04$t\x05\x01\x01";
}
return str_replace(array('&', '<', '>'), array("\x03", "\x04", "\x05"), $t);
// eof
}
function hl_ent($t){
// entitity handler
global $C;
$t = $t[1];
static $U = array('quot'=>1,'amp'=>1,'lt'=>1,'gt'=>1);
static $N = array('fnof'=>'402', 'Alpha'=>'913', 'Beta'=>'914', 'Gamma'=>'915', 'Delta'=>'916', 'Epsilon'=>'917', 'Zeta'=>'918', 'Eta'=>'919', 'Theta'=>'920', 'Iota'=>'921', 'Kappa'=>'922', 'Lambda'=>'923', 'Mu'=>'924', 'Nu'=>'925', 'Xi'=>'926', 'Omicron'=>'927', 'Pi'=>'928', 'Rho'=>'929', 'Sigma'=>'931', 'Tau'=>'932', 'Upsilon'=>'933', 'Phi'=>'934', 'Chi'=>'935', 'Psi'=>'936', 'Omega'=>'937', 'alpha'=>'945', 'beta'=>'946', 'gamma'=>'947', 'delta'=>'948', 'epsilon'=>'949', 'zeta'=>'950', 'eta'=>'951', 'theta'=>'952', 'iota'=>'953', 'kappa'=>'954', 'lambda'=>'955', 'mu'=>'956', 'nu'=>'957', 'xi'=>'958', 'omicron'=>'959', 'pi'=>'960', 'rho'=>'961', 'sigmaf'=>'962', 'sigma'=>'963', 'tau'=>'964', 'upsilon'=>'965', 'phi'=>'966', 'chi'=>'967', 'psi'=>'968', 'omega'=>'969', 'thetasym'=>'977', 'upsih'=>'978', 'piv'=>'982', 'bull'=>'8226', 'hellip'=>'8230', 'prime'=>'8242', 'Prime'=>'8243', 'oline'=>'8254', 'frasl'=>'8260', 'weierp'=>'8472', 'image'=>'8465', 'real'=>'8476', 'trade'=>'8482', 'alefsym'=>'8501', 'larr'=>'8592', 'uarr'=>'8593', 'rarr'=>'8594', 'darr'=>'8595', 'harr'=>'8596', 'crarr'=>'8629', 'lArr'=>'8656', 'uArr'=>'8657', 'rArr'=>'8658', 'dArr'=>'8659', 'hArr'=>'8660', 'forall'=>'8704', 'part'=>'8706', 'exist'=>'8707', 'empty'=>'8709', 'nabla'=>'8711', 'isin'=>'8712', 'notin'=>'8713', 'ni'=>'8715', 'prod'=>'8719', 'sum'=>'8721', 'minus'=>'8722', 'lowast'=>'8727', 'radic'=>'8730', 'prop'=>'8733', 'infin'=>'8734', 'ang'=>'8736', 'and'=>'8743', 'or'=>'8744', 'cap'=>'8745', 'cup'=>'8746', 'int'=>'8747', 'there4'=>'8756', 'sim'=>'8764', 'cong'=>'8773', 'asymp'=>'8776', 'ne'=>'8800', 'equiv'=>'8801', 'le'=>'8804', 'ge'=>'8805', 'sub'=>'8834', 'sup'=>'8835', 'nsub'=>'8836', 'sube'=>'8838', 'supe'=>'8839', 'oplus'=>'8853', 'otimes'=>'8855', 'perp'=>'8869', 'sdot'=>'8901', 'lceil'=>'8968', 'rceil'=>'8969', 'lfloor'=>'8970', 'rfloor'=>'8971', 'lang'=>'9001', 'rang'=>'9002', 'loz'=>'9674', 'spades'=>'9824', 'clubs'=>'9827', 'hearts'=>'9829', 'diams'=>'9830', 'apos'=>'39', 'OElig'=>'338', 'oelig'=>'339', 'Scaron'=>'352', 'scaron'=>'353', 'Yuml'=>'376', 'circ'=>'710', 'tilde'=>'732', 'ensp'=>'8194', 'emsp'=>'8195', 'thinsp'=>'8201', 'zwnj'=>'8204', 'zwj'=>'8205', 'lrm'=>'8206', 'rlm'=>'8207', 'ndash'=>'8211', 'mdash'=>'8212', 'lsquo'=>'8216', 'rsquo'=>'8217', 'sbquo'=>'8218', 'ldquo'=>'8220', 'rdquo'=>'8221', 'bdquo'=>'8222', 'dagger'=>'8224', 'Dagger'=>'8225', 'permil'=>'8240', 'lsaquo'=>'8249', 'rsaquo'=>'8250', 'euro'=>'8364', 'nbsp'=>'160', 'iexcl'=>'161', 'cent'=>'162', 'pound'=>'163', 'curren'=>'164', 'yen'=>'165', 'brvbar'=>'166', 'sect'=>'167', 'uml'=>'168', 'copy'=>'169', 'ordf'=>'170', 'laquo'=>'171', 'not'=>'172', 'shy'=>'173', 'reg'=>'174', 'macr'=>'175', 'deg'=>'176', 'plusmn'=>'177', 'sup2'=>'178', 'sup3'=>'179', 'acute'=>'180', 'micro'=>'181', 'para'=>'182', 'middot'=>'183', 'cedil'=>'184', 'sup1'=>'185', 'ordm'=>'186', 'raquo'=>'187', 'frac14'=>'188', 'frac12'=>'189', 'frac34'=>'190', 'iquest'=>'191', 'Agrave'=>'192', 'Aacute'=>'193', 'Acirc'=>'194', 'Atilde'=>'195', 'Auml'=>'196', 'Aring'=>'197', 'AElig'=>'198', 'Ccedil'=>'199', 'Egrave'=>'200', 'Eacute'=>'201', 'Ecirc'=>'202', 'Euml'=>'203', 'Igrave'=>'204', 'Iacute'=>'205', 'Icirc'=>'206', 'Iuml'=>'207', 'ETH'=>'208', 'Ntilde'=>'209', 'Ograve'=>'210', 'Oacute'=>'211', 'Ocirc'=>'212', 'Otilde'=>'213', 'Ouml'=>'214', 'times'=>'215', 'Oslash'=>'216', 'Ugrave'=>'217', 'Uacute'=>'218', 'Ucirc'=>'219', 'Uuml'=>'220', 'Yacute'=>'221', 'THORN'=>'222', 'szlig'=>'223', 'agrave'=>'224', 'aacute'=>'225', 'acirc'=>'226', 'atilde'=>'227', 'auml'=>'228', 'aring'=>'229', 'aelig'=>'230', 'ccedil'=>'231', 'egrave'=>'232', 'eacute'=>'233', 'ecirc'=>'234', 'euml'=>'235', 'igrave'=>'236', 'iacute'=>'237', 'icirc'=>'238', 'iuml'=>'239', 'eth'=>'240', 'ntilde'=>'241', 'ograve'=>'242', 'oacute'=>'243', 'ocirc'=>'244', 'otilde'=>'245', 'ouml'=>'246', 'divide'=>'247', 'oslash'=>'248', 'ugrave'=>'249', 'uacute'=>'250', 'ucirc'=>'251', 'uuml'=>'252', 'yacute'=>'253', 'thorn'=>'254', 'yuml'=>'255');
if($t[0] != '#'){
return ($C['and_mark'] ? "\x06" : '&'). (isset($U[$t]) ? $t : (isset($N[$t]) ? (!$C['named_entity'] ? '#'. ($C['hexdec_entity'] > 1 ? 'x'. dechex($N[$t]) : $N[$t]) : $t) : 'amp;'. $t)). ';';
}
if(($n = ctype_digit($t = substr($t, 1)) ? intval($t) : hexdec(substr($t, 1))) < 9 or ($n > 13 && $n < 32) or $n == 11 or $n == 12 or ($n > 126 && $n < 160 && $n != 133) or ($n > 55295 && ($n < 57344 or ($n > 64975 && $n < 64992) or $n == 65534 or $n == 65535 or $n > 1114111))){
return ($C['and_mark'] ? "\x06" : '&'). "amp;#{$t};";
}
return ($C['and_mark'] ? "\x06" : '&'). '#'. (((ctype_digit($t) && $C['hexdec_entity'] < 2) or !$C['hexdec_entity']) ? $n : 'x'. dechex($n)). ';';
// eof
}
function hl_prot($p, $c=null){
// check URL scheme
global $C;
$b = $a = '';
if($c == null){$c = 'style'; $b = $p[1]; $a = $p[3]; $p = trim($p[2]);}
$c = isset($C['schemes'][$c]) ? $C['schemes'][$c] : $C['schemes']['*'];
if(isset($c['*']) or !strcspn($p, '#?;')){return "{$b}{$p}{$a}";} // All ok, frag, query, param
if(preg_match('`^([a-z\d\-+.&#; ]+?)(:|&#(58|x3a);|%3a|\\\\0{0,4}3a).`i', $p, $m) && !isset($c[strtolower($m[1])])){ // Denied prot
return "{$b}denied:{$p}{$a}";
}
if($C['abs_url']){
if($C['abs_url'] == -1 && strpos($p, $C['base_url']) === 0){ // Make url rel
$p = substr($p, strlen($C['base_url']));
}elseif(empty($m[1])){ // Make URL abs
if(substr($p, 0, 2) == '//'){$p = substr($C['base_url'], 0, strpos($C['base_url'], ':')+1). $p;}
elseif($p[0] == '/'){$p = preg_replace('`(^.+?://[^/]+)(.*)`', '$1', $C['base_url']). $p;}
elseif(strcspn($p, './')){$p = $C['base_url']. $p;}
else{
preg_match('`^([a-zA-Z\d\-+.]+://[^/]+)(.*)`', $C['base_url'], $m);
$p = preg_replace('`(?<=/)\./`', '', $m[2]. $p);
while(preg_match('`(?<=/)([^/]{3,}|[^/.]+?|\.[^/.]|[^/.]\.)/\.\./`', $p)){
$p = preg_replace('`(?<=/)([^/]{3,}|[^/.]+?|\.[^/.]|[^/.]\.)/\.\./`', '', $p);
}
$p = $m[1]. $p;
}
}
}
return "{$b}{$p}{$a}";
// eof
}
function hl_regex($p){
// ?regex
if(empty($p)){return 0;}
if($t = ini_get('track_errors')){$o = isset($php_errormsg) ? $php_errormsg : null;}
else{ini_set('track_errors', 1);}
unset($php_errormsg);
if(($d = ini_get('display_errors'))){ini_set('display_errors', 0);}
preg_match($p, '');
if($d){ini_set('display_errors', 1);}
$r = isset($php_errormsg) ? 0 : 1;
if($t){$php_errormsg = isset($o) ? $o : null;}
else{ini_set('track_errors', 0);}
return $r;
// eof
}
function hl_spec($t){
// final $spec
$s = array();
$t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace('/"(?>(`.|[^"])*)"/sme', 'substr(str_replace(array(";", "|", "~", " ", ",", "/", "(", ")", \'`"\'), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\""), "$0"), 1, -1)', trim($t))); // ' "
for($i = count(($t = explode(';', $t))); --$i>=0;){
$w = $t[$i];
if(empty($w) or ($e = strpos($w, '=')) === false or !strlen(($a = substr($w, $e+1)))){continue;}
$y = $n = array();
foreach(explode(',', $a) as $v){
if(!preg_match('`^([a-z:\-\*]+)(?:\((.*?)\))?`i', $v, $m)){continue;}
if(($x = strtolower($m[1])) == '-*'){$n['*'] = 1; continue;}
if($x[0] == '-'){$n[substr($x, 1)] = 1; continue;}
if(!isset($m[2])){$y[$x] = 1; continue;}
foreach(explode('/', $m[2]) as $m){
if(empty($m) or ($p = strpos($m, '=')) == 0 or $p < 5){$y[$x] = 1; continue;}
$y[$x][strtolower(substr($m, 0, $p))] = str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08"), array(";", "|", "~", " ", ",", "/", "(", ")"), substr($m, $p+1));
}
if(isset($y[$x]['match']) && !hl_regex($y[$x]['match'])){unset($y[$x]['match']);}
if(isset($y[$x]['nomatch']) && !hl_regex($y[$x]['nomatch'])){unset($y[$x]['nomatch']);}
}
if(!count($y) && !count($n)){continue;}
if(!isset($n['*'])){
foreach($y as $k=>$v){
if(!is_array($v) or !count($v)){unset($y[$k]);}
}
}
foreach(explode(',', substr($w, 0, $e)) as $v){
if(!strlen(($v = strtolower($v)))){continue;}
if(count($y)){$s[$v] = $y;}
if(count($n)){$s[$v]['n'] = $n;}
}
}
return $s;
// eof
}
function hl_tag($t){
// tag/attribute handler
global $C;
$t = $t[0];
// invalid < >
if($t == '< '){return '&lt; ';}
if($t == '>'){return '&gt;';}
if(!preg_match('`^<(/?)([a-zA-Z][a-zA-Z1-6]*)([^>]*?)\s?>$`m', $t, $m)){
return str_replace(array('<', '>'), array('&lt;', '&gt;'), $t);
}elseif(!isset($C['elements'][($e = strtolower($m[2]))])){
return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('&lt;', '&gt;'), $t) : '');
}
// attr string
$a = str_replace(array("\xad", "\n", "\r", "\t"), ' ', trim($m[3]));
if(strpos($a, '&') !== false){
str_replace(array('&#xad;', '&#173;', '&shy;'), ' ', $a);
}
// tag transform
static $eD = array('applet'=>1, 'center'=>1, 'dir'=>1, 'embed'=>1, 'font'=>1, 'isindex'=>1, 'menu'=>1, 's'=>1, 'strike'=>1, 'u'=>1); // Deprecated
if($C['make_tag_strict'] && isset($eD[$e])){
$trt = hl_tag2($e, $a, $C['make_tag_strict']);
if(!$e){return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('&lt;', '&gt;'), $t) : '');}
}
// close tag
static $eE = array('area'=>1, 'br'=>1, 'col'=>1, 'embed'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'isindex'=>1, 'param'=>1); // Empty ele
if(!empty($m[1])){
return (!isset($eE[$e]) ? "</$e>" : (($C['keep_bad'])%2 ? str_replace(array('<', '>'), array('&lt;', '&gt;'), $t) : ''));
}
// open tag & attr
static $aN = array('abbr'=>array('td'=>1, 'th'=>1), 'accept-charset'=>array('form'=>1), 'accept'=>array('form'=>1, 'input'=>1), 'accesskey'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'legend'=>1, 'textarea'=>1), 'action'=>array('form'=>1), 'align'=>array('caption'=>1, 'embed'=>1, 'applet'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'legend'=>1, 'table'=>1, 'hr'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'p'=>1, 'col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'alt'=>array('applet'=>1, 'area'=>1, 'img'=>1, 'input'=>1), 'archive'=>array('applet'=>1, 'object'=>1), 'axis'=>array('td'=>1, 'th'=>1), 'bgcolor'=>array('embed'=>1, 'table'=>1, 'tr'=>1, 'td'=>1, 'th'=>1), 'border'=>array('table'=>1, 'img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'cellpadding'=>array('table'=>1), 'cellspacing'=>array('table'=>1), 'char'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charoff'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charset'=>array('a'=>1, 'script'=>1), 'checked'=>array('input'=>1), 'cite'=>array('blockquote'=>1, 'q'=>1, 'del'=>1, 'ins'=>1), 'classid'=>array('object'=>1), 'clear'=>array('br'=>1), 'code'=>array('applet'=>1), 'codebase'=>array('object'=>1, 'applet'=>1), 'codetype'=>array('object'=>1), 'color'=>array('font'=>1), 'cols'=>array('textarea'=>1), 'colspan'=>array('td'=>1, 'th'=>1), 'compact'=>array('dir'=>1, 'dl'=>1, 'menu'=>1, 'ol'=>1, 'ul'=>1), 'coords'=>array('area'=>1, 'a'=>1), 'data'=>array('object'=>1), 'datetime'=>array('del'=>1, 'ins'=>1), 'declare'=>array('object'=>1), 'defer'=>array('script'=>1), 'dir'=>array('bdo'=>1), 'disabled'=>array('button'=>1, 'input'=>1, 'optgroup'=>1, 'option'=>1, 'select'=>1, 'textarea'=>1), 'enctype'=>array('form'=>1), 'face'=>array('font'=>1), 'for'=>array('label'=>1), 'frame'=>array('table'=>1), 'frameborder'=>array('iframe'=>1), 'headers'=>array('td'=>1, 'th'=>1), 'height'=>array('embed'=>1, 'iframe'=>1, 'td'=>1, 'th'=>1, 'img'=>1, 'object'=>1, 'applet'=>1), 'href'=>array('a'=>1, 'area'=>1), 'hreflang'=>array('a'=>1), 'hspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'ismap'=>array('img'=>1, 'input'=>1), 'label'=>array('option'=>1, 'optgroup'=>1), 'language'=>array('script'=>1), 'longdesc'=>array('img'=>1, 'iframe'=>1), 'marginheight'=>array('iframe'=>1), 'marginwidth'=>array('iframe'=>1), 'maxlength'=>array('input'=>1), 'method'=>array('form'=>1), 'model'=>array('embed'=>1), 'multiple'=>array('select'=>1), 'name'=>array('button'=>1, 'embed'=>1, 'textarea'=>1, 'applet'=>1, 'select'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'a'=>1, 'input'=>1, 'object'=>1, 'map'=>1, 'param'=>1), 'nohref'=>array('area'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'object'=>array('applet'=>1), 'onblur'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onchange'=>array('input'=>1, 'select'=>1, 'textarea'=>1), 'onfocus'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onreset'=>array('form'=>1), 'onselect'=>array('input'=>1, 'textarea'=>1), 'onsubmit'=>array('form'=>1), 'pluginspage'=>array('embed'=>1), 'pluginurl'=>array('embed'=>1), 'prompt'=>array('isindex'=>1), 'readonly'=>array('textarea'=>1, 'input'=>1), 'rel'=>array('a'=>1), 'rev'=>array('a'=>1), 'rows'=>array('textarea'=>1), 'rowspan'=>array('td'=>1, 'th'=>1), 'rules'=>array('table'=>1), 'scope'=>array('td'=>1, 'th'=>1), 'scrolling'=>array('iframe'=>1), 'selected'=>array('option'=>1), 'shape'=>array('area'=>1, 'a'=>1), 'size'=>array('hr'=>1, 'font'=>1, 'input'=>1, 'select'=>1), 'span'=>array('col'=>1, 'colgroup'=>1), 'src'=>array('embed'=>1, 'script'=>1, 'input'=>1, 'iframe'=>1, 'img'=>1), 'standby'=>array('object'=>1), 'start'=>array('ol'=>1), 'summary'=>array('table'=>1), 'tabindex'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'object'=>1, 'select'=>1, 'textarea'=>1), 'target'=>array('a'=>1, 'area'=>1, 'form'=>1), 'type'=>array('a'=>1, 'embed'=>1, 'object'=>1, 'param'=>1, 'script'=>1, 'input'=>1, 'li'=>1, 'ol'=>1, 'ul'=>1, 'button'=>1), 'usemap'=>array('img'=>1, 'input'=>1, 'object'=>1), 'valign'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'value'=>array('input'=>1, 'option'=>1, 'param'=>1, 'button'=>1, 'li'=>1), 'valuetype'=>array('param'=>1), 'vspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'width'=>array('embed'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'object'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'applet'=>1, 'col'=>1, 'colgroup'=>1, 'pre'=>1), 'wmode'=>array('embed'=>1), 'xml:space'=>array('pre'=>1, 'script'=>1, 'style'=>1)); // Ele-specific
static $aNE = array('checked'=>1, 'compact'=>1, 'declare'=>1, 'defer'=>1, 'disabled'=>1, 'ismap'=>1, 'multiple'=>1, 'nohref'=>1, 'noresize'=>1, 'noshade'=>1, 'nowrap'=>1, 'readonly'=>1, 'selected'=>1); // Empty
static $aNP = array('action'=>1, 'cite'=>1, 'classid'=>1, 'codebase'=>1, 'data'=>1, 'href'=>1, 'longdesc'=>1, 'model'=>1, 'pluginspage'=>1, 'pluginurl'=>1, 'usemap'=>1); // Need scheme check; excludes style, on* & src
static $aNU = array('class'=>array('param'=>1, 'script'=>1), 'dir'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'id'=>array('script'=>1), 'lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'xml:lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'onclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'ondblclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeydown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeypress'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeyup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousedown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousemove'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseout'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseover'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'style'=>array('param'=>1, 'script'=>1), 'title'=>array('param'=>1, 'script'=>1)); // Univ & exceptions
if($C['lc_std_val']){
// predef attr vals for $eAL & $aNE ele
static $aNL = array('all'=>1, 'baseline'=>1, 'bottom'=>1, 'button'=>1, 'center'=>1, 'char'=>1, 'checkbox'=>1, 'circle'=>1, 'col'=>1, 'colgroup'=>1, 'cols'=>1, 'data'=>1, 'default'=>1, 'file'=>1, 'get'=>1, 'groups'=>1, 'hidden'=>1, 'image'=>1, 'justify'=>1, 'left'=>1, 'ltr'=>1, 'middle'=>1, 'none'=>1, 'object'=>1, 'password'=>1, 'poly'=>1, 'post'=>1, 'preserve'=>1, 'radio'=>1, 'rect'=>1, 'ref'=>1, 'reset'=>1, 'right'=>1, 'row'=>1, 'rowgroup'=>1, 'rows'=>1, 'rtl'=>1, 'submit'=>1, 'text'=>1, 'top'=>1);
static $eAL = array('a'=>1, 'area'=>1, 'bdo'=>1, 'button'=>1, 'col'=>1, 'form'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'optgroup'=>1, 'option'=>1, 'param'=>1, 'script'=>1, 'select'=>1, 'table'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1, 'xml:space'=>1);
$lcase = isset($eAL[$e]) ? 1 : 0;
}
$depTr = 0;
if($C['no_deprecated_attr']){
// dep attr:applicable ele
static $aND = array('align'=>array('caption'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'img'=>1, 'input'=>1, 'legend'=>1, 'object'=>1, 'p'=>1, 'table'=>1), 'bgcolor'=>array('table'=>1, 'td'=>1, 'th'=>1, 'tr'=>1), 'border'=>array('img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'clear'=>array('br'=>1), 'compact'=>array('dl'=>1, 'ol'=>1, 'ul'=>1), 'height'=>array('td'=>1, 'th'=>1), 'hspace'=>array('img'=>1, 'object'=>1), 'language'=>array('script'=>1), 'name'=>array('a'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'map'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'size'=>array('hr'=>1), 'start'=>array('ol'=>1), 'type'=>array('li'=>1, 'ol'=>1, 'ul'=>1), 'value'=>array('li'=>1), 'vspace'=>array('img'=>1, 'object'=>1), 'width'=>array('hr'=>1, 'pre'=>1, 'td'=>1, 'th'=>1));
static $eAD = array('a'=>1, 'br'=>1, 'caption'=>1, 'div'=>1, 'dl'=>1, 'form'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'legend'=>1, 'li'=>1, 'map'=>1, 'object'=>1, 'ol'=>1, 'p'=>1, 'pre'=>1, 'script'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'tr'=>1, 'ul'=>1);
$depTr = isset($eAD[$e]) ? 1 : 0;
}
// attr name-vals
if(strpos($a, "\x01") !== false){$a = preg_replace('`\x01[^\x01]*\x01`', '', $a);} // No comment/CDATA sec
$mode = 0; $a = trim($a, ' /'); $aA = array();
while(strlen($a)){
$w = 0;
switch($mode){
case 0: // Name
if(preg_match('`^[a-zA-Z][\-a-zA-Z:]+`', $a, $m)){
$nm = strtolower($m[0]);
$w = $mode = 1; $a = ltrim(substr_replace($a, '', 0, strlen($m[0])));
}
break; case 1:
if($a[0] == '='){ // =
$w = 1; $mode = 2; $a = ltrim($a, '= ');
}
else { // No val
$w = 1; $mode = 0; $a = ltrim($a);
$aA[$nm] = '';
}
break; case 2: // Val
if(preg_match('`^"[^"]*"`', $a, $m) or preg_match("`^'[^']*'`", $a, $m) or preg_match("`^\s*[^\s\"']+`", $a, $m)){
$m = $m[0]; $w = 1; $mode = 0; $a = ltrim(substr_replace($a, '', 0, strlen($m)));
$aA[$nm] = trim(($m[0] == '"' or $m[0] == '\'') ? substr($m, 1, -1) : $m);
}
break;
}
if($w == 0){ // Parse errs, deal with space, " & '
$a = preg_replace('`^(?:"[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*`', '', $a);
$mode = 0;
}
}
if($mode == 1){$aA[$nm] = '';}
// clean attrs
global $S;
$rl = isset($S[$e]) ? $S[$e] : array();
$a = array(); $nfr = 0;
foreach($aA as $k=>$v){
if((!isset($C['deny_attribute'][$k]) or isset($rl[$k])) && ((!isset($rl['n'][$k]) && !isset($rl['n']['*'])) or isset($rl[$k])) && (isset($aN[$k][$e]) or (isset($aNU[$k]) && !isset($aNU[$k][$e])))){
if(isset($aNE[$k])){$v = $k;}
elseif(!empty($lcase) && (($e != 'button' or $e != 'input') or $k == 'type')){ // Rather loose but ?not cause issues
$v = (isset($aNL[($v2 = strtolower($v))])) ? $v2 : $v;
}
if($k == 'style' && !$C['style_pass']){
if(false !== strpos($v, '&#')){
static $sC = array('&#x20;'=>' ', '&#32;'=>' ', '&#x45;'=>'e', '&#69;'=>'e', '&#x65;'=>'e', '&#101;'=>'e', '&#x58;'=>'x', '&#88;'=>'x', '&#x78;'=>'x', '&#120;'=>'x', '&#x50;'=>'p', '&#80;'=>'p', '&#x70;'=>'p', '&#112;'=>'p', '&#x53;'=>'s', '&#83;'=>'s', '&#x73;'=>'s', '&#115;'=>'s', '&#x49;'=>'i', '&#73;'=>'i', '&#x69;'=>'i', '&#105;'=>'i', '&#x4f;'=>'o', '&#79;'=>'o', '&#x6f;'=>'o', '&#111;'=>'o', '&#x4e;'=>'n', '&#78;'=>'n', '&#x6e;'=>'n', '&#110;'=>'n', '&#x55;'=>'u', '&#85;'=>'u', '&#x75;'=>'u', '&#117;'=>'u', '&#x52;'=>'r', '&#82;'=>'r', '&#x72;'=>'r', '&#114;'=>'r', '&#x4c;'=>'l', '&#76;'=>'l', '&#x6c;'=>'l', '&#108;'=>'l', '&#x28;'=>'(', '&#40;'=>'(', '&#x29;'=>')', '&#41;'=>')', '&#x20;'=>':', '&#32;'=>':', '&#x22;'=>'"', '&#34;'=>'"', '&#x27;'=>"'", '&#39;'=>"'", '&#x2f;'=>'/', '&#47;'=>'/', '&#x2a;'=>'*', '&#42;'=>'*', '&#x5c;'=>'\\', '&#92;'=>'\\');
$v = strtr($v, $sC);
}
$v = preg_replace_callback('`(url(?:\()(?: )*(?:\'|"|&(?:quot|apos);)?)(.+)((?:\'|"|&(?:quot|apos);)?(?: )*(?:\)))`iS', 'hl_prot', $v);
$v = !$C['css_expression'] ? preg_replace('`expression`i', ' ', preg_replace('`\\\\\S|(/|(%2f))(\*|(%2a))`i', ' ', $v)) : $v;
}elseif(isset($aNP[$k]) or strpos($k, 'src') !== false or $k[0] == 'o'){
$v = hl_prot($v, $k);
if($k == 'href'){ // X-spam
if($C['anti_mail_spam'] && strpos($v, 'mailto:') === 0){
$v = str_replace('@', htmlspecialchars($C['anti_mail_spam']), $v);
}elseif($C['anti_link_spam']){
$r1 = $C['anti_link_spam'][1];
if(!empty($r1) && preg_match($r1, $v)){continue;}
$r0 = $C['anti_link_spam'][0];
if(!empty($r0) && preg_match($r0, $v)){
if(isset($a['rel'])){
if(!preg_match('`\bnofollow\b`i', $a['rel'])){$a['rel'] .= ' nofollow';}
}elseif(isset($aA['rel'])){
if(!preg_match('`\bnofollow\b`i', $aA['rel'])){$nfr = 1;}
}
else{
$a['rel'] = 'nofollow';
}
}
}
}
}
if(isset($rl[$k]) && is_array($rl[$k]) && ($v = hl_attrval($v, $rl[$k])) === 0){continue;}
$a[$k] = str_replace('"', '&quot;', $v);
}
}
if($nfr){$a['rel'] = isset($a['rel']) ? $a['rel']. ' nofollow' : 'nofollow';}
// rqd attr
static $eAR = array('area'=>array('alt'=>'area'), 'bdo'=>array('dir'=>'ltr'), 'form'=>array('action'=>''), 'img'=>array('src'=>'', 'alt'=>'image'), 'map'=>array('name'=>''), 'optgroup'=>array('label'=>''), 'param'=>array('name'=>''), 'script'=>array('type'=>'text/javascript'), 'textarea'=>array('rows'=>'10', 'cols'=>'50'));
if(isset($eAR[$e])){
foreach($eAR[$e] as $k=>$v){
if(!isset($a[$k])){$a[$k] = isset($v[0]) ? $v : $k;}
}
}
// depr attrs
if($depTr){
$c = array();
foreach($a as $k=>$v){
if($k == 'style' or !isset($aND[$k][$e])){continue;}
if($k == 'align'){
unset($a['align']);
if($e == 'img' && ($v == 'left' or $v == 'right')){$c[] = 'float: '. $v;}
elseif(($e == 'div' or $e == 'table') && $v == 'center'){$c[] = 'margin: auto';}
else{$c[] = 'text-align: '. $v;}
}elseif($k == 'bgcolor'){
unset($a['bgcolor']);
$c[] = 'background-color: '. $v;
}elseif($k == 'border'){
unset($a['border']); $c[] = "border: {$v}px";
}elseif($k == 'bordercolor'){
unset($a['bordercolor']); $c[] = 'border-color: '. $v;
}elseif($k == 'clear'){
unset($a['clear']); $c[] = 'clear: '. ($v != 'all' ? $v : 'both');
}elseif($k == 'compact'){
unset($a['compact']); $c[] = 'font-size: 85%';
}elseif($k == 'height' or $k == 'width'){
unset($a[$k]); $c[] = $k. ': '. ($v[0] != '*' ? $v. (ctype_digit($v) ? 'px' : '') : 'auto');
}elseif($k == 'hspace'){
unset($a['hspace']); $c[] = "margin-left: {$v}px; margin-right: {$v}px";
}elseif($k == 'language' && !isset($a['type'])){
unset($a['language']);
$a['type'] = 'text/'. strtolower($v);
}elseif($k == 'name'){
if($C['no_deprecated_attr'] == 2 or ($e != 'a' && $e != 'map')){unset($a['name']);}
if(!isset($a['id']) && preg_match('`[a-zA-Z][a-zA-Z\d.:_\-]*`', $v)){$a['id'] = $v;}
}elseif($k == 'noshade'){
unset($a['noshade']); $c[] = 'border-style: none; border: 0; background-color: gray; color: gray';
}elseif($k == 'nowrap'){
unset($a['nowrap']); $c[] = 'white-space: nowrap';
}elseif($k == 'size'){
unset($a['size']); $c[] = 'size: '. $v. 'px';
}elseif($k == 'start' or $k == 'value'){
unset($a[$k]);
}elseif($k == 'type'){
unset($a['type']);
static $ol_type = array('i'=>'lower-roman', 'I'=>'upper-roman', 'a'=>'lower-latin', 'A'=>'upper-latin', '1'=>'decimal');
$c[] = 'list-style-type: '. (isset($ol_type[$v]) ? $ol_type[$v] : 'decimal');
}elseif($k == 'vspace'){
unset($a['vspace']); $c[] = "margin-top: {$v}px; margin-bottom: {$v}px";
}
}
if(count($c)){
$c = implode('; ', $c);
$a['style'] = isset($a['style']) ? rtrim($a['style'], ' ;'). '; '. $c. ';': $c. ';';
}
}
// unique ID
if($C['unique_ids'] && isset($a['id'])){
if(!preg_match('`^[A-Za-z][A-Za-z0-9_\-.:]*$`', ($id = $a['id'])) or (isset($GLOBALS['hl_Ids'][$id]) && $C['unique_ids'] == 1)){unset($a['id']);
}
else {
while(isset($GLOBALS['hl_Ids'][$id])){$id = $C['unique_ids']. $id;}
$GLOBALS['hl_Ids'][($a['id'] = $id)] = 1;
}
}
// xml:lang
if($C['xml:lang'] && isset($a['lang'])){
$a['xml:lang'] = isset($a['xml:lang']) ? $a['xml:lang'] : $a['lang'];
if($C['xml:lang'] == 2){unset($a['lang']);}
}
// for transformed tag
if(!empty($trt)){
$a['style'] = isset($a['style']) ? rtrim($a['style'], ' ;'). '; '. $trt : $trt;
}
// return with empty ele /
if(empty($C['hook_tag'])){
$aA = '';
foreach($a as $k=>$v){$aA .= " {$k}=\"{$v}\"";}
return "<{$e}{$aA}". (isset($eE[$e]) ? ' /' : ''). '>';
}
else{return $C['hook_tag']($e, $a);}
// eof
}
function hl_tag2(&$e, &$a, $t=1){
// transform tag
if($e == 'center'){$e = 'div'; return 'text-align: center;';}
if($e == 'dir' or $e == 'menu'){$e = 'ul'; return '';}
if($e == 's' or $e == 'strike'){$e = 'span'; return 'text-decoration: line-through;';}
if($e == 'u'){$e = 'span'; return 'text-decoration: underline;';}
static $fs = array('0'=>'xx-small', '1'=>'xx-small', '2'=>'small', '3'=>'medium', '4'=>'large', '5'=>'x-large', '6'=>'xx-large', '7'=>'300%', '-1'=>'smaller', '-2'=>'60%', '+1'=>'larger', '+2'=>'150%', '+3'=>'200%', '+4'=>'300%');
if($e == 'font'){
$a2 = '';
if(preg_match('`face\s*=\s*(\'|")([^=]+?)\\1`i', $a, $m) or preg_match('`face\s*=\s*([^"])(\S+)`i', $a, $m)){
$a2 .= ' font-family: '. str_replace('"', '\'', trim($m[2])). ';';
}
if(preg_match('`color\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m)){
$a2 .= ' color: '. trim($m[2]). ';';
}
if(preg_match('`size\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m) && isset($fs[($m = trim($m[2]))])){
$a2 .= ' font-size: '. $fs[$m]. ';';
}
$e = 'span'; return ltrim($a2);
}
if($t == 2){$e = 0; return 0;}
return '';
// eof
}
function hl_tidy($t, $w, $p){
// Tidy/compact HTM
if(strpos(' pre,script,textarea', "$p,")){return $t;}
$t = str_replace(' </', '</', preg_replace(array('`(<\w[^>]*(?<!/)>)\s+`', '`\s+`', '`(<\w[^>]*(?<!/)>) `'), array(' $1', ' ', '$1'), preg_replace_callback(array('`(<(!\[CDATA\[))(.+?)(\]\]>)`sm', '`(<(!--))(.+?)(-->)`sm', '`(<(pre|script|textarea).*?>)(.+?)(</\2>)`sm'), create_function('$m', 'return $m[1]. str_replace(array("<", ">", "\n", "\r", "\t", " "), array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), $m[3]). $m[4];'), $t)));
if(($w = strtolower($w)) == -1){
return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array('<', '>', "\n", "\r", "\t", ' '), $t);
}
$s = strpos(" $w", 't') ? "\t" : ' ';
$s = preg_match('`\d`', $w, $m) ? str_repeat($s, $m[0]) : str_repeat($s, ($s == "\t" ? 1 : 2));
$n = preg_match('`[ts]([1-9])`', $w, $m) ? $m[1] : 0;
$a = array('br'=>1);
$b = array('button'=>1, 'input'=>1, 'option'=>1);
$c = array('caption'=>1, 'dd'=>1, 'dt'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'isindex'=>1, 'label'=>1, 'legend'=>1, 'li'=>1, 'object'=>1, 'p'=>1, 'pre'=>1, 'td'=>1, 'textarea'=>1, 'th'=>1);
$d = array('address'=>1, 'blockquote'=>1, 'center'=>1, 'colgroup'=>1, 'dir'=>1, 'div'=>1, 'dl'=>1, 'fieldset'=>1, 'form'=>1, 'hr'=>1, 'iframe'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'ol'=>1, 'optgroup'=>1, 'rbc'=>1, 'rtc'=>1, 'ruby'=>1, 'script'=>1, 'select'=>1, 'table'=>1, 'tfoot'=>1, 'thead'=>1, 'tr'=>1, 'ul'=>1);
$o = "";
if(isset($d[$p])){$o .= str_repeat($s, ++$n);}
$t = explode('<', $t);
$o .= ltrim(array_shift($t));
for($i=-1, $j=count($t); ++$i<$j;){
$r = ''; list($e, $r) = explode('>', $t[$i]);
$x = $e[0] == '/' ? 0 : (substr($e, -1) == '/' ? 1 : ($e[0] != '!' ? 2 : -1));
$y = !$x ? ltrim($e, '/') : ($x > 0 ? substr($e, 0, strcspn($e, ' ')) : 0);
$e = "<$e>";
if(isset($d[$y])){
if(!$x){$o .= "\n".str_repeat($s, --$n)."$e\n".str_repeat($s, $n);}
else{$o .= "\n".str_repeat($s, $n)."$e\n".str_repeat($s, ($x != 1 ? ++$n : $n));}
$o .= ltrim($r); continue;
}
$f = "\n". str_repeat($s, $n);
if(isset($c[$y])){
if(!$x){$o .= $e.$f.ltrim($r);}
else{$o .= $f.$e.$r;}
}elseif(isset($b[$y])){$o .= $f.$e.$r;
}elseif(isset($a[$y])){$o .= $e.$f.ltrim($r);
}elseif(!$y){$o .= $f.$e.$f.ltrim($r);
}
else {
$o .= $e.$r;}
}
$t = preg_replace('`[\n]\s*?[\n]+`', "\n", $o);
if(($l = strpos(" $w", 'r') ? (strpos(" $w", 'n') ? "\r\n" : "\r") : 0)){
$t = str_replace("\n", $l, $t);
}
return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array('<', '>', "\n", "\r", "\t", ' '), $t);
// eof
}
function hl_version(){
// rel
return '1.1.7.2';
// eof
}
function kses($t, $h, $p=array('http', 'https', 'ftp', 'news', 'nntp', 'telnet', 'gopher', 'mailto')){
// kses compat
foreach($h as $k=>$v){
$h[$k]['n']['*'] = 1;
}
$C['cdata'] = $C['comment'] = $C['make_tag_strict'] = $C['no_deprecated_attr'] = $C['unique_ids'] = 0;
$C['keep_bad'] = 1;
$C['elements'] = count($h) ? strtolower(implode(',', array_keys($h))) : '-*';
$C['hook'] = 'kses_hook';
$C['schemes'] = '*:'. implode(',', $p);
return htmLawed($t, $C, $h);
// eof
}
function kses_hook($t, &$C, &$S){
// kses compat
return $t;
// eof
}
function htmLawed($t, $C=1, $S=array()){
$C = is_array($C) ? $C : array();
if(!empty($C['valid_xhtml'])){
$C['elements'] = empty($C['elements']) ? '*-center-dir-font-isindex-menu-s-strike-u' : $C['elements'];
$C['make_tag_strict'] = isset($C['make_tag_strict']) ? $C['make_tag_strict'] : 2;
$C['xml:lang'] = isset($C['xml:lang']) ? $C['xml:lang'] : 2;
}
// config eles
$e = array('a'=>1, 'abbr'=>1, 'acronym'=>1, 'address'=>1, 'applet'=>1, 'area'=>1, 'b'=>1, 'bdo'=>1, 'big'=>1, 'blockquote'=>1, 'br'=>1, 'button'=>1, 'caption'=>1, 'center'=>1, 'cite'=>1, 'code'=>1, 'col'=>1, 'colgroup'=>1, 'dd'=>1, 'del'=>1, 'dfn'=>1, 'dir'=>1, 'div'=>1, 'dl'=>1, 'dt'=>1, 'em'=>1, 'embed'=>1, 'fieldset'=>1, 'font'=>1, 'form'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'hr'=>1, 'i'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'ins'=>1, 'isindex'=>1, 'kbd'=>1, 'label'=>1, 'legend'=>1, 'li'=>1, 'map'=>1, 'menu'=>1, 'noscript'=>1, 'object'=>1, 'ol'=>1, 'optgroup'=>1, 'option'=>1, 'p'=>1, 'param'=>1, 'pre'=>1, 'q'=>1, 'rb'=>1, 'rbc'=>1, 'rp'=>1, 'rt'=>1, 'rtc'=>1, 'ruby'=>1, 's'=>1, 'samp'=>1, 'script'=>1, 'select'=>1, 'small'=>1, 'span'=>1, 'strike'=>1, 'strong'=>1, 'sub'=>1, 'sup'=>1, 'table'=>1, 'tbody'=>1, 'td'=>1, 'textarea'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1, 'tt'=>1, 'u'=>1, 'ul'=>1, 'var'=>1); // 86/deprecated+embed+ruby
if(!empty($C['safe'])){
unset($e['applet'], $e['embed'], $e['iframe'], $e['object'], $e['script']);
}
$x = !empty($C['elements']) ? str_replace(array("\n", "\r", "\t", ' '), '', $C['elements']) : '*';
if($x == '-*'){$e = array();}
elseif(strpos($x, '*') === false){$e = array_flip(explode(',', $x));}
else{
if(isset($x[1])){
preg_match_all('`(?:^|-|\+)[^\-+]+?(?=-|\+|$)`', $x, $m, PREG_SET_ORDER);
for($i=count($m); --$i>=0;){$m[$i] = $m[$i][0];}
foreach($m as $v){
if($v[0] == '+'){$e[substr($v, 1)] = 1;}
if($v[0] == '-' && isset($e[($v = substr($v, 1))]) && !in_array('+'. $v, $m)){unset($e[$v]);}
}
}
}
$C['elements'] =& $e;
// config attrs
$C['deny_attribute'] = !empty($C['deny_attribute']) ? array_flip(explode(',', str_replace(array("\n", "\r", "\t", ' '), '', $C['deny_attribute']. (!empty($C['safe']) ? ',on*' : '')))) : (!empty($C['safe']) ? array('on*'=>1) : array());
if(isset($C['deny_attribute']['on*'])){
unset($C['deny_attribute']['on*']);
$C['deny_attribute'] += array('onblur'=>1, 'onchange'=>1, 'onclick'=>1, 'ondblclick'=>1, 'onfocus'=>1, 'onkeydown'=>1, 'onkeypress'=>1, 'onkeyup'=>1, 'onmousedown'=>1, 'onmousemove'=>1, 'onmouseout'=>1, 'onmouseover'=>1, 'onmouseup'=>1, 'onreset'=>1, 'onselect'=>1, 'onsubmit'=>1);
}
// config URL
$x = (isset($C['schemes'][2]) && strpos($C['schemes'], ':')) ? strtolower($C['schemes']) : 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https';
$C['schemes'] = array();
foreach(explode(';', str_replace(array(' ', "\t", "\r", "\n"), '', $x)) as $v){
$x = $x2 = null; list($x, $x2) = explode(':', $v, 2);
if($x2){$C['schemes'][$x] = array_flip(explode(',', $x2));}
}
if(!isset($C['schemes']['*'])){$C['schemes']['*'] = array('file'=>1, 'http'=>1, 'https'=>1,);}
if(!empty($C['safe']) && empty($C['schemes']['style'])){$C['schemes']['style'] = array('nil'=>1);}
$C['abs_url'] = isset($C['abs_url']) ? $C['abs_url'] : 0;
if(!isset($C['base_url']) or !preg_match('`^[a-zA-Z\d.+\-]+://[^/]+/(.+?/)?$`', $C['base_url'])){
$C['base_url'] = $C['abs_url'] = 0;
}
// config rest
$C['and_mark'] = empty($C['and_mark']) ? 0 : 1;
$C['anti_link_spam'] = (isset($C['anti_link_spam']) && is_array($C['anti_link_spam']) && count($C['anti_link_spam']) == 2 && (empty($C['anti_link_spam'][0]) or hl_regex($C['anti_link_spam'][0])) && (empty($C['anti_link_spam'][1]) or hl_regex($C['anti_link_spam'][1]))) ? $C['anti_link_spam'] : 0;
$C['anti_mail_spam'] = isset($C['anti_mail_spam']) ? $C['anti_mail_spam'] : 0;
$C['balance'] = isset($C['balance']) ? (bool)$C['balance'] : 1;
$C['cdata'] = isset($C['cdata']) ? $C['cdata'] : (empty($C['safe']) ? 3 : 0);
$C['clean_ms_char'] = empty($C['clean_ms_char']) ? 0 : $C['clean_ms_char'];
$C['comment'] = isset($C['comment']) ? $C['comment'] : (empty($C['safe']) ? 3 : 0);
$C['css_expression'] = empty($C['css_expression']) ? 0 : 1;
$C['hexdec_entity'] = isset($C['hexdec_entity']) ? $C['hexdec_entity'] : 1;
$C['hook'] = (!empty($C['hook']) && function_exists($C['hook'])) ? $C['hook'] : 0;
$C['hook_tag'] = (!empty($C['hook_tag']) && function_exists($C['hook_tag'])) ? $C['hook_tag'] : 0;
$C['keep_bad'] = isset($C['keep_bad']) ? $C['keep_bad'] : 6;
$C['lc_std_val'] = isset($C['lc_std_val']) ? (bool)$C['lc_std_val'] : 1;
$C['make_tag_strict'] = isset($C['make_tag_strict']) ? $C['make_tag_strict'] : 1;
$C['named_entity'] = isset($C['named_entity']) ? (bool)$C['named_entity'] : 1;
$C['no_deprecated_attr'] = isset($C['no_deprecated_attr']) ? $C['no_deprecated_attr'] : 1;
$C['parent'] = isset($C['parent'][0]) ? strtolower($C['parent']) : 'body';
$C['show_setting'] = !empty($C['show_setting']) ? $C['show_setting'] : 0;
$C['style_pass'] = empty($C['style_pass']) ? 0 : 1;
$C['tidy'] = empty($C['tidy']) ? 0 : $C['tidy'];
$C['unique_ids'] = isset($C['unique_ids']) ? $C['unique_ids'] : 1;
$C['xml:lang'] = isset($C['xml:lang']) ? $C['xml:lang'] : 0;
if(isset($GLOBALS['C'])){$reC = $GLOBALS['C'];}
$GLOBALS['C'] = $C;
$S = is_array($S) ? $S : hl_spec($S);
if(isset($GLOBALS['S'])){$reS = $GLOBALS['S'];}
$GLOBALS['S'] = $S;
$t = preg_replace('`[\x00-\x08\x0b-\x0c\x0e-\x1f]`', '', $t);
if($C['clean_ms_char']){
$x = array("\x7f"=>'', "\x80"=>'&#8364;', "\x81"=>'', "\x83"=>'&#402;', "\x85"=>'&#8230;', "\x86"=>'&#8224;', "\x87"=>'&#8225;', "\x88"=>'&#710;', "\x89"=>'&#8240;', "\x8a"=>'&#352;', "\x8b"=>'&#8249;', "\x8c"=>'&#338;', "\x8d"=>'', "\x8e"=>'&#381;', "\x8f"=>'', "\x90"=>'', "\x95"=>'&#8226;', "\x96"=>'&#8211;', "\x97"=>'&#8212;', "\x98"=>'&#732;', "\x99"=>'&#8482;', "\x9a"=>'&#353;', "\x9b"=>'&#8250;', "\x9c"=>'&#339;', "\x9d"=>'', "\x9e"=>'&#382;', "\x9f"=>'&#376;');
$x = $x + ($C['clean_ms_char'] == 1 ? array("\x82"=>'&#8218;', "\x84"=>'&#8222;', "\x91"=>'&#8216;', "\x92"=>'&#8217;', "\x93"=>'&#8220;', "\x94"=>'&#8221;') : array("\x82"=>'\'', "\x84"=>'"', "\x91"=>'\'', "\x92"=>'\'', "\x93"=>'"', "\x94"=>'"'));
$t = strtr($t, $x);
}
if($C['cdata'] or $C['comment']){$t = preg_replace_callback('`<!(?:(?:--.*?--)|(?:\[CDATA\[.*?\]\]))>`sm', 'hl_cmtcd', $t);}
$t = preg_replace_callback('`&amp;([A-Za-z][A-Za-z0-9]{1,30}|#(?:[0-9]{1,8}|[Xx][0-9A-Fa-f]{1,7}));`', 'hl_ent', str_replace('&', '&amp;', $t));
if($C['unique_ids'] && !isset($GLOBALS['hl_Ids'])){$GLOBALS['hl_Ids'] = array();}
if($C['hook']){$t = $C['hook']($t, $C, $S);}
if($C['show_setting'] && preg_match('`^[a-z][a-z0-9_]*$`i', $C['show_setting'])){
$GLOBALS[$C['show_setting']] = array('config'=>$C, 'spec'=>$S, 'time'=>microtime());
}
// main
$t = preg_replace_callback('`<(?:(?:\s|$)|(?:[^>]*(?:>|$)))|>`m', 'hl_tag', $t);
$t = $C['balance'] ? hl_bal($t, $C['keep_bad'], $C['parent']) : $t;
$t = (($C['cdata'] or $C['comment']) && strpos($t, "\x01") !== false) ? str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05"), array('', '', '&', '<', '>'), $t) : $t;
$t = $C['tidy'] ? hl_tidy($t, $C['tidy'], $C['parent']) : $t;
unset($C, $e);
if(isset($reC)){$GLOBALS['C'] = $reC;}
if(isset($reS)){$GLOBALS['S'] = $reS;}
return $t;
// eof
}
?>

View File

@ -63,7 +63,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '6.0dev'; $version = '6.0dev';
$build = '150602'; $build = '150618';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);
@ -404,7 +404,8 @@ function adjust_paths_for_freebsd($engine, $connection = false) {
"update talert_commands set command = REPLACE(command,'/usr/bin','/usr/local/bin');", "update talert_commands set command = REPLACE(command,'/usr/bin','/usr/local/bin');",
"update talert_commands set command = REPLACE(command,'/usr/share', '/usr/local/share');", "update talert_commands set command = REPLACE(command,'/usr/share', '/usr/local/share');",
"update tplugin set execute = REPLACE(execute,'/usr/share','/usr/local/share');", "update tplugin set execute = REPLACE(execute,'/usr/share','/usr/local/share');",
"update tevent_response set target = REPLACE(target,'/usr/share','/usr/local/share');" "update tevent_response set target = REPLACE(target,'/usr/share','/usr/local/share');",
"insert into tconfig (token, value) VALUES ('graphviz_bin_dir', '/usr/local/bin');"
); );
for ($i = 0; $i < count ($adjust_sql); $i++) { for ($i = 0; $i < count ($adjust_sql); $i++) {
@ -1000,8 +1001,7 @@ function install_step4() {
check_generic ($step4, "Populating database"); check_generic ($step4, "Populating database");
if (PHP_OS == "FreeBSD") if (PHP_OS == "FreeBSD") {
{
$step_freebsd = adjust_paths_for_freebsd ($engine, $connection); $step_freebsd = adjust_paths_for_freebsd ($engine, $connection);
check_generic ($step_freebsd, "Adjusting paths in database for FreeBSD"); check_generic ($step_freebsd, "Adjusting paths in database for FreeBSD");
} }

View File

@ -416,8 +416,11 @@ class Modules {
foreach ($modules_db as $module) { foreach ($modules_db as $module) {
$row = array(); $row = array();
$row[0] = $row[__('Module name')] = $row[0] =
'<span class="data module_name">'.ui_print_truncate_text($module['module_name'], 30, false)."</span>"; $row[__('Module name')] =
'<span class="data module_name">' .
ui_print_truncate_text($module['module_name'], 30, false) .
"</span>";
if ($this->columns['agent']) { if ($this->columns['agent']) {
$row[1] = $row[__('Agent name')] = $row[1] = $row[__('Agent name')] =

View File

@ -374,10 +374,16 @@ if ($pure) {
// Filter form // Filter form
if ($print_agent) { if ($print_agent) {
if(defined('METACONSOLE')) { if(defined('METACONSOLE')) {
ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user), __('Show Options')); ui_toggle(
printFormFilterAlert($id_group, $filter, $free_search,
$url, $filter_standby, $tag_filter, true, $strict_user),
__('Show Options'));;
} }
else { else {
ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user), __('Alert control filter'), __('Toggle filter(s)')); ui_toggle(
printFormFilterAlert($id_group, $filter, $free_search,
$url, $filter_standby, $tag_filter, true, $strict_user),
__('Alert control filter'), __('Toggle filter(s)'));
} }
} }

View File

@ -59,17 +59,25 @@ if (isset ($_GET["agentmodule"]) && isset ($_GET["agent"]) ){
$to_date = date("U", strtotime($to_date)); $to_date = date("U", strtotime($to_date));
// Make the query // Make the query
$sql1="SELECT * FROM tdatos WHERE id_agente = $id_agent AND id_agente_modulo = $id_agentmodule"; $sql1="
SELECT *
FROM tdatos
WHERE id_agente = $id_agent
AND id_agente_modulo = $id_agentmodule";
$tipo = modules_get_moduletype_name (modules_get_agentmodule_type ($id_agentmodule)); $tipo = modules_get_moduletype_name (modules_get_agentmodule_type ($id_agentmodule));
if ($tipo == "generic_data_string") if ($tipo == "generic_data_string")
$sql1 = "SELECT * $sql1 = "
SELECT *
FROM tagente_datos_string FROM tagente_datos_string
WHERE utimestamp > $from_date AND utimestamp < $to_date AND id_agente_modulo = $id_agentmodule WHERE utimestamp > $from_date AND utimestamp < $to_date
AND id_agente_modulo = $id_agentmodule
ORDER BY utimestamp DESC"; ORDER BY utimestamp DESC";
else else
$sql1 = "SELECT * $sql1 = "
SELECT *
FROM tagente_datos FROM tagente_datos
WHERE utimestamp > $from_date AND utimestamp < $to_date AND id_agente_modulo = $id_agentmodule WHERE utimestamp > $from_date AND utimestamp < $to_date
AND id_agente_modulo = $id_agentmodule
ORDER BY utimestamp DESC"; ORDER BY utimestamp DESC";
$result1 = db_get_all_rows_sql ($sql1, true); $result1 = db_get_all_rows_sql ($sql1, true);
if ($result1 === false) { if ($result1 === false) {

View File

@ -177,7 +177,6 @@ var svg = d3.select("#dinamic_networkmap").append("svg")
.call(zoom_obj) .call(zoom_obj)
.append('svg:g') .append('svg:g')
///Added default zoom buttom ///Added default zoom buttom
d3.select("#dinamic_networkmap svg") d3.select("#dinamic_networkmap svg")
.append("g") .append("g")

View File

@ -341,13 +341,13 @@ $id = get_parameter('id');
case 'boolean': case 'boolean':
case 'sparse': case 'sparse':
$data = array(); $data = array();
$data[0] = __('Time compare') . ' (' . __('Overlapped') . ')'; $data[0] = __('Time compare (Overlapped)');
$data[1] = html_print_checkbox ("time_compare_overlapped", 1, (bool) $time_compare_overlapped, true); $data[1] = html_print_checkbox ("time_compare_overlapped", 1, (bool) $time_compare_overlapped, true);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
$data = array(); $data = array();
$data[0] = __('Time compare') . ' (' . __('Separated') . ')'; $data[0] = __('Time compare (Separated)');
$data[1] = html_print_checkbox ("time_compare_separated", 1, (bool) $time_compare_separated, true); $data[1] = html_print_checkbox ("time_compare_separated", 1, (bool) $time_compare_separated, true);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
@ -371,7 +371,7 @@ $id = get_parameter('id');
$table->class = 'databox'; $table->class = 'databox';
$data = array(); $data = array();
$data[0] = html_print_div(array('content' => $form_table, $data[0] = html_print_div(array('id' => 'field_list', 'content' => $form_table,
'style' => 'overflow: auto; height: 220px'), true); 'style' => 'overflow: auto; height: 220px'), true);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
@ -448,4 +448,12 @@ $id = get_parameter('id');
?> ?>
forced_title_callback(); forced_title_callback();
$(window).ready(function() {
$("#field_list").css('height', ($(window).height() - 160) + 'px');
});
$(window).resize(function() {
$("#field_list").css('height', ($(window).height() - 160) + 'px');
});
</script> </script>

View File

@ -100,7 +100,8 @@ if (!defined('METACONSOLE')){
$table->cellspacing = 0; $table->cellspacing = 0;
$table->cellpadding = 0; $table->cellpadding = 0;
$table->class = "databox filters"; $table->class = "databox filters";
}else{ }
else {
$filters = '<form class="filters_form" method="post" action="index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;refr=' . $refr . '&amp;ag_group=' . $filters = '<form class="filters_form" method="post" action="index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;refr=' . $refr . '&amp;ag_group=' .
$ag_group . '&amp;ag_freestring=' . $ag_freestring . '&amp;ag_modulename=' . $ag_modulename . '&amp;status=' . $status . '&amp;sort_field=' . $ag_group . '&amp;ag_freestring=' . $ag_freestring . '&amp;ag_modulename=' . $ag_modulename . '&amp;status=' . $status . '&amp;sort_field=' .
$sortField . '&amp;sort=' . $sort .'&amp;pure=' . $config['pure'] . $ag_custom_fields_params . '">'; $sortField . '&amp;sort=' . $sort .'&amp;pure=' . $config['pure'] . $ag_custom_fields_params . '">';
@ -242,9 +243,14 @@ if ($tag_filter !== 0) {
$groups = users_get_groups($config["id_user"]); $groups = users_get_groups($config["id_user"]);
if ($ag_group !== 0) { if ($ag_group !== 0) {
$sql_conditions_tags = tags_get_acl_tags($config['id_user'], $ag_group, 'AR', 'module_condition', 'AND', 'tagente_modulo', true, array(), true); $sql_conditions_tags = tags_get_acl_tags($config['id_user'],
$ag_group, 'AR', 'module_condition', 'AND', 'tagente_modulo',
true, array(), true);
} else { } else {
$sql_conditions_tags = tags_get_acl_tags($config['id_user'], array_keys($groups), 'AR', 'module_condition', 'AND', 'tagente_modulo', true, array(), true); $sql_conditions_tags = tags_get_acl_tags(
$config['id_user'], array_keys($groups), 'AR',
'module_condition', 'AND', 'tagente_modulo', true, array(),
true);
} }
if (is_numeric($sql_conditions_tags)) { if (is_numeric($sql_conditions_tags)) {
@ -530,7 +536,9 @@ foreach ($custom_fields as $custom_field) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$table->colspan[2][0] = 7; $table->colspan[2][0] = 7;
$table->data[2][0] = ui_toggle(html_print_table($table_custom_fields, true), __('Advanced Options'),'',true,true); $table->data[2][0] = ui_toggle(
html_print_table($table_custom_fields, true),
__('Advanced Options'), '', true, true);
$filters .= html_print_table($table, true); $filters .= html_print_table($table, true);
$filters .= "</form>"; $filters .= "</form>";
@ -1247,7 +1255,8 @@ foreach ($result as $row) {
$salida = format_numeric($row["datos"]); $salida = format_numeric($row["datos"]);
break; break;
} }
}else{ }
else {
$salida = format_numeric($row["datos"]); $salida = format_numeric($row["datos"]);
} }

View File

@ -295,7 +295,9 @@ if (check_acl ($config['id_user'], 0, "ER")) {
echo ui_get_full_url('operation/events/sound_events.php'); echo ui_get_full_url('operation/events/sound_events.php');
?>'; ?>';
window.open(url, '<?php __('Sound Alerts'); ?>','width=475, height=275, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no'); window.open(url,
'<?php __('Sound Alerts'); ?>',
'width=475, height=275, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no');
} }
</script> </script>
<?php <?php

View File

@ -180,7 +180,8 @@ enterprise_hook('open_meta_frame');
if (defined ('METACONSOLE')) { if (defined ('METACONSOLE')) {
$class = "databox data"; $class = "databox data";
}else{ }
else {
$class = "databox filters"; $class = "databox filters";
} }

View File

@ -103,7 +103,7 @@ if ($view_graph) {
include ("general/noaccess.php"); include ("general/noaccess.php");
exit; exit;
} }
html_print_input_hidden ('lineWidhtGraph', $config['custom_graph_widht']); html_print_input_hidden ('lineWidhtGraph', $config['custom_graph_width']);
$url = "index.php?" . $url = "index.php?" .
"sec=reporting&" . "sec=reporting&" .
"sec2=operation/reporting/graph_viewer&" . "sec2=operation/reporting/graph_viewer&" .

View File

@ -168,7 +168,11 @@ if($searchAlerts) {
break; break;
} }
$alertsraw = agents_get_alerts_simple ($agents, "all_enabled", array('offset' => get_parameter ('offset',0), 'limit' => $config['block_size'], 'order' => $order['field'] . " " . $order['order']), $whereAlerts); $alertsraw = agents_get_alerts_simple($agents, "all_enabled",
array('offset' => get_parameter ('offset', 0),
'limit' => $config['block_size'],
'order' => $order['field'] . " " . $order['order']),
$whereAlerts);
$stringSearchPHP = substr($stringSearchSQL,1,strlen($stringSearchSQL)-2); $stringSearchPHP = substr($stringSearchSQL,1,strlen($stringSearchSQL)-2);

View File

@ -183,7 +183,8 @@ if (defined('METACONSOLE')) {
echo "<div class='view_tree'>"; echo "<div class='view_tree'>";
ui_toggle($form_html, __('Show Options')); ui_toggle($form_html, __('Show Options'));
echo "<br>"; echo "<br>";
}else{ }
else {
//echo "<br>"; //echo "<br>";
ui_toggle($form_html, __('Tree search')); ui_toggle($form_html, __('Tree search'));
} }
@ -328,15 +329,29 @@ enterprise_hook('close_meta_frame');
period = $('#period').val(); period = $('#period').val();
params.selection_mode = $('input[name=selection_mode]:checked').val(); params.selection_mode = $('input[name=selection_mode]:checked').val();
if(!params.selection_mode){params.selection_mode='fromnow';} if (!params.selection_mode) {
params.selection_mode='fromnow';
}
params.date_from = $('#text-date_from').val(); params.date_from = $('#text-date_from').val();
if(!params.date_from){params.date_from = f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();} if (!params.date_from) {
params.date_from = f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();
}
params.time_from = $('#text-time_from').val(); params.time_from = $('#text-time_from').val();
if(!params.time_from){params.time_from = f.getHours() + ":" + f.getMinutes();} if (!params.time_from) {
params.time_from = f.getHours() + ":" + f.getMinutes();
}
params.date_to = $('#text-date_to').val(); params.date_to = $('#text-date_to').val();
if(!params.date_to){params.date_to =f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();} if (!params.date_to) {
params.date_to =f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();
}
params.time_to = $('#text-time_to').val(); params.time_to = $('#text-time_to').val();
if(!params.time_to){params.time_to = f.getHours() + ":" + f.getMinutes();} if (!params.time_to) {
params.time_to = f.getHours() + ":" + f.getMinutes();
}
params.page = "include/ajax/module"; params.page = "include/ajax/module";
params.get_module_detail = 1; params.get_module_detail = 1;

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150602 %define release 150618
%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

@ -193,7 +193,7 @@ INSERT INTO "tlanguage" VALUES ('ru','Русский');
INSERT INTO "tlanguage" VALUES ('sk','Slovenčina'); INSERT INTO "tlanguage" VALUES ('sk','Slovenčina');
INSERT INTO "tlanguage" VALUES ('tr','Türkçe'); INSERT INTO "tlanguage" VALUES ('tr','Türkçe');
INSERT INTO "tlanguage" VALUES ('zh_CN','简化字'); INSERT INTO "tlanguage" VALUES ('zh_CN','简化字');
INSERT INTO "tlanguage" VALUES ('ca','Čatalan'); INSERT INTO "tlanguage" VALUES ('ca','Catalan');
COMMIT WORK; COMMIT WORK;
-- --
@ -346,10 +346,10 @@ INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "t
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (201,'Free&#x20;RAM','Available&#x20;RAM&#x20;memory&#x20;in&#x20;bytes',16,1,0,0,300,0,'','','','SELECT&#x20;AvailableBytes&#x20;from&#x20;Win32_PerfRawData_PerfOS_Memory',1,6,0,'Administrator',NULL,NULL,10,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (201,'Free&#x20;RAM','Available&#x20;RAM&#x20;memory&#x20;in&#x20;bytes',16,1,0,0,300,0,'','','','SELECT&#x20;AvailableBytes&#x20;from&#x20;Win32_PerfRawData_PerfOS_Memory',1,6,0,'Administrator',NULL,NULL,10,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (202,'Windows&#x20;version','Operating&#x20;system&#x20;version',16,3,0,0,300,1,'','','','SELECT&#x20;Caption&#x20;FROM&#x20;Win32_OperatingSystem',1,6,0,'Administrator',NULL,NULL,10,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (202,'Windows&#x20;version','Operating&#x20;system&#x20;version',16,3,0,0,300,1,'','','','SELECT&#x20;Caption&#x20;FROM&#x20;Win32_OperatingSystem',1,6,0,'Administrator',NULL,NULL,10,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (203,'Free&#x20;RAM','Available&#x20;RAM&#x20;memory&#x20;in&#x20;bytes',16,1,0,0,300,0,'','','','SELECT&#x20;AvailableBytes&#x20;from&#x20;Win32_PerfRawData_PerfOS_Memory',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (203,'Free&#x20;RAM','Available&#x20;RAM&#x20;memory&#x20;in&#x20;bytes',16,1,0,0,300,0,'','','','SELECT&#x20;AvailableBytes&#x20;from&#x20;Win32_PerfRawData_PerfOS_Memory',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (204,'Hostname','The&#x20;hostname&#x20;of&#x20;the&#x20;machine.',16,3,0,0,300,0,'','','','ServerName&#x20;FROM&#x20;Win32_WindowsProductActivation',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (204,'Hostname','The&#x20;hostname&#x20;of&#x20;the&#x20;machine.',16,3,0,0,300,0,'','','','SELECT&#x20;DNSHostName&#x20;FROM&#x20;Win32_ComputerSystem',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (205,'Computer&#x20;number&#x20;of&#x20;CPUs','Displays&#x20;the&#x20;number&#x20;of&#x20;CPUs&#x20;present&#x20;in&#x20;the&#x20;system',17,1,0,0,300,1,'','','','SELECT&#x20;NumberOfProcessors&#x20;FROM&#x20;Win32_ComputerSystem',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (205,'Computer&#x20;number&#x20;of&#x20;CPUs','Displays&#x20;the&#x20;number&#x20;of&#x20;CPUs&#x20;present&#x20;in&#x20;the&#x20;system',17,1,0,0,300,1,'','','','SELECT&#x20;NumberOfProcessors&#x20;FROM&#x20;Win32_ComputerSystem',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (206,'Server&#x20;Domain','Display&#x20;the&#x20;Domain&#x20;the&#x20;machine&#x20;belongs&#x20;to.',16,3,0,0,300,0,'','','','SELECT&#x20;Domain&#x20;FROM&#x20;Win32_ComputerSystem',2,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (206,'Server&#x20;Domain','Display&#x20;the&#x20;Domain&#x20;the&#x20;machine&#x20;belongs&#x20;to.',16,3,0,0,300,0,'','','','SELECT&#x20;Domain&#x20;FROM&#x20;Win32_ComputerSystem',2,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (207,'Number&#x20;of&#x20;Processes','Displays&#x20;the&#x20;number&#x20;of&#x20;processes&#x20;running&#x20;in&#x20;the&#x20;system',16,1,0,0,300,3,'','','','SELECT&#x20;NumberOfProcesses&#x20;FROM&#x20;Win32_OperatingSystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (207,'Number&#x20;of&#x20;Processes','Displays&#x20;the&#x20;number&#x20;of&#x20;processes&#x20;running&#x20;in&#x20;the&#x20;system',16,1,0,0,300,0,'','','','SELECT&#x20;NumberOfProcesses&#x20;FROM&#x20;Win32_OperatingSystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (208,'Serial&#x20;Number','Serial&#x20;Number&#x20;of&#x20;the&#x20;machine',16,3,0,0,300,3,'','','','SELECT&#x20;SerialNumber&#x20;FROM&#x20;Win32_OperatingSystem',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (208,'Serial&#x20;Number','Serial&#x20;Number&#x20;of&#x20;the&#x20;machine',16,3,0,0,300,3,'','','','SELECT&#x20;SerialNumber&#x20;FROM&#x20;Win32_OperatingSystem',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (209,'CPU&#x20;Model','Displays&#x20;the&#x20;CPU&#x20;model',17,3,0,0,300,1,'','','','SELECT&#x20;Name&#x20;FROM&#x20;Win32_Processor',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (209,'CPU&#x20;Model','Displays&#x20;the&#x20;CPU&#x20;model',17,3,0,0,300,1,'','','','SELECT&#x20;Name&#x20;FROM&#x20;Win32_Processor',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (210,'Service&#x20;Pack','Service&#x20;Pack&#x20;Version&#x20;Installed',16,1,0,0,300,3,'','','','SELECT&#x20;ServicePackMajorVersion&#x20;FROM&#x20;Win32_OperatingSystem',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (210,'Service&#x20;Pack','Service&#x20;Pack&#x20;Version&#x20;Installed',16,1,0,0,300,3,'','','','SELECT&#x20;ServicePackMajorVersion&#x20;FROM&#x20;Win32_OperatingSystem',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
@ -361,7 +361,7 @@ INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "t
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (216,'Total&#x20;Visible&#x20;Memory&#x20;Size','Total&#x20;Visible&#x20;Memory&#x20;Size',16,1,0,0,300,3,'','','','SELECT&#x20;TotalVisibleMemorySize&#x20;from&#x20;win32_operatingsystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (216,'Total&#x20;Visible&#x20;Memory&#x20;Size','Total&#x20;Visible&#x20;Memory&#x20;Size',16,1,0,0,300,3,'','','','SELECT&#x20;TotalVisibleMemorySize&#x20;from&#x20;win32_operatingsystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (217,'Free&#x20;Space&#x20;In&#x20;Paging&#x20;Files','Gets&#x20;the&#x20;free&#x20;space&#x20;in&#x20;paging&#x20;files',16,1,0,0,300,0,'','','','Select&#x20;FreeSpaceInPagingFiles&#x20;from&#x20;Win32_operatingsystem',4,6,0,'none','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (217,'Free&#x20;Space&#x20;In&#x20;Paging&#x20;Files','Gets&#x20;the&#x20;free&#x20;space&#x20;in&#x20;paging&#x20;files',16,1,0,0,300,0,'','','','Select&#x20;FreeSpaceInPagingFiles&#x20;from&#x20;Win32_operatingsystem',4,6,0,'none','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (218,'Free&#x20;Space&#x20;In&#x20;Paging&#x20;Files','Gets&#x20;the&#x20;free&#x20;space&#x20;in&#x20;paging&#x20;files',16,1,0,0,300,0,'','','','Select&#x20;FreeSpaceInPagingFiles&#x20;from&#x20;Win32_operatingsystem',4,6,0,'none','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (218,'Free&#x20;Space&#x20;In&#x20;Paging&#x20;Files','Gets&#x20;the&#x20;free&#x20;space&#x20;in&#x20;paging&#x20;files',16,1,0,0,300,0,'','','','Select&#x20;FreeSpaceInPagingFiles&#x20;from&#x20;Win32_operatingsystem',4,6,0,'none','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (219,'Number&#x20;of&#x20;Users','Displays&#x20;the&#x20;number&#x20;of&#x20;users',16,1,0,0,300,3,'','','','SELECT&#x20;NumberOfUsers&#x20;FROM&#x20;Win32_operatingsystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (219,'Number&#x20;of&#x20;Users','Displays&#x20;the&#x20;number&#x20;of&#x20;users',16,1,0,0,300,0,'','','','SELECT&#x20;NumberOfUsers&#x20;FROM&#x20;Win32_operatingsystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (220,'Last&#x20;BootUp&#x20;Time','Displays&#x20;the&#x20;Last&#x20;BootUp&#x20;Time',16,3,0,0,300,0,'','','','SELECT&#x20;LastBootUpTime&#x20;FROM&#x20;Win32_operatingsystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (220,'Last&#x20;BootUp&#x20;Time','Displays&#x20;the&#x20;Last&#x20;BootUp&#x20;Time',16,3,0,0,300,0,'','','','SELECT&#x20;LastBootUpTime&#x20;FROM&#x20;Win32_operatingsystem',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (221,'BIOS&#x20;Name','Displays&#x20;the&#x20;BIOS&#x20;Name',17,3,0,0,300,1,'','','','SELECT&#x20;BiosCharacteristics&#x20;FROM&#x20;Win32_BIOS',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (221,'BIOS&#x20;Name','Displays&#x20;the&#x20;BIOS&#x20;Name',17,3,0,0,300,1,'','','','SELECT&#x20;BiosCharacteristics&#x20;FROM&#x20;Win32_BIOS',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (222,'BIOS&#x20;Version','Displays&#x20;the&#x20;BIOS&#x20;version',17,3,0,0,300,5,'','','','SELECT&#x20;BIOSVersion&#x20;FROM&#x20;Win32_BIOS',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO "tnetwork_component" ("id_nc", "name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level", "critical_instructions", "warning_instructions", "unknown_instructions", "tags", "disabled_types_event", "module_macros") VALUES (222,'BIOS&#x20;Version','Displays&#x20;the&#x20;BIOS&#x20;version',17,3,0,0,300,5,'','','','SELECT&#x20;BIOSVersion&#x20;FROM&#x20;Win32_BIOS',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');
@ -1000,9 +1000,9 @@ SELECT setval('tgis_map_layer_id_tmap_layer_seq', (SELECT (SELECT MAX(id_tmap_la
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (12,'Remote&#x20;agent&#x20;control','/usr/share/pandora_server/util/udp_client.pl&#x20;_address_&#x20;41122&#x20;&quot;_field1_&quot;','This&#x20;command&#x20;is&#x20;used&#x20;to&#x20;send&#x20;commands&#x20;to&#x20;the&#x20;Pandora&#x20;FMS&#x20;agents&#x20;with&#x20;the&#x20;UDP&#x20;server&#x20;enabled.&#x20;The&#x20;UDP&#x20;server&#x20;is&#x20;used&#x20;to&#x20;order&#x20;agents&#x20;&#40;Windows&#x20;and&#x20;UNIX&#41;&#x20;to&#x20;&quot;refresh&quot;&#x20;the&#x20;agent&#x20;execution:&#x20;that&#x20;means,&#x20;to&#x20;force&#x20;the&#x20;agent&#x20;to&#x20;execute&#x20;and&#x20;send&#x20;data',0,'[\"Command\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (12,'Remote&#x20;agent&#x20;control','/usr/share/pandora_server/util/udp_client.pl&#x20;_address_&#x20;41122&#x20;&quot;_field1_&quot;','This&#x20;command&#x20;is&#x20;used&#x20;to&#x20;send&#x20;commands&#x20;to&#x20;the&#x20;Pandora&#x20;FMS&#x20;agents&#x20;with&#x20;the&#x20;UDP&#x20;server&#x20;enabled.&#x20;The&#x20;UDP&#x20;server&#x20;is&#x20;used&#x20;to&#x20;order&#x20;agents&#x20;&#40;Windows&#x20;and&#x20;UNIX&#41;&#x20;to&#x20;&quot;refresh&quot;&#x20;the&#x20;agent&#x20;execution:&#x20;that&#x20;means,&#x20;to&#x20;force&#x20;the&#x20;agent&#x20;to&#x20;execute&#x20;and&#x20;send&#x20;data',0,'[\"Command\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_commands))); SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_commands)));
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (1,'Mail&#x20;to&#x20;XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold", "field1_recovery", "field2_recovery", "field3_recovery", "field4_recovery", "field5_recovery", "field6_recovery", "field7_recovery", "field8_recovery", "field9_recovery", "field10_recovery") VALUES (1,'Mail&#x20;to&#x20;XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','','','','','','','','',0,0,'','','','','','','','','','');
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (2,'Restart&#x20;agent',12,'REFRESH AGENT *','','',0,0); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold", "field1_recovery", "field2_recovery", "field3_recovery", "field4_recovery", "field5_recovery", "field6_recovery", "field7_recovery", "field8_recovery", "field9_recovery", "field10_recovery") VALUES (2,'Restart&#x20;agent',12,'REFRESH AGENT *','','','','','','','','','',0,0,'','','','','','','','','','');
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (3,'Pandora&#x20;FMS&#x20;Event',3,'_agent_&#x20;_module_&#x20;generated&#x20;an&#x20;event&#x20;alert&#x20;&#40;_data_&#41;','alert_fired','pandora','','4','','','','','',0,0,'RECOVERED:&#x20;_agent_&#x20;_module_&#x20;generated&#x20;event&#x20;alert&#x20;&#40;_data_&#41;','alert_ceased','pandora','','4','','','','',''); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold", "field1_recovery", "field2_recovery", "field3_recovery", "field4_recovery", "field5_recovery", "field6_recovery", "field7_recovery", "field8_recovery", "field9_recovery", "field10_recovery") VALUES (3,'Pandora&#x20;FMS&#x20;Event',3,'_agent_&#x20;_module_&#x20;generated&#x20;an&#x20;event&#x20;alert&#x20;&#40;_data_&#41;','alert_fired','pandora','','4','','','','','',0,0,'RECOVERED:&#x20;_agent_&#x20;_module_&#x20;generated&#x20;event&#x20;alert&#x20;&#40;_data_&#41;','alert_ceased','pandora','','4','','','','','');
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold", "field1_recovery", "field2_recovery", "field3_recovery", "field4_recovery", "field5_recovery", "field6_recovery", "field7_recovery", "field8_recovery", "field9_recovery", "field10_recovery") VALUES (4,'Create&#x20;a&#x20;ticket&#x20;in&#x20;Integria&#x20;IMS',11,'http://localhost/integria/include/api.php','1234','admin','_agent_:&#x20;_alert_name_','1','3','_alert_description_','','','',0,0,'','','','','','','','','',''); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "id_group", "action_threshold", "field1_recovery", "field2_recovery", "field3_recovery", "field4_recovery", "field5_recovery", "field6_recovery", "field7_recovery", "field8_recovery", "field9_recovery", "field10_recovery") VALUES (4,'Create&#x20;a&#x20;ticket&#x20;in&#x20;Integria&#x20;IMS',11,'http://localhost/integria/include/api.php','1234','admin','_agent_:&#x20;_alert_name_','1','3','_alert_description_','','','',0,0,'','','','','','','','','','');
SELECT setval('talert_actions_id_seq', (SELECT (SELECT MAX(id) FROM talert_actions))); SELECT setval('talert_actions_id_seq', (SELECT (SELECT MAX(id) FROM talert_actions)));

View File

@ -27,7 +27,7 @@
--\c "pandora" --\c "pandora"
-- For previous PostgreSQL version 9.0 -- For previous PostgreSQL version 9.0
CREATE LANGUAGE plpgsql; CREATE OR REPLACE LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION unix_timestamp(TIMESTAMP without time zone = CURRENT_TIMESTAMP) RETURNS double precision AS 'SELECT ceil(date_part(''epoch'', $1)); ' LANGUAGE SQL; CREATE OR REPLACE FUNCTION unix_timestamp(TIMESTAMP without time zone = CURRENT_TIMESTAMP) RETURNS double precision AS 'SELECT ceil(date_part(''epoch'', $1)); ' LANGUAGE SQL;
@ -1118,8 +1118,8 @@ CREATE TABLE "tlayout_data" (
"id_group" INTEGER NOT NULL default 0, "id_group" INTEGER NOT NULL default 0,
"id_custom_graph" INTEGER NOT NULL default 0, "id_custom_graph" INTEGER NOT NULL default 0,
"border_width" INTEGER NOT NULL default 0, "border_width" INTEGER NOT NULL default 0,
"border_color" varchar(200) DEFAULT "", "border_color" varchar(200) DEFAULT '',
"fill_color" varchar(200) DEFAULT "" "fill_color" varchar(200) DEFAULT ''
); );
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More