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
Version: 6.0dev-150602
Version: 6.0dev-150618
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# 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."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -68,40 +68,43 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
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_pwd mypassword
#server_pwd mypassword
# Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default).
# server_ssl no
#server_ssl no
# Extra options for the Tentacle client (for example, server_opts "-v -r 5").
# server_opts
#server_opts
# delayed_startup defines number of seconds before start execution
# for first time when startup Pandora FMS Agent
# delayed_startup 10
#delayed_startup 10
# Pandora nice defines priority of execution. Less priority means more intensive execution
# A recommended value is 10. 0 priority means no Pandora CPU protection enabled (default)
# pandora_nice 0
#pandora_nice 0
# Cron mode replace Pandora FMS own task schedule each XX interval seconds by the use
# of old style cron. You should add to crontab Pandora FMS agent script to use this mode.
# This is disabled by default, and is not recommended. Use Pandora FMS internal scheduler
# is much more safe.
# cron_mode
#cron_mode
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
# remote_config 1
#remote_config 1
# If set to 1 start Drone Agent's Proxy Mode
# proxy_mode 1
#proxy_mode 1
# Max number of simmultaneus connection for proxy (by default 10)
# proxy_max_connection 10
#proxy_max_connection 10
# Proxy timeout (by default 1s)
# proxy_timeout 1
#proxy_timeout 1
# Number of threads to execute modules in parallel
#agent_threads 1
@ -109,20 +112,21 @@ transfer_mode tentacle
# User the agent will run as
#pandora_user root
# Secondary server configuration
# ==============================
#Secondary server configuration
#==============================
# If secondary_mode is set to on_error, data files are copied to the secondary
# server only if the primary server fails. If set to always, data files are
# always copied to the secondary server.
# secondary_mode on_error
# secondary_server_ip localhost
# secondary_server_path /var/spool/pandora/data_in
# secondary_server_port 41121
# secondary_transfer_mode tentacle
# secondary_server_pwd mypassword
# secondary_server_ssl no
# secondary_server_opts
#secondary_mode on_error
#secondary_server_ip localhost
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts
# Module Definition
# =================

View File

@ -94,6 +94,9 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
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_pwd mypassword
@ -154,6 +157,7 @@ temporal_min_size 1024
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts

View File

@ -64,40 +64,43 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
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_pwd mypassword
#server_pwd mypassword
# Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default).
# server_ssl no
#server_ssl no
# Extra options for the Tentacle client (for example, server_opts "-v -r 5").
# server_opts
#server_opts
# delayed_startup defines number of seconds before start execution
# for first time when startup Pandora FMS Agent
# delayed_startup 10
#delayed_startup 10
# Pandora nice defines priority of execution. Less priority means more intensive execution
# A recommended value is 10. 0 priority means no Pandora CPU protection enabled (default)
# pandora_nice 0
#pandora_nice 0
# Cron mode replace Pandora FMS own task schedule each XX interval seconds by the use
# of old style cron. You should add to crontab Pandora FMS agent script to use this mode.
# This is disabled by default, and is not recommended. Use Pandora FMS internal scheduler
# is much more safe.
# cron_mode
#cron_mode
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
# remote_config 1
#remote_config 1
# If set to 1 start Drone Agent's Proxy Mode
# proxy_mode 1
#proxy_mode 1
# Max number of simmultaneus connection for proxy (by default 10)
# proxy_max_connection 10
#proxy_max_connection 10
# Proxy timeout (by default 1s)
# proxy_timeout 1
#proxy_timeout 1
# Number of threads to execute modules in parallel
#agent_threads 1
@ -111,14 +114,15 @@ transfer_mode tentacle
# If secondary_mode is set to on_error, data files are copied to the secondary
# server only if the primary server fails. If set to always, data files are
# always copied to the secondary server.
# secondary_mode on_error
# secondary_server_ip localhost
# secondary_server_path /var/spool/pandora/data_in
# secondary_server_port 41121
# secondary_transfer_mode tentacle
# secondary_server_pwd mypassword
# secondary_server_ssl no
# secondary_server_opts
#secondary_mode on_error
#secondary_server_ip localhost
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts
# Module Definition
# =================

View File

@ -58,40 +58,43 @@ server_port 41121
# Transfer mode: tentacle, ftp, ssh or local
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_pwd mypassword
#server_pwd mypassword
# Set to yes/no to enable/disable OpenSSL support for Tentacle (disabled by default).
# server_ssl no
#server_ssl no
# Extra options for the Tentacle client (for example, server_opts "-v -r 5").
# server_opts
#server_opts
# delayed_startup defines number of seconds before start execution
# for first time when startup Pandora FMS Agent
# delayed_startup 10
#delayed_startup 10
# Pandora nice defines priority of execution. Less priority means more intensive execution
# A recommended value is 10. 0 priority means no Pandora CPU protection enabled (default)
# pandora_nice 0
#pandora_nice 0
# Cron mode replace Pandora FMS own task schedule each XX interval seconds by the use
# of old style cron. You should add to crontab Pandora FMS agent script to use this mode.
# This is disabled by default, and is not recommended. Use Pandora FMS internal scheduler
# is much more safe.
# cron_mode
#cron_mode
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
# remote_config 1
#remote_config 1
# If set to 1 start Drone Agent's Proxy Mode
# proxy_mode 1
#proxy_mode 1
# Max number of simmultaneus connection for proxy (by default 10)
# proxy_max_connection 10
#proxy_max_connection 10
# Proxy timeout (by default 1s)
# proxy_timeout 1
#proxy_timeout 1
# User the agent will run as
#pandora_user root
@ -102,14 +105,15 @@ transfer_mode tentacle
# If secondary_mode is set to on_error, data files are copied to the secondary
# server only if the primary server fails. If set to always, data files are
# always copied to the secondary server.
# secondary_mode on_error
# secondary_server_ip localhost
# secondary_server_path /var/spool/pandora/data_in
# secondary_server_port 41121
# secondary_transfer_mode tentacle
# secondary_server_pwd mypassword
# secondary_server_ssl no
# secondary_server_opts
#secondary_mode on_error
#secondary_server_ip localhost
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts
# Module Definition
# =================

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150602';
use constant AGENT_BUILD => '150618';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {
@ -510,6 +510,9 @@ sub parse_conf_modules($) {
# Make the module run the first time
$module->{'counter'} = $module->{'intensive_interval'};
# Replace macros
replace_macros ($module);
push (@Modules, {%{$module}});
} else {
$module->{'func'} = \&module_plugin;
@ -601,16 +604,20 @@ sub write_broker_conf($){
my ($broker_agent) = @_;
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 (BROKER_FILE, ">$ConfDir/${broker_agent}.conf") or error ("Could not write configuration file: $!");
while (my $line = <CONF_FILE>){
while (my $line = <CONF_FILE>) {
my ( $token ) = $line =~ m/^\s*(\S+)(\s.*)?$/;
# Skip tokens which should not be copied to broker configuration
next if defined $ignored_tokens{$token};
# Skip broker definitions
if ($line =~ m/^\s*broker_agent/) {
next;
}
# Change the agent name
if ($line =~ m/^\s*#*\s*agent_name\s+/) {
$line = "agent_name $broker_agent\n";
@ -647,19 +654,6 @@ sub read_config (;$) {
# Replace CRLF with LF
$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
if (defined ($token)) {
if ($line =~ /^\s*(\S+)\s+(.*)$/ && $1 eq $token) {
@ -675,6 +669,20 @@ sub read_config (;$) {
}
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*/);
#Configuration token
@ -872,7 +880,7 @@ sub send_buffered_xml_files () {
while (my $xml_file = readdir(TEMPORAL)) {
# 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);
unlink ("$Conf{'temporal'}/$xml_file") if ($rc == 0);

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 6.0dev
%define release 150602
%define release 150618
Summary: Pandora FMS Linux agent, PERL version
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/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
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 6.0dev
%define release 150602
%define release 150618
Summary: Pandora FMS Linux agent, PERL version
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/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
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
fi
#if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
# rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
#fi
%clean
rm -Rf $RPM_BUILD_ROOT

View File

@ -62,6 +62,9 @@ interval 300
transfer_mode tentacle
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"
#server_pwd pandora
@ -98,6 +101,7 @@ xml_buffer 1
#secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121
#secondary_transfer_mode tentacle
#secondary_transfer_timeout 30
#secondary_server_pwd mypassword
#secondary_server_ssl no
#secondary_server_opts

View File

@ -107,7 +107,7 @@ read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
*/
int
Pandora_Ftp_Client::ftpFileFilename (const string remote_filename,
const string filepath)
const string filepath, int timeout)
{
FILE *fd;
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_URL, url.c_str ());
curl_easy_setopt (this->curl, CURLOPT_POSTQUOTE, headerlist);
curl_easy_setopt (this->curl, CURLOPT_TIMEOUT, 240);
curl_easy_setopt (this->curl, CURLOPT_FTP_RESPONSE_TIMEOUT, 60);
curl_easy_setopt (this->curl, CURLOPT_TIMEOUT, timeout * 4);
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_READDATA, fd);
curl_easy_setopt (curl, CURLOPT_INFILESIZE_LARGE,

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#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_dir;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -140,15 +140,17 @@ function mainAgentsModules() {
$filter_module_group['id_module_group'] = $modulegroup;
}
$count = 0;
foreach ($agents as $agent){
$module = agents_get_modules($agent, false, $filter_module_group, true, false);
if ($module == false){
foreach ($agents as $agent) {
$module = agents_get_modules($agent, false,
$filter_module_group, true, false);
if ($module == false) {
unset($agents[$count]);
}
$count++;
}
$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();
$name = '';

View File

@ -30,7 +30,7 @@ if (is_ajax ()) {
if ($get_info_alert_module_group) {
$agents = agents_get_group_agents($id_agent_group);
if (!empty($agents)) {
$alerts = agents_get_alerts_simple(array_keys($agents));
$alerts = agents_get_alerts_simple(array_keys($agents));
foreach ($alerts as $alert) {
$module = db_get_row_filter('tagente_modulo', array('id_agente_modulo' => $alert['id_agent_module']));
if ($module_group == $module['id_module_group']) {
@ -108,14 +108,14 @@ if (is_ajax ()) {
echo '<i>No available data</i>';
}
}
/**
* Translate the array texts using gettext
*/
function translate(&$item, $key) {
$item = __($item);
}
/**
* The main function of module groups and the enter point to
* execute the code.
@ -321,7 +321,7 @@ function mainModuleGroups() {
</script>
<?php
}
extensions_add_operation_menu_option(__("Module groups"), 'estado', 'module_groups/brick.png', "v1r1","view");
extensions_add_main_function('mainModuleGroups');
?>

View File

@ -86,25 +86,25 @@ function main_net_tools () {
$principal_ip = db_get_sql ("SELECT direccion FROM tagente WHERE id_agente = $id_agente");
$list_address = db_get_all_rows_sql ("select id_a from taddress_agent where id_agent = " . $id_agente);
foreach ($list_address as $address){
foreach ($list_address as $address) {
$ids []= join(",",$address);
}
$ids_address = implode(",",$ids);
$ips = db_get_all_rows_sql ("select ip from taddress where id_a in (" . $ids_address . ")");
if ($ips == "") {
echo "<div class='error' style='margin-top:5px'>" . __('The agent hasn\'t got IP') . "</div>";
return;
}
echo "
<script type='text/javascript'>
function mostrarColumns(ValueSelect){
function mostrarColumns(ValueSelect) {
value = ValueSelect.value;
if ( value==3 ) {
if (value == 3) {
$('netToolTable').css('width','100%');
$('#snmpcolumn').show();
}
else{
else {
$('netToolTable').css('width','100%');
$('#snmpcolumn').hide();
}
@ -116,7 +116,8 @@ function main_net_tools () {
echo "<table class='databox filters' width=100% id=netToolTable>";
echo "<tr><td>";
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 "<select name='operation' onChange='mostrarColumns(this);'>";
echo "<option value='1'>" . __("Traceroute");
@ -130,10 +131,11 @@ function main_net_tools () {
echo __("IP address");
echo "</td><td>";
echo "<select name='select_ips'>";
foreach($ips as $ip){
if ($ip['ip'] == $principal_ip){
foreach ($ips as $ip) {
if ($ip['ip'] == $principal_ip) {
echo "<option value='". $ip['ip'] ."' selected = 'selected'>" . $ip['ip'];
}else{
}
else {
echo "<option value='". $ip['ip'] ."'>" . $ip['ip'];
}
}
@ -172,7 +174,7 @@ function main_net_tools () {
ui_print_error_message(__('Ping executable does not exist.'));
}
else {
echo "<h3>".__("Ping to "). $ip. "</h3>";
echo "<h3>" . __("Ping to %s", $ip) . "</h3>";
echo "<pre>";
echo system ("$ping -c 5 $ip");
echo "</pre>";

View File

@ -76,11 +76,15 @@ function pluginreg_extension_main () {
$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"];
}
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"];
}

View File

@ -88,7 +88,7 @@ if (empty($data)) {
}
echo '{
"label": "' . $graph_title . '",
"data": [["' . time() . '", ' . $data . ']]
"label": "' . $graph_title . '",
"data": [["' . time() . '", ' . $data . ']]
}';
?>

View File

@ -83,7 +83,7 @@ function output_xml_report($id) {
$report = db_get_row('treport', 'id_report', $id);
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo "<report>\n";
echo "<name><![CDATA[" . io_safe_output($report['name']) . "]]></name>\n";
if (isset($report['description']))
@ -200,7 +200,7 @@ function output_xml_report($id) {
case 'event_report_module':
break;
case 'alert_report_module':
break;
break;
case 'alert_report_agent':
break;
case 'alert_report_group':
@ -230,7 +230,7 @@ function output_xml_report($id) {
function output_xml_visual_console($id) {
$visual_map = db_get_row('tlayout', 'id', $id);
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
echo "<visual_map>\n";
echo "<name><![CDATA[" . io_safe_output($visual_map['name']) . "]]></name>\n";
if ($visual_map['id_group'] != 0) {

View File

@ -129,7 +129,7 @@ function process_upload_xml_report($xml, $group_filter = 0) {
foreach ($agents as $agent) {
if ($regular_expresion) {
if ((bool)preg_match("/" . $agent_clean . "/", io_safe_output($agent['nombre']))) {
$agents_item[$agent['id_agente']]['name'] = $agent['nombre'];
$agents_item[$agent['id_agente']]['name'] = $agent['nombre'];
}
}
else {
@ -153,13 +153,13 @@ function process_upload_xml_report($xml, $group_filter = 0) {
if ($regular_expresion) {
if ((bool)preg_match("/" . $module_clean . "/", io_safe_output($module['nombre']))) {
$agents_item[$id]['modules'][$module['id_agente_modulo']]['name'] =
$module['nombre'];
$module['nombre'];
}
}
else {
if ($module_clean == io_safe_output($module['nombre'])) {
$agents_item[$id]['modules'][$module['id_agente_modulo']]['name'] =
$module['nombre'];
$module['nombre'];
}
}
}
@ -241,7 +241,7 @@ function process_upload_xml_report($xml, $group_filter = 0) {
'sla_max' => (string)$sla_xml->sla_max,
'sla_min' => (string)$sla_xml->sla_min,
'sla_limit' => (string)$sla_xml->sla_limit
);
);
}
}
else {
@ -298,7 +298,7 @@ function process_upload_xml_report($xml, $group_filter = 0) {
case 'event_report_module':
break;
case 'alert_report_module':
break;
break;
case 'alert_report_agent':
break;
case 'alert_report_group':
@ -445,7 +445,7 @@ function process_upload_xml_visualmap($xml, $filter_group = 0) {
$regular_expresion = ($agent_clean != $item->agent);
$agents = agents_get_agents(array('id_grupo' => $filter_group), array('id_agente', 'nombre'));
if ($agents === false) $agents = array();
if ($agents === false) $agents = array();
$temp = array();
foreach ($agents as $agent) {
$temp[$agent['id_agente']] = $agent['nombre'];
@ -692,7 +692,7 @@ function process_upload_xml_component($xml) {
'custom_string_3' => $custom_string_3,
'post_process' => $post_process));
if ((bool)$idComponent) {
$components[] = $idComponent;
$components[] = $idComponent;
}
break;
case 4: //Plugin component
@ -728,7 +728,7 @@ function process_upload_xml_component($xml) {
'custom_string_3' => $custom_string_3,
'post_process' => $post_process));
if ((bool)$idComponent) {
$components[] = $idComponent;
$components[] = $idComponent;
}
break;
case 5: //Prediction component
@ -766,7 +766,7 @@ function process_upload_xml_component($xml) {
'custom_string_3' => $custom_string_3,
'post_process' => $post_process));
if ((bool)$idComponent) {
$components[] = $idComponent;
$components[] = $idComponent;
}
break;
case 7: //Web component

View File

@ -60,7 +60,7 @@ function ssh_gateway () {
echo "<td rowspan=2 vertical_aling='middle'>&nbsp;&nbsp;&nbsp;<input type=submit name=connect class='sub upd' style='margin-top:0px;' value=".__("Connect").">";
echo "<input type=hidden name=commit value=1></td>";
echo "<tr>";
echo "<td>".__("Port (use 0 for default)")."<td><input type=text size=5 value='$PORT' name=port>";
echo "<td>".__("Port (use 0 for default)")."<td><input type=text size=5 value='$PORT' name=port>";
echo "<td>";
echo __("Connect mode")."<td><select name=mode>";
if ($MODE == "telnet") {

View File

@ -98,7 +98,7 @@ function users_extension_main_god ($god = true) {
FROM tsesion
WHERE id_usuario = '%s'
AND to_char(descripcion) = '" . io_safe_input('Logged in') . "'
ORDER BY fecha DESC",$row["id_user"]));
ORDER BY fecha DESC",$row["id_user"]));
break;
}

View File

@ -27,10 +27,10 @@ function render_info_data ($query, $label) {
render_row ($info, $label);
}
function render_row ($data, $label){
function render_row ($data, $label) {
global $console_mode;
if ($console_mode == 1){
if ($console_mode == 1) {
echo $label;
echo "|";
echo $data;

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\":\"\"}}'
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)

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',
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';
-- ---------------------------------------------------------------------
-- 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',
"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';
-- ---------------------------------------------------------------------
-- 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

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=enterprise/godmode/agentes/collections&action=new">Crear una nueva colección</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=enterprise/godmode/agentes/collections&action=new">Crear una nueva colección</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field">Crear un nuevo campo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field">Crear un nuevo campo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=gservers&sec2=godmode/reporting/visual_console_builder">Crear un mapa de consola</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=gservers&sec2=godmode/reporting/visual_console_builder">Crear un mapa de consola</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=network&amp;sec2=operation/agentes/networkmap&add_networkmap=1&tab=groups">Crear un mapa de red de grupo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=network&amp;sec2=operation/agentes/networkmap&add_networkmap=1&tab=groups">Crear un mapa de red de grupo</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,23 +5,23 @@ ui_require_css_file ('firts_task');
?>
<div class="new_task">
<div>
<div class="title_task"> <?php echo __('There are no recon task defined yet'); ?> </div>
</div>
<div>
<div class="image_task">
<?php echo html_print_image('images/icono_grande_reconserver.png', true, array("alt" => __('Recon server')));?>
</div>
<div class="text_task">
<div>
<div class="title_task"> <?php echo __('There are no recon task defined yet'); ?> </div>
</div>
<div>
<div class="image_task">
<?php echo html_print_image('images/icono_grande_reconserver.png', true, array("alt" => __('Recon server')));?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Recon Task'); ?></h3>
<p id="description_task"> <?php echo __('The Recon Task definition of Pandora FMS is used to find new elements in the network.
If it detects any item, it will add that item to the monitoring, and if that item it is already being monitored, then it will
ignore it or will update its information.There are three types of detection: Based on <strong id="fuerte"> ICMP </strong>(pings),
<strong id="fuerte">SNMP</strong> (detecting the topology of networks and their interfaces), and other <strong id="fuerte"> customized </strong>
type. You can define your own customized recon script.'); ?></p>
<p id="description_task"> <?php echo __('The Recon Task definition of Pandora FMS is used to find new elements in the network.
If it detects any item, it will add that item to the monitoring, and if that item it is already being monitored, then it will
ignore it or will update its information.There are three types of detection: Based on <strong id="fuerte"> ICMP </strong>(pings),
<strong id="fuerte">SNMP</strong> (detecting the topology of networks and their interfaces), and other <strong id="fuerte"> customized </strong>
type. You can define your own customized recon script.'); ?></p>
<form action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create" method="post">
<button class="button_task" > <?php echo __('Create Recon Task'); ?></button>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=estado&sec2=enterprise/godmode/services/services.service&action=new_service">Crear un nuevo servicio</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="?sec=estado&sec2=enterprise/godmode/services/services.service&action=new_service">Crear un nuevo servicio</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter=-1">Crear un nuevo filtro snmp</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter=-1">Crear un nuevo filtro snmp</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -5,40 +5,40 @@ ui_require_css_file ('firts_task');
?>
<div class="Table">
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=$sec&sec2=godmode/tag/edit_tag&action=new">Crear un nuevo tag</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
<div class="Title">
<p>This is a Table</p>
</div>
<div class="Heading">
<div class="Cell">
<p>Heading 1</p>
</div>
<div class="Cell">
<p>Heading 2</p>
</div>
<div class="Cell">
<p>Heading 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<a href="index.php?sec=$sec&sec2=godmode/tag/edit_tag&action=new">Crear un nuevo tag</a>
</div>
<div class="Cell">
<p>Row 1 Column 2</p>
</div>
<div class="Cell">
<p>Row 1 Column 3</p>
</div>
</div>
<div class="Row">
<div class="Cell">
<p>Row 2 Column 1</p>
</div>
<div class="Cell">
<p>Row 2 Column 2</p>
</div>
<div class="Cell">
<p>Row 2 Column 3</p>
</div>
</div>
</div>

View File

@ -213,10 +213,12 @@ config_check();
$autorefresh_additional .= '</span>';
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']) {
$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 {
$autorefresh_link_open_txt = '<a>';
@ -229,8 +231,8 @@ config_check();
$ignored_params['refr'] = false;
$autorefresh_link_open_img = '';
$autorefresh_link_open_txt = '';
$autorefresh_link_open_img = '';
$autorefresh_link_open_txt = '';
$autorefresh_link_close = '';
}
@ -249,10 +251,18 @@ config_check();
$maintenance_title = __("System alerts detected - Please fix as soon as possible");
$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_img = '<a href="' . $maintenance_link . '" title="' . $maintenance_title . '" class="' . $maintenance_class . '">';
$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_link_open_txt =
'<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_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 {
$maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot"));
@ -322,7 +332,7 @@ config_check();
<?php
$config_fixed_header = false;
if (isset($config['fixed_header'])) {
$config_fixed_header = $config['fixed_header'];
$config_fixed_header = $config['fixed_header'];
}
?>

View File

@ -67,7 +67,8 @@ echo '<div class="databox_login" id="login">';
echo '<div id="login_inner">';
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) . '" >';
//TODO: Put branding in variables (external file) or database
@ -281,7 +282,7 @@ ui_require_jquery_file('jquery-ui-1.10.0.custom');
<div style="position: relative; top:120px; width:650px; margin: 0 auto; text-align: left; border: 1px solid #FFF;">
<?php
echo '<span style="font-size: 10pt; color: #2E2E2E; font-weight: bold;">';
echo __('Why is it recommended to upgrade the web browser?');
echo __('Why is it recommended to upgrade the web browser?');
echo '</span>';
echo '<span style="font-size: 9.5pt; line-height: 18px;">';

View File

@ -58,7 +58,7 @@ if (tags_has_user_acl_tags()) {
$table->headstyle[0] = 'text-align:center;';
$table->width = "100%";
$table->head[0] = '<span>' . __('Pandora FMS Overview') . '</span>';
$table->head_colspan[0] = 4;
$table->head_colspan[0] = 4;
// Indicators
$tdata = array();
@ -195,7 +195,7 @@ if (tags_has_user_acl_tags()) {
$sessions = db_get_all_rows_sql ($sql);
if ($sessions === false)
$sessions = array ();
$sessions = array ();
foreach ($sessions as $session) {
$data = array ();
@ -262,7 +262,7 @@ $table->data = array ();
$table->style[0] = 'text-align:center;';
$table->width = "100%";
$table->head[0] = '<span>' . __('Pandora FMS Overview') . '</span>';
$table->head_colspan[0] = 4;
$table->head_colspan[0] = 4;
// Indicators
$tdata = array();
@ -395,7 +395,7 @@ $options = array();
$sessions = db_get_all_rows_sql ($sql);
if ($sessions === false)
$sessions = array ();
$sessions = array ();
foreach ($sessions as $session) {
$data = array ();

View File

@ -205,7 +205,7 @@ $(document).ready( function() {
show_menu();
openTime = new Date().getTime();
}
}).mouseleave(function(){
}).mouseleave(function() {
handsIn = 0;
setTimeout(function() {
openedTime = new Date().getTime() - openTime;
@ -225,7 +225,7 @@ $(document).ready( function() {
$('#menu').css('width', '145px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}).mouseleave(function(){
}).mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
@ -238,7 +238,7 @@ $(document).ready( function() {
}, 1500);
});
}
else{
else {
$('div#title_menu').hide();
}
});
@ -251,7 +251,7 @@ $(document).ready( function() {
handsIn = 0;
handsIn2 = 0;
$('.menu_icon').mouseenter(function(){
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
@ -261,7 +261,7 @@ $(document).ready( function() {
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function(){
}).mouseleave(function() {
//$('div#menu').css('overflow', 'hidden');
table_noHover = $(this);
handsIn = 0;
@ -275,7 +275,7 @@ $(document).ready( function() {
});
- $('.has_submenu').mouseenter(function(){
- $('.has_submenu').mouseenter(function() {
table_hover2 = $(this);
handsIn2 = 1;
openTime2 = new Date().getTime();
@ -283,7 +283,7 @@ $(document).ready( function() {
if( typeof(table_noHover2) != 'undefined')
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id )
$("ul#sub"+table_noHover2[0].id).hide();
}).mouseleave(function(){
}).mouseleave(function() {
table_noHover2 = table_hover2;
handsIn2 = 0;
setTimeout(function() {
@ -295,8 +295,8 @@ $(document).ready( function() {
}, 3500);
});
$(document).ready(function(){
$('#container').click(function(){
$(document).ready(function() {
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
@ -308,7 +308,7 @@ $(document).ready( function() {
$('div#title_menu').hide();
});
$('div.menu>ul>li>ul>li>a').click(function(){
$('div.menu>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
@ -319,7 +319,7 @@ $(document).ready( function() {
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
$('div.menu>ul>li>ul>li>ul>li>a').click(function(){
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();

View File

@ -19,7 +19,7 @@
*/
global $config;
$options = array();
$options['id_user'] = $config['id_user'];
$options['modal'] = true;

View File

@ -63,13 +63,13 @@ if (is_ajax()) {
}
// Get critical events (realtime update)
if ($get_alerts_fired){
if ($get_alerts_fired) {
echo sc_get_alerts_fired();
return;
}
// Get critical events (realtime update)
if ($get_critical_events){
if ($get_critical_events) {
echo sc_get_critical_events();
return;
}
@ -107,18 +107,18 @@ function sc_get_critical_events () {
$shortcut_events_update = array();
$critical_events_update = 0;
foreach($shortcut_events_update as $event_update){
foreach ($shortcut_events_update as $event_update) {
if ($event_update['criticity'] == 4 and $event_update['estado'] == 0) {
$critical_events_update++;
}
}
return $critical_events_update;
}
function sc_get_opened_incidents () {
global $config;
$own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) {
@ -405,5 +405,5 @@ html_print_input_hidden("shortcut_id_user", $config['id_user']);
helper: "clone",
scroll: false
});
});
});
</script>

View File

@ -17,7 +17,7 @@
global $config;
require_once ($config["homedir"] . '/include/functions_graph.php');
require_once ($config["homedir"] . '/include/functions_graph.php');
check_login ();
@ -164,7 +164,7 @@ switch ($config["dbtype"]) {
$result = db_get_all_rows_sql ($sql);
// Delete rnum row generated by oracle_recode_query() function
if (($config["dbtype"] == 'oracle') && ($result !== false)){
if (($config["dbtype"] == 'oracle') && ($result !== false)) {
for ($i=0; $i < count($result); $i++) {
unset($result[$i]['rnum']);
}

View File

@ -66,7 +66,7 @@ if (is_ajax ()) {
$oid_snmp = array();
$out = false;
foreach ($idSNMP as $id) {
foreach ($snmp[$id] as $key => $value){
foreach ($snmp[$id] as $key => $value) {
// Check if it has "ifXXXX" syntax and skip it
if (! preg_match ( "/if/", $key)) {
@ -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][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[5][0] = __('OS');

View File

@ -27,9 +27,9 @@ require_once($config['homedir'] . "/include/functions_modules.php");
// ==========================
if (isset ($_POST["template_id"])) {
// Take agent data
$row = db_get_row ("tagente", "id_agente", $id_agente);
$row = db_get_row ("tagente", "id_agente", $id_agente);
if ($row !== false) {
$intervalo = $row["intervalo"];
$intervalo = $row["intervalo"];
$nombre_agente = $row["nombre"];
$direccion_agente =$row["direccion"];
$ultima_act = $row["ultimo_contacto"];

View File

@ -894,7 +894,7 @@ if (!$fail) {
if ($arrow) {
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_snmpdata wizard_mode_snmpdata_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->data[2][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px; height: 100%;');
@ -1052,11 +1052,14 @@ $(document).ready (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'); ?>');
return false;
}
$('#module option').map(function(){
$('#module option').map(function() {
$(this).attr('selected','selected');
});
});

View File

@ -307,7 +307,7 @@ if ($wmiexplore && !$fail) {
$table->data[1][0] .= html_print_select ($modes,
'wmi_wizard_modes', '', '', '', '', true, false, false);
$table->cellstyle[1][0] = 'vertical-align: middle;';
$table->colspan[1][0] = 2;
$table->data[1][2] = '<b>'.__('Modules').'</b>';
$table->cellstyle[1][2] = 'vertical-align: middle;';
@ -321,13 +321,13 @@ if ($wmiexplore && !$fail) {
$table->data[2][0] .= html_print_select (array (), 'network_component', '', '',
'', '', true, true, true, '', false, 'width: 300px;');
$table->data[2][0] .= '</div>';
// Services list
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_services">';
$table->data[2][0] .= html_print_select ($services, 'services', '', '',
'', '', true, true, true, '', false, 'width: 300px;');
$table->data[2][0] .= '</div>';
// Processes list
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_processes">';
$table->data[2][0] .= html_print_select ($processes, 'processes', '', '',
@ -343,8 +343,8 @@ if ($wmiexplore && !$fail) {
'', '', true, true, true, '', false, 'width: 300px;');
$table->data[2][0] .= '</div>';
$table->cellstyle[2][0] = 'vertical-align: top; text-align: center;';
// Components arrow
$table->data[2][1] = '<div class="wizard_mode_form wizard_mode_components wizard_mode_components_arrow clickable">' . html_print_image('images/darrowright.png', true, array('title' => __('Add to modules list'))) . '</div>';
// Services arrow
@ -355,13 +355,15 @@ 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] .= '<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->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_input_hidden('agent', $id_agent, true);
$table->cellstyle[2][2] = 'vertical-align: top; text-align: center;';
html_print_table($table);
echo "<div style='text-align:right; width:".$table->width."'>";
@ -373,7 +375,7 @@ if ($wmiexplore && !$fail) {
echo "</form>";
echo '</div>';
}
ui_require_jquery_file ('pandora.controls');
ui_require_jquery_file ('ajaxqueue');
ui_require_jquery_file ('bgiframe');
@ -383,7 +385,7 @@ ui_require_javascript_file ('pandora_modules');
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$(document).ready (function () {
$("#wmi_form").submit(function() {
$("#oid_loading").show ();
});
@ -479,7 +481,7 @@ $(document).ready (function () {
$(value).remove();
}
});
if($("#module option").length == 0) {
$("select[name='module[]']").append($("<option></option>").val(0).html(<?php echo "'".__('None')."'"; ?>));
}
@ -490,7 +492,7 @@ $(document).ready (function () {
alert('<?php echo __('Modules list is empty'); ?>');
return false;
}
$('#module option').map(function(){
$('#module option').map(function() {
$(this).attr('selected','selected');
});
});

View File

@ -205,10 +205,11 @@ if ($create_agent) {
// Create custom fields for this agent
foreach ($field_values as $key => $value) {
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
if ( $direccion_agente != ''){
if ( $direccion_agente != '') {
agents_add_address ($id_agente, $direccion_agente);
}
@ -485,7 +486,7 @@ if ($id_agente) {
// This add information to the header
switch ($tab) {
case "main":
$tab_description = '- '. __('Setup');
$tab_description = '- '. __('Setup');
break;
case "collection":
$tab_description = '- ' . __('Collection') ;

View File

@ -33,21 +33,22 @@ ui_print_page_header (__("Agents custom fields manager"), "images/custom_field.p
$create_field = (bool) get_parameter ('create_field');
$update_field = (bool) get_parameter ('update_field');
$delete_field = (bool) get_parameter ('delete_field');
$id_field = (int) get_parameter ('id_field', 0);
$id_field = (int) get_parameter ('id_field', 0);
$name = (string) get_parameter ('name', '');
$display_on_front = (int) get_parameter ('display_on_front', 0);
/* Create field */
if ($create_field) {
/*Check if name field is empty*/
if ($name == ""){
if ($name == "") {
ui_print_error_message(__('The name must not be empty'));
}
else if ($name == db_get_value ('name', 'tagent_custom_fields', 'name', $name)) {
ui_print_error_message(__('The name must be unique'));
}
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'));
}
}
@ -74,12 +75,13 @@ if ($update_field) {
/* 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)
ui_print_error_message(__('There was a problem deleting field'));
ui_print_error_message(__('There was a problem deleting field'));
else
ui_print_success_message(__('Field successfully deleted'));
ui_print_success_message(__('Field successfully deleted'));
}
$fields = db_get_all_fields_in_table('tagent_custom_fields');

View File

@ -143,10 +143,10 @@ html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group,
echo "<td>";
echo __('Show Agents') . '&nbsp;';
$fields = array(
2 => __('Everyone'),
1 => __('Only disabled'),
0 => __('Only enabled'),
);
2 => __('Everyone'),
1 => __('Only disabled'),
0 => __('Only enabled'),
);
html_print_select($fields,"disabled",$disabled,'this.form.submit()');
echo "</td>";
@ -251,12 +251,12 @@ if ($search != "") {
LIKE '%$search%' OR direccion LIKE '%$search%') ";
}
if ($disabled==1)
if ($disabled == 1)
{
$search_sql = " AND disabled = ". $disabled . $search_sql;
}
else{
if ($disabled==0){
else {
if ($disabled == 0) {
$search_sql = " AND disabled = 0" . $search_sql;
}
}
@ -596,12 +596,12 @@ echo "</td></tr></table>";
$("#ag_group").click (
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "100px");
$(this).css ("width", "auto");
$(this).css ("min-width", "100px");
});
$("#ag_group").blur (function () {
$(this).css ("width", "100px");
$(this).css ("width", "100px");
});
});

View File

@ -189,7 +189,7 @@ if ($multiple_delete) {
case "mysql":
case "postgresql":
$result = db_process_sql_delete('tagente_estado',
array('id_agente_modulo' => $id_agent_module_del));
array('id_agente_modulo' => $id_agent_module_del));
if ($result === false)
$error++;
@ -424,7 +424,7 @@ $search_string_entities = io_safe_input($search_string);
$basic_where = sprintf("(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", $search_string, $search_string_entities, $search_string, $search_string_entities);
$where_tags = tags_get_acl_tags($config['id_user'], 0, 'AR', 'module_condition', 'AND', 'tagente_modulo');
$where_tags = tags_get_acl_tags($config['id_user'], 0, 'AR', 'module_condition', 'AND', 'tagente_modulo');
$paginate_module = false;
if (isset($config['paginate_module']))
@ -679,7 +679,7 @@ foreach ($modules as $module) {
$data[7] = ui_print_module_warn_value ($module["max_warning"],
$module["min_warning"], $module["str_warning"],
$module["max_critical"], $module["min_critical"],
$module["str_critical"]);
$module["str_critical"]);
if ($module['disabled']) {
$data[8] = "<a href='index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente=".$id_agente."&enable_module=".$module['id_agente_modulo']."'>".

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][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->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")) {
$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;
}
else {
@ -725,13 +727,13 @@ $(document).ready (function () {
});
$("#submit-updbutton").click(function () {
$('#id_tag_selected option').map(function(){
$('#id_tag_selected option').map(function() {
$(this).attr('selected','selected');
});
});
$("#submit-crtbutton").click(function () {
$('#id_tag_selected option').map(function(){
$('#id_tag_selected option').map(function() {
$(this).attr('selected','selected');
});
});
@ -770,7 +772,7 @@ $(document).ready (function () {
$("#id_module_type").trigger('change');
// Prevent the form submission when the user hits the enter button from the relationship autocomplete inputs
$("#text-autocomplete_agent_name").keydown(function(event){
$("#text-autocomplete_agent_name").keydown(function(event) {
if(event.keyCode == 13) { // key code 13 is the enter button
event.preventDefault();
}
@ -839,7 +841,7 @@ function change_modules_autocomplete_input () {
if (data) {
module_autocomplete.html(data);
// Prevent the form submission when the user hits the enter button from the relationship autocomplete inputs
$("#text-autocomplete_module_name").keydown(function(event){
$("#text-autocomplete_module_name").keydown(function(event) {
if(event.keyCode == 13) { // key code 13 is the enter button
event.preventDefault();
}

View File

@ -218,22 +218,22 @@ $(document).ready (function () {
$("#select_snmp_oid").click (
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
});
$("#select_snmp_oid").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
$("#id_module_type").click (
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
$(this).css ("width", "auto");
$(this).css ("min-width", "180px");
});
$("#id_module_type").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
// Keep elements in the form and the SNMP browser synced
@ -294,10 +294,10 @@ $(document).ready (function () {
});
$('#snmp3_auth_pass').keyup(function() {
$('#snmp3_browser_auth_pass').val($(this).val());
});
});
$('#snmp3_browser_auth_pass').keyup(function() {
$('#snmp3_auth_pass').val($(this).val());
});
});
$('#snmp3_privacy_method').change(function() {
$('#snmp3_browser_privacy_method').val($(this).val());
});
@ -306,7 +306,7 @@ $(document).ready (function () {
});
$('#snmp3_privacy_pass').keyup(function() {
$('#snmp3_browser_privacy_pass').val($(this).val());
});
});
$('#snmp3_browser_privacy_pass').keyup(function() {
$('#snmp3_privacy_pass').val($(this).val());
});

View File

@ -179,7 +179,7 @@ if (!empty($downtimes)) {
$execution_date .= __('Sun');
$execution_date .= "&nbsp;";
}
$execution_date .= "&nbsp;(" . $downtime['periodically_time_from'];
$execution_date .= "&nbsp;(" . $downtime['periodically_time_from'];
$execution_date .= "-" . $downtime['periodically_time_to'] . ")";
break;
case 'monthly':

View File

@ -503,7 +503,7 @@ else {
$data[5] .= __('Sun');
$data[5] .= "&nbsp;";
}
$data[5] .= "&nbsp;(" . $downtime['periodically_time_from'];
$data[5] .= "&nbsp;(" . $downtime['periodically_time_from'];
$data[5] .= "-" . $downtime['periodically_time_to'] . ")";
break;
case 'monthly':
@ -544,10 +544,13 @@ else {
'&delete_downtime=1&id_downtime=' . $downtime['id'] . '&' . $filter_params_str . '">' .
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;' .
'edit_downtime=1&amp;id_downtime='.$downtime['id'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>';
'edit_downtime=1&amp;id_downtime=' . $downtime['id'] . '">' .
html_print_image("images/config.png", true,
array("border" => '0', "alt" => __('Update'))) . '</a>';
$data[9]= "N/A";
}
else {

View File

@ -73,9 +73,9 @@ if ($copy_action) {
$al_action = alerts_get_alert_action ($id);
if ($al_action !== false){
if ($al_action !== false) {
// If user tries to copy an action with group=ALL
if ($al_action['id_group'] == 0){
if ($al_action['id_group'] == 0) {
// then must have "PM" access privileges
if (! check_acl ($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation",

View File

@ -142,7 +142,8 @@ if ( defined("METACONSOLE") ) {
$form_filter .= "</td>";
$form_filter .= "</tr>";
$form_filter .= "</table>";
}else{
}
else {
$form_filter .= "</table>";
$form_filter .= "<div style='text-align:right; height:100%;'>";
$form_filter .= html_print_submit_button (__('Update'), '', false, 'class="sub upd"', true);
@ -372,7 +373,7 @@ else {
/* if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->size[4] = '25%';
} */
$table->size[3] = '1%';
$table->size[3] = '1%';
$table->size[4] = '10%';
}
@ -497,7 +498,7 @@ foreach ($simple_alerts as $alert) {
else
$data[2] .= __('On').' '.$action['fires_min'];
}
else if ($action['fires_min'] < $action['fires_max']){
else if ($action['fires_min'] < $action['fires_max']) {
if ($action['fires_min'] == 0)
$data[2] .= __('Until').' '.$action['fires_max'];
else
@ -659,7 +660,7 @@ foreach ($simple_alerts as $alert) {
// To manage alert is necessary LW permissions in the agent group
if(check_acl ($config['id_user'], $agent_group, "LW")) {
$data[4] .= '&nbsp;&nbsp;<form class="delete_alert_form" action="' . $url . '" method="post" style="display: inline;">';
$data[4] .= '&nbsp;&nbsp;<form class="delete_alert_form" action="' . $url . '" method="post" style="display: inline;">';
if ($alert['disabled']) {
$data[4] .= html_print_image('images/add.disabled.png',
true, array('title' => __("Add action")));
@ -698,7 +699,7 @@ if (isset($dont_display_alert_create_bttn))
if ($dont_display_alert_create_bttn)
$display_create = false;
if ($display_create && check_acl ($config['id_user'], 0, "LW")){
if ($display_create && check_acl ($config['id_user'], 0, "LW")) {
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">';
html_print_submit_button (__('Create'), 'crtbtn', false, 'class="sub next"');

View File

@ -84,7 +84,7 @@ if ($create_alert) {
$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));
"tagente_modulo","id_agente_modulo", $id_agent_module));
// Audit the creation only when the alert creation is correct
if ($id) {
@ -124,7 +124,8 @@ if ($delete_alert) {
$id_agent_module = $temp["id_agent_module"];
$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);
$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);

View File

@ -231,8 +231,8 @@ $search_string = (string) get_parameter ('search_string');
$search_type = (string) get_parameter ('search_type');
$table->width = '98%';
if (defined("METACONSOLE")){
$table->width = '96%';
if (defined("METACONSOLE")) {
$table->width = '96%';
$table->class = 'databox_filters';
$table->cellspacing = 0;
$table->cellpadding = 0;
@ -242,7 +242,7 @@ $table->data = array ();
$table->head = array ();
$table->style = array ();
if (!defined("METACONSOLE")){
if (!defined("METACONSOLE")) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
}
@ -258,13 +258,13 @@ $table->data[0][4] .= html_print_submit_button (__('Search'), 'search', false,
'class="sub search"', true);
$table->data[0][4] .= '</div>';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$filter = '<form class="filters_form" method="post" action="' . $url . '">';
$filter .= html_print_table ($table,true);
$filter .= '</form>';
ui_toggle($filter, __("Show Options"));
}
else{
else {
echo '<form method="post" action="' . $url . '">';
html_print_table ($table);
echo '</form>';

View File

@ -431,13 +431,18 @@ $table->style[1] = 'width: 30%;';
$table->style[2] = '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[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[0] = __('Field') .
ui_print_help_tip(__('Fields configured on the command associated to the 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();

View File

@ -302,14 +302,18 @@ $(document).ready (function () {
// Replace the old column with the new
$table_macros_field.replaceWith(field_row);
if (old_value != '' || old_recovery_value != ''){
if (old_value != '' || old_recovery_value != '') {
$("[name=field" + i + "_value]").val(old_value);
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
}
else {
$("[name=field" + i + "_value]").val($("[name=field" + i + "_value]").val());
$("[name=field" + i + "_recovery_value]").val($("[name=field" + i + "_recovery_value]").val());
}
$("[name=field" + i + "_value]")
.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
if (i == 1) {
var td_content = $table_macros_field.find('td').eq(0);

View File

@ -119,7 +119,7 @@ if (!empty($fields_values)) {
}
$table->width = '98%';
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if ($id) {
@ -133,7 +133,7 @@ if (defined('METACONSOLE')){
$table->headstyle[0] = 'text-align: center';
}
$table->style = array ();
if (!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
}

View File

@ -538,16 +538,18 @@ if ($step == 2) {
$table->data[4][0] = __('Default action');
$usr_groups = implode(',', array_keys(users_get_groups($config['id_user'], 'LM', true)));
switch ($config['dbtype']){
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
$sql_query = sprintf('SELECT id, name
$sql_query = sprintf('
SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name', $usr_groups);
break;
case "oracle":
$sql_query = sprintf('SELECT id,
$sql_query = sprintf('
SELECT id,
dbms_lob.substr(name,4000,1) AS nombre
FROM talert_actions
WHERE id_group IN (%s)
@ -557,7 +559,8 @@ if ($step == 2) {
$table->data[4][1] = html_print_select_from_sql ($sql_query,
'default_action', $default_action, '', __('None'), 0,
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][1] = html_print_select (alerts_get_alert_templates_types (), 'type',

View File

@ -89,13 +89,14 @@ $result = false;
$result = categories_get_all_categories ();
// Form to add new categories or search categories
if(!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
echo "<table border=0 cellpadding=4 cellspacing=4 class='databox' width=98%>";
echo "<tr>";
echo "<td align=right>";
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_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 "</td>";
echo "</tr>";
@ -133,12 +134,12 @@ if (!empty($result)) {
$data = array ();
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$data[0] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=" . $category["id"] . "&pure=" . (int)$config['pure'] . "'>" . $category["name"] . "</a>";
$data[1] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=".$category["id"] . "&pure=" . (int)$config['pure'] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a>&nbsp;&nbsp;";
$data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category["id"] . '&pure='.(int)$config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
}
else{
else {
$data[0] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=" . $category["id"] . "&pure=" . (int)$config['pure'] . "'>" . $category["name"] . "</a>";
$data[1] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category["id"] . "&pure=" . (int)$config['pure'] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a>&nbsp;&nbsp;";
$data[1] .= '<a href="index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category["id"] . '&pure='.(int)$config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
@ -148,7 +149,7 @@ if (!empty($result)) {
html_print_table ($table);
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
echo "<table border=0 cellpadding=0 cellspacing=0 class='' width=100%>";
echo "<tr>";
echo "<td align=right>";

View File

@ -42,7 +42,7 @@ if(defined('METACONSOLE')) {
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int)$config['pure'].'">' .
html_print_image ("images/list.png", true, array ("title" => __('List categories'))) .'</a>'));
}
else{
else {
$buttons = array(
'list' => array(
'active' => false,
@ -112,7 +112,7 @@ if ($create_category) {
// Get results when update action is performed
if ($action == "update" && $id_category != 0) {
$result_category = db_get_row_filter('tcategory', array('id' => $id_category));
$name_category = $result_category["name"];
$name_category = $result_category["name"];
} // If current action is create (new) or somethig goes wrong fields are filled with void value
else {
$name_category = "";
@ -131,7 +131,7 @@ if(!defined('METACONSOLE'))
echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=100%>";
else
echo "<table border=0 cellpadding=4 cellspacing=4 class='databox data' width=100%>";
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
if ($action == "update") {
echo "<thead>
<tr>
@ -162,17 +162,18 @@ else
echo "<td>";
else
echo "<td align=center>";
html_print_input_text ('name_category', $name_category);
html_print_input_text ('name_category', $name_category);
echo "</td>";
echo "</tr>";
if(!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
echo "<tr>";
if ($action == "update") {
echo "<td align=center>";
html_print_input_hidden ('update_category', 1);
echo "</td>";
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>";
}
if ($action == "new") {
@ -186,17 +187,19 @@ else
echo "</tr>";
}
echo "</table>";
if(defined('METACONSOLE')){
if (defined('METACONSOLE')) {
echo "<table border=0 cellpadding=0 cellspacing=0 class='' width=100%>";
echo "<tr>";
echo "<td align=right>";
if ($action == "update") {
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") {
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 "</tr>";

View File

@ -61,7 +61,7 @@ $time["3month"] = $time["all"] - SECONDS_3MONTHS;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
if (isset($_POST["purgedb"])){ # Fixed 2005-1-13, nil
if (isset($_POST["purgedb"])) { # Fixed 2005-1-13, nil
$from_date = get_parameter_post("date_purge");
$deleted = db_process_sql_delete('tsesion', array('utimestamp' => '< ' . $from_date));

View File

@ -16,9 +16,10 @@
// Load global vars
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")) {
db_pandora_audit("ACL Violation", "Trying to access Database Management Event");
@ -29,10 +30,11 @@ if (! check_acl ($config['id_user'], 0, "DM")) {
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
if (isset ($_POST["date_purge"])){
if (isset ($_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) {
ui_print_success_message(__('Successfully deleted old events'));
@ -43,7 +45,11 @@ if (isset ($_POST["date_purge"])){
}
# 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->cellpadding = 4;

View File

@ -18,7 +18,7 @@
// Load global vars
global $config;
require_once ($config["homedir"] . '/include/functions_graph.php');
require_once ($config["homedir"] . '/include/functions_graph.php');
require_once($config['homedir'] . "/include/functions_agents.php");
require_once($config['homedir'] . "/include/functions_modules.php");
@ -61,9 +61,9 @@ $time["3month"] = $time["all"] - SECONDS_3MONTHS;
$data["1day"] = 0;
$data["3day"] = 0;
$data["1week"] = 0;
$data["2week"] = 0;
$data["1month"] = 0;
$data["3month"] = 0;
$data["2week"] = 0;
$data["1month"] = 0;
$data["3month"] = 0;
$data["total"] = 0;
@ -164,7 +164,7 @@ if (isset($_POST["purgedb"])) {
# Select Agent for further operations.
$agents = agents_get_group_agents (0, true);
$agents[-1] = __('Choose agent');
$agents[0] = __('All agents');
$agents[0] = __('All agents');
echo '<form action="index.php?sec=gdbman&sec2=godmode/db/db_purge" method="post">';
echo '<div style="width:100%;">';
@ -172,7 +172,7 @@ html_print_select ($agents, "agent", $id_agent, "this.form.submit();", "", "", f
ui_print_help_tip (__("Select the agent you want information about"));
echo '<noscript>';
html_print_submit_button (__('Get data'), 'purgedb_ag', false, 'class="sub upd"');
ui_print_help_tip (__("Click here to get the data from the agent specified in the select box"));
ui_print_help_tip (__("Click here to get the data from the agent specified in the select box"));
echo '</noscript><br />';
if ($id_agent > 0) {

View File

@ -178,12 +178,19 @@ foreach ($fields_available as $key=>$available) {
$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][1] = '<a href="javascript:">'.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[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] .= '<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][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'].'">';
html_print_table($table);
@ -212,7 +219,7 @@ $(document).ready (function () {
$("#left").click (function () {
jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) {
field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>){
if (field_name != <?php echo "'".__('None')."'"; ?>) {
id_field = $(value).attr('value');
$("select[name='fields_available[]']").append($("<option></option>").val(id_field).html('<i>' + field_name + '</i>'));
$("#fields_selected").find("option[value='" + id_field + "']").remove();

View File

@ -54,15 +54,15 @@ if ($id) {
$event_view_hr = $filter['event_view_hr'];
$id_user_ack = $filter['id_user_ack'];
$group_rep = $filter['group_rep'];
$tag_with_json = $filter['tag_with'];
$tag_with_json = $filter['tag_with'];
$tag_with_json_clean = io_safe_output($tag_with_json);
$tag_with_base64 = base64_encode($tag_with_json_clean) ;
$tag_without_json = $filter['tag_without'];
$tag_without_json_clean = io_safe_output($tag_without_json);
$tag_without_base64 = base64_encode($tag_without_json_clean) ;
$filter_only_alert = $filter['filter_only_alert'];
}
else {
@ -317,7 +317,7 @@ if (defined("METACONSOLE")) {
$table->data[13][1] .= html_print_input_hidden('tag_without',
$tag_without_base64, true);
}
else{
else {
$table->colspan[13][0] = '2';
$table->data[13][0] = '<b>' . __('Events with following tags') . '</b>';

View File

@ -28,7 +28,7 @@ if (! check_acl ($config["id_user"], 0, "EW")) {
$delete = (bool) get_parameter ('delete', 0);
$multiple_delete = (bool)get_parameter('multiple_delete', 0);
if ($delete){
if ($delete) {
$id = (int) get_parameter('id');

View File

@ -14,7 +14,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
global $config;
check_login ();

View File

@ -14,7 +14,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
global $config;
check_login ();

View File

@ -14,7 +14,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
global $config;
check_login ();

View File

@ -182,9 +182,9 @@ foreach ($extensions as $file => $extension) {
$data = array();
$on = html_print_image("images/dot_green.png", true);
$off = html_print_image("images/dot_red.png", true);
$off = html_print_image("images/dot_red.png", true);
if (!$extension['enabled']) {
$on = html_print_image("images/dot_green.disabled.png", true);
$on = html_print_image("images/dot_green.disabled.png", true);
$off = html_print_image("images/dot_red.disabled.png", true);
$data[] = '<i style="color: grey;">' . $file . '</i>';

View File

@ -85,13 +85,13 @@ $table->data = array();
$defaultMapId = null;
if ($maps){
if ($maps) {
$own_info = get_user_info($config['id_user']);
foreach ($maps as $map) {
if (!check_acl ($config["id_user"], $map["group_id"], "IW")) {
continue;
}
$checked = false;
if ($map['default_map']) {
$checked = true;

View File

@ -98,7 +98,7 @@ else {
$table->width = '98%';
if (defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$table->width = '100%';
$table->class = 'databox data';
if ($id_group)
@ -122,7 +122,7 @@ foreach ($files as $key => $f) {//Remove from the list the non-desired .png file
$table->data[1][1] = html_print_select ($files, 'icon', $icon, '', 'None', '', true);
$table->data[1][1] .= ' <span id="icon_preview">';
if ($icon) {
$table->data[1][1] .= html_print_image("images/groups_small/".$icon, true);
$table->data[1][1] .= html_print_image("images/groups_small/".$icon, true);
}
$table->data[1][1] .= '</span>';
@ -152,7 +152,7 @@ else {
if ($acl_parent) {
$table->data[2][1] .= ' <span id="parent_preview">';
$table->data[2][1] .= html_print_image("images/groups_small/".groups_get_icon ($id_parent).".png", true);
$table->data[2][1] .= html_print_image("images/groups_small/".groups_get_icon ($id_parent).".png", true);
$table->data[2][1] .= '</span>';
}
@ -264,5 +264,5 @@ function parent_changed () {
$(document).ready (function () {
$('#icon').change (icon_changed);
$('#id_parent').change (parent_changed);
});
});
</script>

View File

@ -149,7 +149,7 @@ if (defined('METACONSOLE')) {
echo '<div class="notify">';
echo __("Edit or delete groups can cause problems with synchronization");
echo '</div>';
echo '</div>';
}
else {
@ -198,7 +198,7 @@ if (($create_group) && (check_acl($config['id_user'], 0, "PM"))) {
$result = db_process_sql_insert('tgrupo', $values);
if ($result) {
ui_print_success_message(__('Group successfully created'));
ui_print_success_message(__('Group successfully created'));
}
else {
ui_print_error_message(__('There was a problem creating group'));
@ -323,11 +323,12 @@ foreach ($all_parents as $parent) {
$groups_count = count($groups);
if (check_acl($config['id_user'], 0, "PM")) {
if (!defined("METACONSOLE")){
if (!defined("METACONSOLE")) {
echo '<br />';
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.'">';
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 '</form>';
}

View File

@ -71,7 +71,7 @@ if ($create_group) {
$result = db_process_sql_insert('tmodule_group', array('name' => $name));
if ($result) {
ui_print_success_message(__('Group successfully created'));
ui_print_success_message(__('Group successfully created'));
}
else {
ui_print_error_message(__('There was a problem creating group'));
@ -132,7 +132,7 @@ if ($delete_group) {
}
if (! $result)
ui_print_error_message(__('There was a problem deleting group'));
ui_print_error_message(__('There was a problem deleting group'));
else
ui_print_success_message(__('Group successfully deleted'));
}

View File

@ -262,11 +262,11 @@ $(document).ready (function () {
$("#id_group").click (
function () {
$(this).css ("width", "auto");
$(this).css ("width", "auto");
});
$("#id_group").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
$("#id_agents").click (
@ -275,16 +275,16 @@ $(document).ready (function () {
});
$("#id_agents").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
$("#module").click (
function () {
$(this).css ("width", "auto");
$(this).css ("width", "auto");
});
$("#module").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
$("#modules_selection_mode").change (function() {

View File

@ -215,11 +215,11 @@ $(document).ready (function () {
$("#id_group").click (
function () {
$(this).css ("width", "auto");
$(this).css ("width", "auto");
});
$("#id_group").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
$("#id_agents").click (
@ -228,16 +228,16 @@ $(document).ready (function () {
});
$("#id_agents").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
$("#module").click (
function () {
$(this).css ("width", "auto");
$(this).css ("width", "auto");
});
$("#module").blur (function () {
$(this).css ("width", "180px");
$(this).css ("width", "180px");
});
$("#modules_selection_mode").change (function() {

View File

@ -74,11 +74,11 @@ $table->data[0][1] = html_print_select_groups(false, "AW", true, 'source_id_grou
$table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox ("source_recursion", 1, $source_recursion, true, false);
$status_list = array ();
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[0][4] = __('Status');
$table->data[0][5] = html_print_select($status_list,
@ -185,11 +185,11 @@ $table->data[0][3] = html_print_checkbox ("destiny_recursion", 1,
$destiny_recursion, true, false);
$status_list = array ();
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select($status_list,

View File

@ -109,11 +109,11 @@ $table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion,
true, false);
$status_list = array ();
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select($status_list, 'status_agents', 'selected',

View File

@ -303,11 +303,11 @@ $table->rowclass['form_agents_2'] = 'select_agents_row';
$table->data['form_agents_2'][0] = __('Status');
$table->colspan['form_agents_2'][1] = 2;
$status_list = array ();
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data['form_agents_2'][1] = html_print_select($status_list,
'status_agents', 'selected', '', __('All'), AGENT_STATUS_ALL, true);

View File

@ -205,11 +205,11 @@ $table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion,
$status_list = array ();
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select($status_list, 'status_agents', 'selected',

View File

@ -288,11 +288,11 @@ $table->rowclass['form_agents_2'] = 'select_agents_row';
$table->data['form_agents_2'][0] = __('Status');
$table->colspan['form_agents_2'][1] = 2;
$status_list = array ();
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data['form_agents_2'][1] = html_print_select($status_list,
'status_agents', 'selected', '', __('All'), AGENT_STATUS_ALL, true);

View File

@ -306,7 +306,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
}
else{
else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
@ -316,7 +316,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
}
}
else{
else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];

View File

@ -45,7 +45,7 @@ else {
}
$table->width = '98%';
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if ($id) {

View File

@ -262,7 +262,7 @@ if ($update_component) {
$custom_string_1 = $snmp3_privacy_method;
$custom_string_2 = $snmp3_privacy_pass;
$custom_string_3 = $snmp3_security_level;
//$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
//$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
}
if (!empty($name)) {
@ -442,12 +442,12 @@ $search_id_group = (int) get_parameter ('search_id_group');
$search_string = (string) get_parameter ('search_string');
$table->width = '98%';
if(defined("METACONSOLE")){
if(defined("METACONSOLE")) {
$table->width = '50%';
$table->class = 'databox_filters';
}
$table->style = array ();
if (!defined('METACONSOLE')){
if (!defined('METACONSOLE')) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
}
@ -501,14 +501,14 @@ $table->data[0][4] .= html_print_submit_button (__('Search'), 'search', false,
'class="sub search"', true);
$table->data[0][4] .= '</div>';
if(defined("METACONSOLE")){
if (defined("METACONSOLE")) {
$filter = '<form class="filters_form" method="post" action="'.$url.'">';
$filter .= html_print_table ($table,true);
$filter .= '</form>';
ui_toggle($filter, __("Show Options"));
}
else{
echo '<form method="post" action="'.$url.'">';
else {
echo '<form method="post" action="' . $url . '">';
html_print_table ($table);
echo '</form>';
}
@ -517,7 +517,10 @@ $filter = array ();
if ($search_id_group)
$filter['id_group'] = $search_id_group;
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 = $total_components[0]['total'];

View File

@ -233,7 +233,7 @@ else {
echo '<form name="component" method="post">';
/* $table came from manage_network_components_form_common.php */
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
if ($id) {

View File

@ -225,7 +225,7 @@ else {
echo '<form method="post" action="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates_form">';
echo '<div style="width: '.$table->width.'" class="action-buttons">';
html_print_submit_button (__('Create'), "crt", '', 'class="sub next"');
html_print_submit_button (__('Create'), "crt", '', 'class="sub next"');
echo '</div></form>';
?>

View File

@ -267,10 +267,18 @@ if ($id_np > 0) {
$group_filter .= '</div></form>';
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 {
$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);

View File

@ -49,7 +49,7 @@ else {
ui_meta_print_page_header($nav_bar);
ui_meta_print_header(__("Netflow filters"));
ui_meta_print_header(__("Netflow filters"));
}
$delete = (bool) get_parameter ('delete');
@ -81,7 +81,7 @@ if ($multiple_delete) {
$ids = (array)get_parameter('delete_multiple', array());
foreach ($ids as $id) {
$id_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id);
$id_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id);
$result = db_process_sql_delete ('tnetflow_filter',
array ('id_sg' => $id));
@ -112,7 +112,7 @@ if ($filters === false)
$filters = array ();
$table->width = '90%';
if (defined('METACONSOLE')){
if (defined('METACONSOLE')) {
$table->width = '100%';
}
$table->head = array ();

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