Merge branch 'develop' into feature/#1978-REESCRITURA_DEL_MOTOR_DE_INFORMES
Conflicts: pandora_console/godmode/reporting/reporting_builder.item_editor.php pandora_console/include/functions_reporting.php
This commit is contained in:
commit
73e0a74a1a
|
@ -102,7 +102,7 @@ noscript {
|
|||
.termframe {
|
||||
float: left;
|
||||
padding: 0.2ex;
|
||||
background-color: none repeat scroll 0% 0% #82B92E;
|
||||
background-color: none repeat scroll 0% 0% #80BA27;
|
||||
border-top-right-radius: 5px;
|
||||
border-top-left-radius: 5px;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 6.0dev-150329
|
||||
Version: 6.0dev-150506
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="6.0dev-150329"
|
||||
pandora_version="6.0dev-150506"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -41,7 +41,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '6.0dev';
|
||||
use constant AGENT_BUILD => '150329';
|
||||
use constant AGENT_BUILD => '150506';
|
||||
|
||||
# Commands to retrieve total memory information in kB
|
||||
use constant TOTALMEMORY_CMDS => {
|
||||
|
@ -754,8 +754,31 @@ sub read_config (;$) {
|
|||
$RemoteConfFile = "$AgentMD5.conf";
|
||||
$RemoteMD5File = "$AgentMD5.md5";
|
||||
|
||||
# Set the maximun number of threads
|
||||
$ThreadSem = Thread::Semaphore->new ($Conf{'agent_threads'}) if defined ($Sem);
|
||||
# Load thread support if agent_threads is greater than 1.
|
||||
if ($Conf{'agent_threads'} > 1) {
|
||||
eval {
|
||||
local $SIG{__DIE__};
|
||||
require threads;
|
||||
require threads::shared;
|
||||
require Thread::Semaphore;
|
||||
};
|
||||
if (!$@) {
|
||||
$Sem = Thread::Semaphore->new;
|
||||
$ThreadSem = Thread::Semaphore->new ($Conf{'agent_threads'});
|
||||
threads::shared::share (\$Xml);
|
||||
threads::shared::share (\$Sem);
|
||||
log_message ('log', 'Using thread library.');
|
||||
} else {
|
||||
log_message ('log', 'Thread library is not available. agent_threads is set to 1 (disabled).');
|
||||
$Conf{'agent_threads'} = 1;
|
||||
$Sem = undef;
|
||||
$ThreadSem = undef;
|
||||
}
|
||||
} else {
|
||||
$Sem = undef;
|
||||
$ThreadSem = undef;
|
||||
log_message ('log', 'Thread is disabled.');
|
||||
}
|
||||
|
||||
# Set tentacle client options
|
||||
if ($Conf{'transfer_mode'} eq 'tentacle') {
|
||||
|
@ -975,6 +998,8 @@ sub launch_tentacle_proxy () {
|
|||
#Execute tentacle server as a daemon
|
||||
my $new_process = "tentacle_server -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'};
|
||||
|
||||
$new_process .= ' -C' if ($Conf{'server_ssl'} eq 'yes');
|
||||
|
||||
log_message ('setup', 'Proxy mode enabled');
|
||||
exec ($new_process);
|
||||
}
|
||||
|
@ -2062,27 +2087,6 @@ error ("Temporal directory '" . $Conf{'temporal'} . "' does not exist.") unless
|
|||
$Conf{'server_path'} = fix_directory ($Conf{'server_path'});
|
||||
$Conf{'secondary_server_path'} = fix_directory ($Conf{'secondary_server_path'});
|
||||
|
||||
# Load thread support if agent_threads is greater than 1.
|
||||
if ($Conf{'agent_threads'} > 1) {
|
||||
eval {
|
||||
local $SIG{__DIE__};
|
||||
require threads;
|
||||
require threads::shared;
|
||||
require Thread::Semaphore;
|
||||
};
|
||||
if (!$@) {
|
||||
$Sem = Thread::Semaphore->new;
|
||||
threads::shared::share (\$Xml);
|
||||
threads::shared::share (\$Sem);
|
||||
log_message ('log', 'Using thread library.');
|
||||
} else {
|
||||
log_message ('log', 'Thread library is not available. agent_threads is set to 1 (disabled).');
|
||||
$Conf{'agent_threads'} = 1;
|
||||
}
|
||||
} else {
|
||||
log_message ('log', 'Thread is disabled.');
|
||||
}
|
||||
|
||||
# Startup delay
|
||||
log_message ('log', 'Sleeping for ' . $Conf{'delayed_startup'} . ' seconds.') if ($Conf{'delayed_startup'} > 0);
|
||||
sleep ($Conf{'delayed_startup'});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 6.0dev
|
||||
%define release 150329
|
||||
%define release 150506
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 6.0dev
|
||||
%define release 150329
|
||||
%define release 150506
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -47,9 +47,9 @@ pidof_pandora () {
|
|||
fi
|
||||
if [ "$ZONE" = "global" ]
|
||||
then
|
||||
PANDORA_PID=`ps -f -z global | grep "$TRUNCATED_DAEMON" | grep -v grep | head -1 | awk '{ print $2 }'`
|
||||
PANDORA_PID=`ps -f -z global | grep "$TRUNCATED_DAEMON" | grep -v grep | awk '{ print $2 }'`
|
||||
else
|
||||
PANDORA_PID=`ps -Af | grep "$TRUNCATED_DAEMON" | grep -v grep | head -1 | awk '{ print $2 }'`
|
||||
PANDORA_PID=`ps -Af | grep "$TRUNCATED_DAEMON" | grep -v grep | awk '{ print $2 }'`
|
||||
fi
|
||||
elif [ "$OS_NAME" = "Linux" ] && [ -x /usr/sbin/vzpid ]
|
||||
then
|
||||
|
@ -66,7 +66,7 @@ pidof_pandora () {
|
|||
fi
|
||||
done
|
||||
else
|
||||
PANDORA_PID=`ps -Af | grep "$DAEMON $PANDORA_PATH" | grep -v grep | head -1 | awk '{ print $2 }'`
|
||||
PANDORA_PID=`ps -Af | grep "$DAEMON $PANDORA_PATH" | grep -v grep | awk '{ print $2 }'`
|
||||
fi
|
||||
|
||||
echo $PANDORA_PID
|
||||
|
@ -90,7 +90,14 @@ case "$1" in
|
|||
su $PANDORA_USER -c "PATH=$PATH nohup $DAEMON $PANDORA_PATH >/dev/null 2>$LOGFILE &"
|
||||
sleep 2
|
||||
PANDORA_PID=`pidof_pandora`
|
||||
echo "Pandora FMS Agent is now running with PID $PANDORA_PID"
|
||||
if [ "$PANDORA_PID" = "" ]
|
||||
then
|
||||
|
||||
echo "Pandora FMS Agent could not be started. Please check the file $LOGFILE."
|
||||
exit 1
|
||||
else
|
||||
echo "Pandora FMS Agent is now running with PID $PANDORA_PID"
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
|
|
@ -171,6 +171,9 @@ my $t_proxy_socket;
|
|||
# Proxy selected handler
|
||||
my $t_proxy_select;
|
||||
|
||||
# Use SSL for proxy, 1 true, 0 false
|
||||
my $t_proxy_ssl = 0;
|
||||
|
||||
# Use libwrap, 1 true, 0 false
|
||||
my $t_use_libwrap = 0;
|
||||
|
||||
|
@ -206,11 +209,12 @@ sub print_help {
|
|||
print ("\t-t time\t\tTime-out for network operations in seconds (default ${t_timeout}s).\n");
|
||||
print ("\t-v\t\tBe verbose.\n");
|
||||
print ("\t-w\t\tPrompt for OpenSSL private key password.\n");
|
||||
print ("\t-x pwd\t\tServer password.\n\n");
|
||||
print ("\t-b proxy_ip_address\t\tProxied server address.\n\n");
|
||||
print ("\t-g proxy_port\t\tPort of proxied server.\n\n");
|
||||
print ("\t-x pwd\t\tServer password.\n");
|
||||
print ("\t-b proxy_ip_address\tProxied server address.\n");
|
||||
print ("\t-g proxy_port\t\tPort of proxied server.\n");
|
||||
print ("\t-C\t\tEnable SSL for proxy connection without a client certificate.\n");
|
||||
print ("\t-T\t\tEnable tcpwrappers support.\n");
|
||||
print ("\t\t(To use this option, 'Authen::Libwrap' should be installed.)\n\n");
|
||||
print ("\t\t\t(To use this option, 'Authen::Libwrap' should be installed.)\n\n");
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
@ -256,7 +260,7 @@ sub parse_options {
|
|||
my @t_addresses_tmp;
|
||||
|
||||
# Get options
|
||||
if (getopts ('a:b:c:de:f:g:hi:k:m:op:qr:s:S:t:Tvwx:', \%opts) == 0 || defined ($opts{'h'})) {
|
||||
if (getopts ('a:b:c:Cde:f:g:hi:k:m:op:qr:s:S:t:Tvwx:', \%opts) == 0 || defined ($opts{'h'})) {
|
||||
print_help ();
|
||||
exit 1;
|
||||
}
|
||||
|
@ -444,6 +448,15 @@ sub parse_options {
|
|||
}
|
||||
}
|
||||
|
||||
# Enable SSL without a client certificate
|
||||
if (defined ($opts{'C'})) {
|
||||
|
||||
require IO::Socket::SSL;
|
||||
|
||||
$t_proxy_ssl = 1;
|
||||
}
|
||||
|
||||
|
||||
# TCP wrappers support
|
||||
if (defined ($opts{'T'})) {
|
||||
if ($t_libwrap_installed) {
|
||||
|
@ -658,6 +671,30 @@ sub start_ssl {
|
|||
print_log ("SSL started for " . $t_client_socket->sockhost ());
|
||||
}
|
||||
|
||||
################################################################################
|
||||
## SUB start_proxy_ssl
|
||||
## Convert the proxy socket to an IO::Socket::SSL socket.
|
||||
################################################################################
|
||||
sub start_proxy_ssl {
|
||||
my $err;
|
||||
|
||||
if ($t_proxy_ssl != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
IO::Socket::SSL->start_SSL (
|
||||
$t_proxy_socket,
|
||||
SSL_verify_mode => 0x00,
|
||||
);
|
||||
|
||||
$err = IO::Socket::SSL::errstr ();
|
||||
if ($err ne '') {
|
||||
error ($err);
|
||||
}
|
||||
|
||||
print_log ("proxy SSL started for " . $t_proxy_socket->sockhost ());
|
||||
}
|
||||
|
||||
################################################################################
|
||||
## SUB accept_connections
|
||||
## Manage incoming connections.
|
||||
|
@ -749,6 +786,11 @@ sub serve_proxy_connection {
|
|||
|
||||
# Start a connection with the other Tentacle Server
|
||||
open_proxy();
|
||||
|
||||
# Start SSL for proxy
|
||||
if ($t_proxy_ssl == 1) {
|
||||
start_proxy_ssl();
|
||||
}
|
||||
|
||||
my $command;
|
||||
|
||||
|
@ -1582,6 +1624,14 @@ __END__
|
|||
|
||||
=item I<-x> pwd B<Server password>.
|
||||
|
||||
=item I<-b proxy_ip_address> B<Proxied server> address.
|
||||
|
||||
=item I<-g proxy_port> B<Port> of proxied server.
|
||||
|
||||
=item I<-C> Enable SSL for proxy without a client certificate.
|
||||
|
||||
=item I<-T> Enable tcpwrappers support ('Authen::Libwrap' required).
|
||||
|
||||
=back
|
||||
|
||||
=head1 EXIT STATUS
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
server_ip $ServerIP$
|
||||
server_path /var/spool/pandora/data_in
|
||||
temporal "$AgentTemp$"
|
||||
temporal "C:\Program Files\pandora_agent\temp"
|
||||
|
||||
#include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf"
|
||||
#broker_agent name_agent
|
||||
|
@ -47,7 +47,7 @@ address auto
|
|||
#address 192.168.36.73
|
||||
|
||||
# Group assigned for this agent (descriptive, p.e: Servers)
|
||||
group "$AgentGroup$"
|
||||
group Servers
|
||||
|
||||
# This limits operation if temporal dir has not enough free disk.
|
||||
#temporal_min_size 1024
|
||||
|
@ -191,13 +191,85 @@ module_exec dir "%ProgramFiles%\Avira\AntiVir Desktop\aevdf.dat" | grep aevdf.da
|
|||
module_description Last update for Antivirus Signature file
|
||||
module_end
|
||||
|
||||
# Windows inventory module (This information will be displayed only in enterprise version)
|
||||
# Windows inventory module (This information will be displayed only in enterprise version)^M
|
||||
module_begin
|
||||
module_name Inventory
|
||||
module_interval 7
|
||||
module_type generic_data_string
|
||||
module_inventory CPU RAM CDROM Video HD Patches Services NIC
|
||||
module_description Inventory
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\cpuinfo.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\moboinfo.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\diskdrives.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\cdromdrives.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\videocardinfo.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\ifaces.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\monitors.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\printers.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\raminfo.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\software_installed.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\userslogged.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\productkey.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\productID.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\architecture.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\domain.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
module_begin
|
||||
module_plugin cscript.exe //B "%PROGRAMFILES%\Pandora_Agent\util\osversion.vbs"
|
||||
module_crontab * 12-15 * * 1
|
||||
module_end
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI architecture
|
||||
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Architecture</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set cols = objWMIService.ExecQuery("Select osarchitecture from Win32_OperatingSystem")
|
||||
|
||||
For Each data In cols
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & data.osarchitecture & "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
|
@ -0,0 +1,29 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI CD_ROM_drives_info
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>CDROM</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colCDROMDrives = objWMIService.ExecQuery("Select caption,description,drive,deviceid from win32_CDROMDrive")
|
||||
|
||||
For Each cdromd In colCDROMDrives
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & cdromd.caption _
|
||||
& ";" & cdromd.description _
|
||||
& ";" & cdromd.drive _
|
||||
& ";" & cdromd.deviceid _
|
||||
& "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI cpuinfo
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>CPU</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colCPUs = objWMIService.ExecQuery("Select name,maxclockspeed,caption from Win32_Processor")
|
||||
|
||||
For Each cpu In colCPUs
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & cpu.name & ";" & cpu.maxclockspeed & " MHz;" & cpu.caption & "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI disksinfo
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>HD</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colHDDs = objWMIService.ExecQuery("Select * from win32_diskdrive")
|
||||
|
||||
For Each disco In colHDDs
|
||||
If ((not IsNull(disco.size)) AND (disco.size > 0)) then
|
||||
Wscript.StdOut.Write "<data><![CDATA[" & disco.caption _
|
||||
& ";" & Abs(Round((disco.size/(1024*1024*1024)),2)) & " GB"
|
||||
If (not IsNull(disco.serialnumber)) then
|
||||
Wscript.StdOut.Write ";" & disco.serialnumber
|
||||
Else
|
||||
Wscript.StdOut.Write ";" & disco.signature
|
||||
End If
|
||||
Wscript.StdOut.WriteLine "]]></data>"
|
||||
End If
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI domain/workgroup info
|
||||
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Domain</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
|
||||
Set colItems = objWMIService.ExecQuery("SELECT Domain FROM Win32_ComputerSystem")
|
||||
For Each objItem In colItems
|
||||
WScript.StdOut.WriteLine "<data><![CDATA[" & objItem.Domain & "]]></data>"
|
||||
Next
|
||||
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
|
@ -0,0 +1,42 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI real interfaces info
|
||||
' exlusions:
|
||||
' VBox network interfaces
|
||||
' VMWare network interfaces
|
||||
'
|
||||
'nic where "guid is not null and not PNPDeviceID like 'ROOT%'"
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>NIC</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter " & _
|
||||
"Where not PNPDeviceID like 'ROOT%%' " & _
|
||||
"and not PNPDeviceID like 'SW%%' " & _
|
||||
"and not ServiceName is null " & _
|
||||
"and not ServiceName like 'vwifimp' ")
|
||||
|
||||
For Each iface In colAdapters
|
||||
' return model MACAddress IPAddress
|
||||
|
||||
set ifaces_cfg = objWMIService.ExecQuery("Select ipaddress from Win32_NetworkAdapterConfiguration Where Caption='" & iface.caption & "'")
|
||||
Wscript.StdOut.Write "<data><![CDATA[" & iface.ProductName & ";" & iface.MACAddress & ";"
|
||||
for each iface_cfg in ifaces_cfg
|
||||
if ( iface_cfg.IPAddress(0) <> "" ) then
|
||||
Wscript.StdOut.Write trim(iface_cfg.IPAddress(0))
|
||||
end if
|
||||
next
|
||||
wscript.stdOut.WriteLine "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
|
@ -0,0 +1,26 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI mobo info
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Motherboard</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
'Set colMobos = objWMIService.ExecQuery("Select name,product,manufacturer from Win32_baseboard")
|
||||
Set colMobos2 = objWMIService.ExecQuery("Select manufacturer,model,OEMStringArray from Win32_computersystem")
|
||||
|
||||
For Each mobo In colMobos2
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & mobo.manufacturer & ";" & mobo.model & ";" & mobo.OEMStringArray(0) & "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI monitorsinfo
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Monitors</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colDisplays = objWMIService.ExecQuery("Select caption,pnpdeviceid from win32_desktopmonitor")
|
||||
|
||||
For Each display In colDisplays
|
||||
if (NOT isNull(display.pnpdeviceid)) then
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & display.caption _
|
||||
& ";" & display.pnpdeviceid _
|
||||
& "]]></data>"
|
||||
end if
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI OS version
|
||||
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>OSVersion</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set cols = objWMIService.ExecQuery("SELECT version from win32_operatingsystem")
|
||||
|
||||
For Each data In cols
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & data.version & "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
|
@ -0,0 +1,59 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
On Error Resume Next
|
||||
|
||||
'WMI printers attached
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Printers</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
function validPort(port)
|
||||
if strComp(port,"SHRFAX:") = 0 then
|
||||
validPort = false
|
||||
elseif strComp(port,"nul:") = 0 then
|
||||
validPort = false
|
||||
elseif strComp(port,"PORTPROMPT:") = 0 then
|
||||
validPort = false
|
||||
elseif strComp(port,"XPSPort:") = 0 then
|
||||
validPort = false
|
||||
elseif strComp(port,"PDF:") = 0 then
|
||||
validPort = false
|
||||
else
|
||||
validPort = true
|
||||
end if
|
||||
end function
|
||||
|
||||
Set oWMI = GetObject("winmgmts:\\" & "." & "\root\cimv2")
|
||||
Set colPrinters = oWMI.ExecQuery("Select * from Win32_Printer",,48)
|
||||
|
||||
For Each objPrinter in colPrinters
|
||||
if validPort (objPrinter.PortName) then
|
||||
set tcp_port_exists = 0
|
||||
WScript.stdOut.Write "<data><![CDATA[" & _
|
||||
objPrinter.DeviceID & ";" & _
|
||||
objPrinter.DriverName & ";"
|
||||
If (objPrinter.Local) Then
|
||||
Set colPorts = oWMI.ExecQuery("Select HostAddress from Win32_TCPIPPrinterPort where Name like '" & objPrinter.PortName & "'",,48)
|
||||
For Each objPort in colPorts
|
||||
tcp_port_exists = 1
|
||||
Wscript.stdOut.Write objPort.HostAddress
|
||||
Next
|
||||
If (tcp_port_exists = 0) Then
|
||||
Wscript.stdOut.Write objPrinter.PortName
|
||||
End If
|
||||
Else
|
||||
Wscript.stdOut.Write objPrinter.ServerName
|
||||
End If
|
||||
wscript.stdOut.WriteLine "]]></data>"
|
||||
end if
|
||||
Next
|
||||
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
|
@ -0,0 +1,24 @@
|
|||
' windows_product_key.vbs
|
||||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Sancho Lerena <slerena@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' ----------------------------------------------------------------
|
||||
on error resume next
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>product_ID</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
Set oShell = WScript.CreateObject ("WScript.Shell")
|
||||
Set objExec = oShell.Exec("cmd.exe /C wmic os get ""SerialNumber"" | find /v ""SerialNumber"" ")
|
||||
Do
|
||||
line = objExec.StdOut.ReadLine()
|
||||
s = s & line
|
||||
Loop While Not objExec.Stdout.atEndOfStream
|
||||
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & Replace(Replace(s, chr(013), ""), chr(010), "") & "]]></data>"
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
|
@ -0,0 +1,25 @@
|
|||
' windows_product_key.vbs
|
||||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Sancho Lerena <slerena@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' ----------------------------------------------------------------
|
||||
|
||||
on error resume next
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>product_key</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colProducts = objWMIService.ExecQuery("Select OA3xOriginalProductKey from SoftwareLicensingService")
|
||||
|
||||
For Each product In colProducts
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & product.OA3xOriginalProductKey & "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
|
@ -0,0 +1,28 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI raminfo
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>RAM</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colRAMs = objWMIService.ExecQuery("Select deviceLocator,capacity,speed from Win32_PhysicalMemory")
|
||||
|
||||
For Each ram In colRAMs
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & ram.deviceLocator _
|
||||
& ";" & Abs(Round((ram.capacity/(1024*1024)),2)) & " MB" _
|
||||
& ";" & ram.speed & " MHz"_
|
||||
& "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
|
@ -1,72 +1,141 @@
|
|||
' software_inventory.vbs
|
||||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2014 Sancho Lerena <slerena@artica.es>
|
||||
' (c) 2015 Sancho Lerena <slerena@artica.es>
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' ----------------------------------------------------------------
|
||||
' usage: cscript //B software_inventory.vbs
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
|
||||
Class ObjectList
|
||||
Public List
|
||||
|
||||
Sub Class_Initialize()
|
||||
Set List = CreateObject("Scripting.Dictionary")
|
||||
End Sub
|
||||
|
||||
Sub Class_Terminate()
|
||||
Set List = Nothing
|
||||
End Sub
|
||||
|
||||
Function Append(Anything)
|
||||
List.Add CStr(List.Count + 1), Anything
|
||||
Set Append = Anything
|
||||
End Function
|
||||
|
||||
Function Item(id)
|
||||
If List.Exists(CStr(id)) Then
|
||||
Set Item = List(CStr(id))
|
||||
Else
|
||||
Set Item = Nothing
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
|
||||
class AppClass
|
||||
dim InstallDate,Caption,Version,Vendor
|
||||
end class
|
||||
|
||||
' Print the XML structure
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine"<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>software</name>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Software</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
'------ Checks if an item exists on the main collection
|
||||
function isItemInArray(objeto,coleccion)
|
||||
for each id in coleccion.List
|
||||
if (strComp(objeto,coleccion.List(id).caption) = 0) then
|
||||
isItemInArray=true
|
||||
exit function
|
||||
end if
|
||||
next
|
||||
isItemInArray=false
|
||||
end function
|
||||
|
||||
'------ main collection definition
|
||||
dim colObjSW : set colObjSW = new ObjectList
|
||||
strComputer = "."
|
||||
|
||||
'------ Retrieve the WMI registers first
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colSoftware = objWMIService.ExecQuery ("SELECT installstate,caption,installdate,Version,vendor FROM Win32_Product")
|
||||
|
||||
|
||||
'------ Check all
|
||||
'-- first) add all unique WMI (unique) entries to main collector
|
||||
'-- second) add all unique REGISTRY items to main collector
|
||||
|
||||
for each objSoftware in colSoftware
|
||||
if ( objSoftware.installstate = 5 ) then
|
||||
if ( isItemInArray(objSoftware.caption, colObjSW) = false ) then
|
||||
' It doesn't exists, added.
|
||||
With colObjSW.Append(New AppClass)
|
||||
.caption = objSoftware.caption
|
||||
.InstallDate = objSoftware.InstallDate
|
||||
.version = objSoftware.version
|
||||
.vendor = objSoftware.vendor
|
||||
End with
|
||||
' Add to XML the verified ones
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" _
|
||||
& objSoftware.caption & ";" _
|
||||
& objSoftware.version _
|
||||
& "]]></data>"
|
||||
end if
|
||||
end if
|
||||
next
|
||||
|
||||
' ------ Getting the REGISTRY
|
||||
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
|
||||
strComputer = "."
|
||||
|
||||
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
|
||||
strEntry1a = "DisplayName"
|
||||
strEntry1b = "QuietDisplayName"
|
||||
strEntry2 = "InstallDate"
|
||||
strEntry3 = "VersionMajor"
|
||||
strEntry4 = "VersionMinor"
|
||||
strEntry5 = "EstimatedSize"
|
||||
strEntry3 = "DisplayVersion"
|
||||
|
||||
Set objReg = GetObject("winmgmts://" & strComputer & _
|
||||
"/root/default:StdRegProv")
|
||||
Set objReg = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv")
|
||||
objReg.EnumKey HKLM, strKey, arrSubkeys
|
||||
|
||||
For Each strSubkey In arrSubkeys
|
||||
|
||||
appname = ""
|
||||
appsize = ""
|
||||
appversion = ""
|
||||
appdate = ""
|
||||
|
||||
intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _
|
||||
strEntry1a, strValue1)
|
||||
intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, strEntry1a, strValue1)
|
||||
If intRet1 <> 0 Then
|
||||
objReg.GetStringValue HKLM, strKey & strSubkey, _
|
||||
strEntry1b, strValue1
|
||||
objReg.GetStringValue HKLM, strKey & strSubkey, strEntry1b, strValue1
|
||||
End If
|
||||
If strValue1 <> "" Then
|
||||
appname = strValue1
|
||||
End If
|
||||
objReg.GetStringValue HKLM, strKey & strSubkey, _
|
||||
strEntry2, strValue2
|
||||
objReg.GetStringValue HKLM, strKey & strSubkey, strEntry2, strValue2
|
||||
If strValue2 <> "" Then
|
||||
appdate = strValue2
|
||||
End If
|
||||
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
|
||||
strEntry3, intValue3
|
||||
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
|
||||
strEntry4, intValue4
|
||||
|
||||
objReg.GetStringValue HKLM, strKey & strSubkey, strEntry3, intValue3
|
||||
If intValue3 <> "" Then
|
||||
appversion = intValue3 & "." & intValue4
|
||||
appversion = intValue3
|
||||
End If
|
||||
objReg.GetDWORDValue HKLM, strKey & strSubkey, _
|
||||
strEntry5, intValue5
|
||||
If intValue5 <> "" Then
|
||||
appsize = Round(intValue5/1024, 3) & " megabytes"
|
||||
End If
|
||||
|
||||
If appname <> "" Then
|
||||
Wscript.StdOut.WriteLine "<data>" & appname & ";" & appversion & ";" & appdate & ";" & appsize & "</data>"
|
||||
' foreach registry item, check if exists in the main collector
|
||||
' it it exists, it doesn't be added.
|
||||
if ( isItemInArray(appname, colObjSW) = false ) then
|
||||
' as item doesn't exist, we add it to main collector and to XML
|
||||
With colObjSW.Append(New AppClass)
|
||||
.caption = appname
|
||||
.version = appversion
|
||||
End with
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & appname & ";" & appversion & "]]></data>"
|
||||
end if
|
||||
end if
|
||||
|
||||
Next
|
||||
next
|
||||
|
||||
' Closing the XML structure
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
' Lista todos los usuarios del equipo que han iniciado procesos
|
||||
|
||||
dim loggedUsers(),i
|
||||
i=0
|
||||
Sub insertIfNotExists(sDomain,sUser)
|
||||
For Each lUser in loggedUsers
|
||||
If StrComp(sDomain & "\" & sUser, lUser) = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
Next
|
||||
redim preserve loggedUsers(i)
|
||||
i=i+1
|
||||
loggedUsers (i-1)=sDomain & "\" & sUser
|
||||
End Sub
|
||||
|
||||
Function CheckRealUser(sHost, sUser, sDomain)
|
||||
Dim oWMI,realUsers
|
||||
Set oWmi = GetObject("winmgmts:{impersonationLevel=impersonate,(debug)}!\\" _
|
||||
& sHost & "\root\cimv2")
|
||||
Set realUsers = oWmi.ExecQuery("SELECT * FROM Win32_UserAccount WHERE Domain='" & sDomain & "' OR Name='" & sUser & "'")
|
||||
If (realUsers.count=0) Then
|
||||
CheckRealUser = False
|
||||
Else
|
||||
CheckRealUser = True
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Function ConsoleUser(sHost)
|
||||
Dim oWMI, colProc, oProcess, strUser, strDomain
|
||||
Set oWmi = GetObject("winmgmts:" _
|
||||
& "{impersonationLevel=impersonate,(debug)}!\\" _
|
||||
& sHost & "\root\cimv2")
|
||||
|
||||
Set colProc = oWmi.ExecQuery("Select sessionID from Win32_Process")
|
||||
|
||||
ConsoleUser = ""
|
||||
For Each oProcess In colProc
|
||||
lRet = oProcess.getOwner(strOwner, strDomain)
|
||||
If (lRet = 0) AND (CheckRealUser(sHost,strOwner,strDomain)) Then
|
||||
insertIfNotExists strDomain,strOwner
|
||||
ConsoleUser = sUser
|
||||
End If
|
||||
Next
|
||||
End Function
|
||||
|
||||
' MAIN
|
||||
|
||||
sUser = ConsoleUser(".") ' use "." for local computer
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Users</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
|
||||
For Each usuario in loggedUsers
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & split(usuario,"\")(0) _
|
||||
& ";" & split(usuario,"\")(1) _
|
||||
& "]]></data>"
|
||||
next
|
||||
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
' Pandora FMS Agent Inventory Plugin for Microsoft Windows (All platfforms)
|
||||
' (c) 2015 Borja Sanchez <fborja.sanchez@artica.es>
|
||||
' This plugin extends agent inventory feature. Only enterprise version
|
||||
' --------------------------------------------------------------------------
|
||||
on error resume next
|
||||
'WMI video_card_info
|
||||
|
||||
Wscript.StdOut.WriteLine "<inventory>"
|
||||
Wscript.StdOut.WriteLine "<inventory_module>"
|
||||
Wscript.StdOut.WriteLine "<name>Video</name>"
|
||||
Wscript.StdOut.WriteLine "<type><![CDATA[generic_data_string]]></type>"
|
||||
Wscript.StdOut.WriteLine "<datalist>"
|
||||
|
||||
strComputer = "."
|
||||
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
||||
Set colVideoCards = objWMIService.ExecQuery("Select caption,AdapterRAM,PNPDeviceID from win32_videocontroller")
|
||||
|
||||
For Each vcard In colVideoCards
|
||||
Wscript.StdOut.WriteLine "<data><![CDATA[" & vcard.caption _
|
||||
& ";" & Round(Abs(vcard.AdapterRAM/(1024*1024)),2) & " MB" _
|
||||
& ";" & vcard.PNPDeviceID _
|
||||
& "]]></data>"
|
||||
Next
|
||||
|
||||
Wscript.StdOut.WriteLine "</datalist>"
|
||||
Wscript.StdOut.WriteLine "</inventory_module>"
|
||||
Wscript.StdOut.WriteLine "</inventory>"
|
||||
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{150329}
|
||||
{150506}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -257,7 +257,7 @@ Pandora_Module_Logevent::getLogEvents (list<string> &event_list, unsigned char d
|
|||
TCHAR lp_referenced_domain_name[_MAX_PATH + 1];
|
||||
DWORD cch_referenced_domain_name = _MAX_PATH + 1;
|
||||
SID_NAME_USE pe_use;
|
||||
string description;
|
||||
string description, output;
|
||||
|
||||
if (this->log_event == NULL) {
|
||||
return -1;
|
||||
|
@ -392,9 +392,19 @@ Pandora_Module_Logevent::getLogEvents (list<string> &event_list, unsigned char d
|
|||
event << "]";
|
||||
}
|
||||
|
||||
|
||||
// Remove carriage returns and new lines in between the description.
|
||||
output = "";
|
||||
for (size_t i = 0; i < description.size(); i++) {
|
||||
if (description[i] != '\n' && description[i] != '\r') {
|
||||
output += description[i];
|
||||
}
|
||||
}
|
||||
output += '\n';
|
||||
|
||||
// Print the event description
|
||||
event << " ";
|
||||
event << description;
|
||||
event << output;
|
||||
|
||||
// Add the event to the list
|
||||
event_list.push_back (event.str());
|
||||
|
@ -498,7 +508,7 @@ Pandora_Module_Logevent::getEventDescription (PEVENTLOGRECORD pevlr, char *messa
|
|||
exe_file_path_end = ((char *) exe_file_path) + _MAX_PATH * sizeof (TCHAR);
|
||||
|
||||
while (1) {
|
||||
// Load the DLL
|
||||
// Load the DLL
|
||||
module = LoadLibraryEx (dll_start, 0, flags);
|
||||
if(module == NULL) {
|
||||
pandoraDebug("LoadLibraryEx error %d. Exe file path %s.", GetLastError(), exe_file_path);
|
||||
|
@ -562,7 +572,7 @@ Pandora_Module_Logevent::getEventDescriptionXPATH (PEVENTLOGRECORD pevlr) {
|
|||
}
|
||||
|
||||
// Build the XPATH query
|
||||
query = "Event/System[EventID=" + inttostr(pevlr->EventID & EVENT_ID_MASK) + "]";
|
||||
query = "Event/System[EventRecordID=" + inttostr(pevlr->RecordNumber) + "]";
|
||||
pwsQuery = strAnsiToUnicode (query.c_str());
|
||||
pwsPath = strAnsiToUnicode (this->source.c_str());
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("6.0dev(Build 150329)")
|
||||
#define PANDORA_VERSION ("6.0dev(Build 150506)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -322,7 +322,7 @@ Pandora_Windows_Service::killTentacleProxy() {
|
|||
|
||||
int
|
||||
Pandora_Windows_Service::launchTentacleProxy() {
|
||||
string server_ip, server_port, proxy_max_connections, proxy_timeout;
|
||||
string server_ip, server_port, proxy_max_connections, proxy_timeout, server_ssl;
|
||||
string proxy_cmd;
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO si;
|
||||
|
@ -331,6 +331,7 @@ Pandora_Windows_Service::launchTentacleProxy() {
|
|||
server_ip = conf->getValue("server_ip");
|
||||
|
||||
if (server_ip != "localhost") {
|
||||
|
||||
proxy_max_connections = conf->getValue("proxy_max_connection");
|
||||
|
||||
if (proxy_max_connections == "") {
|
||||
|
@ -348,9 +349,18 @@ Pandora_Windows_Service::launchTentacleProxy() {
|
|||
if (server_port == "") {
|
||||
server_port = "41121";
|
||||
}
|
||||
|
||||
proxy_cmd = "tentacle_server.exe -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout;
|
||||
|
||||
|
||||
server_ssl = conf->getValue("server_ssl");
|
||||
|
||||
if (server_ssl == "1") {
|
||||
proxy_cmd = "tentacle_server.exe -C";
|
||||
}
|
||||
else {
|
||||
proxy_cmd = "tentacle_server.exe";
|
||||
}
|
||||
|
||||
proxy_cmd += " -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout;
|
||||
|
||||
ZeroMemory (&si, sizeof (si));
|
||||
ZeroMemory (&pi, sizeof (pi));
|
||||
if (CreateProcess (NULL , (CHAR *)proxy_cmd.c_str (), NULL, NULL, FALSE,
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(6.0dev(Build 150329))"
|
||||
VALUE "ProductVersion", "(6.0dev(Build 150506))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 6.0dev-150329
|
||||
Version: 6.0dev-150506
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="6.0dev-150329"
|
||||
pandora_version="6.0dev-150506"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -18,14 +18,14 @@ if ((! file_exists("include/config.php")) || (! is_readable("include/config.php"
|
|||
exit;
|
||||
}
|
||||
|
||||
// Real start
|
||||
session_start();
|
||||
|
||||
require_once ('include/config.php');
|
||||
require_once ('include/functions.php');
|
||||
require_once ('include/functions_db.php');
|
||||
require_once ('include/auth/mysql.php');
|
||||
|
||||
// Real start
|
||||
session_start ();
|
||||
|
||||
// Hash login process
|
||||
if (isset ($_GET["loginhash"])) {
|
||||
|
||||
|
|
|
@ -105,10 +105,18 @@ function mainAgentsAlerts() {
|
|||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__("Agents/Alerts"), "images/op_alerts.png", false, "", false, $onheader);
|
||||
ui_print_page_header (__("Agents/Alerts"), "images/op_alerts.png", false, "", false, $updated_time);
|
||||
|
||||
// Old style table, we need a lot of special formatting,don't use table function
|
||||
// Prepare old-style table
|
||||
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
|
||||
echo "<tr>";
|
||||
echo "<td>" . $filter_groups . "</td>";
|
||||
if ($config['pure'] == 1)
|
||||
echo "<td>" . $comborefr . "</td>";
|
||||
echo "<td> <strong>" . __("Full screen") . "</strong>" . $fullscreen['text'] . "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
$filter = array ('offset' => (int) $offset,
|
||||
'limit' => (int) $config['block_size']);
|
||||
|
@ -144,7 +152,7 @@ function mainAgentsAlerts() {
|
|||
$nagents = count(agents_get_agents ($filter_count));
|
||||
|
||||
if ($agents == false) {
|
||||
echo "<div class='nf'>" . __('There are no agents with alerts')."</div>";
|
||||
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no agents with alerts') ) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -164,12 +172,15 @@ function mainAgentsAlerts() {
|
|||
// Prepare pagination
|
||||
ui_pagination ($nagents);
|
||||
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" width=98%>';
|
||||
echo "<th width='140px' height='25px'>".__("Agents")." / ".__("Alert templates")."</th>";
|
||||
echo '<table class="databox data" cellpadding="0" cellspacing="0" border="0" width=100%>';
|
||||
echo "<th width='140px' >".__("Agents")." / ".__("Alert templates")."</th>";
|
||||
|
||||
if ($hor_offset > 0) {
|
||||
$new_hor_offset = $hor_offset-$block;
|
||||
echo "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='".($nagents+1)."'><a href='index.php?sec=extensions&sec2=extensions/agents_alerts&refr=0&hor_offset=".$new_hor_offset."&offset=".$offset."&group_id=".$group_id."'>".html_print_image("images/darrowleft.png",true, array('title' => __('Previous templates')))."</a> </th>";
|
||||
echo "<th width='20px' style='' rowspan='".($nagents+1)."'>
|
||||
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&refr=0&hor_offset=".
|
||||
$new_hor_offset."&offset=".$offset."&group_id=".$group_id."'>".
|
||||
html_print_image("images/darrowleft.png",true, array('title' => __('Previous templates')))."</a> </th>";
|
||||
}
|
||||
|
||||
$templates_raw = array();
|
||||
|
@ -200,12 +211,14 @@ function mainAgentsAlerts() {
|
|||
if ($tname == '') {
|
||||
continue;
|
||||
}
|
||||
echo '<th width="20px" >'. html_print_image('images/information.png', true, array('title' => io_safe_output($tname))) ."</th>";
|
||||
echo '<th width="20px" >'. io_safe_output($tname) . html_print_image('images/information.png', true, array('title' => io_safe_output($tname))) ."</th>";
|
||||
}
|
||||
|
||||
if (($hor_offset + $block) < $ntemplates) {
|
||||
$new_hor_offset = $hor_offset+$block;
|
||||
echo "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='".($nagents+1)."'><a href='index.php?sec=extensions&sec2=extensions/agents_alerts&hor_offset=".$new_hor_offset."&offset=".$offset."&group_id=".$group_id."'>".html_print_image("images/darrowright.png",true, array('title' => __('More templates')))."</a> </th>";
|
||||
echo "<th width='20px' style='' rowspan='".($nagents+1)."'>
|
||||
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&hor_offset=".$new_hor_offset."&offset=".
|
||||
$offset."&group_id=".$group_id."'>".html_print_image("images/darrowright.png",true, array('title' => __('More templates')))."</a> </th>";
|
||||
}
|
||||
|
||||
foreach ($agents as $agent) {
|
||||
|
@ -231,7 +244,7 @@ function mainAgentsAlerts() {
|
|||
$cellstyle = 'background:'.COL_ALERTFIRED.';';
|
||||
}
|
||||
|
||||
echo '<td style="text-align:center;'.$cellstyle.'"> ';
|
||||
echo '<td style=";'.$cellstyle.'"> ';
|
||||
|
||||
$uniqid = uniqid();
|
||||
echo "<div>";
|
||||
|
@ -330,7 +343,7 @@ function print_alerts_summary_modal_window($id, $alerts) {
|
|||
echo '<div id="alerts_details_'.$id.'" title="'.__('Agent').': '.$agent.' / '.__('Template').': '.$template.'" style="display:none">'.$content.'</div>';
|
||||
}
|
||||
|
||||
extensions_add_operation_menu_option(__("Agents/Alerts view"), 'estado', null, "v1r1");
|
||||
extensions_add_operation_menu_option(__("Agents/Alerts view"), 'estado', null, "v1r1","view");
|
||||
extensions_add_main_function('mainAgentsAlerts');
|
||||
|
||||
ui_require_jquery_file('pandora');
|
||||
|
|
|
@ -74,12 +74,12 @@ function mainAgentsModules() {
|
|||
$filter_module_groups = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
||||
$filter_module_groups .= '<b>'.__('Module group').'</b>';
|
||||
$filter_module_groups .= html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
|
||||
'modulegroup', $modulegroup, 'this.form.submit()',__('All'), 0, true, false, true, false, 'width: 100px; margin-right: 10px; margin-top: 5px;');
|
||||
'modulegroup', $modulegroup, 'this.form.submit()',__('All'), 0, true, false, true, false, 'width: auto;');
|
||||
$filter_module_groups .= '</form>';
|
||||
|
||||
$filter_groups = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
||||
$filter_groups .= '<b>'.__('Group').'</b>';
|
||||
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, 'this.form.submit()', '', '', true, false, true, '', false , 'width: 100px; margin-right: 10px;; margin-top: 5px;');
|
||||
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, 'this.form.submit()', '', '', true, false, true, '', false , 'width: auto;');
|
||||
$filter_groups .= '</form>';
|
||||
|
||||
$comborefr = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
||||
|
@ -116,10 +116,19 @@ function mainAgentsModules() {
|
|||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__("Agents/Modules"), "images/module_mc.png", false, "", false, $onheader);
|
||||
ui_print_page_header (__("Agents/Modules"), "images/module_mc.png", false, "", false, $updated_time);
|
||||
|
||||
// Old style table, we need a lot of special formatting,don't use table function
|
||||
// Prepare old-style table
|
||||
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
|
||||
echo "<tr>";
|
||||
echo "<td>" . $filter_module_groups . "</td>";
|
||||
echo "<td>" . $filter_groups . "</td>";
|
||||
if ($config['pure'] == 1)
|
||||
echo "<td>" . $comborefr . "</td>";
|
||||
echo "<td> <strong>" . __("Full screen") . "</strong>" . $fullscreen['text'] . "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
$agents = '';
|
||||
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
|
||||
|
@ -138,7 +147,7 @@ function mainAgentsModules() {
|
|||
}
|
||||
$count++;
|
||||
}
|
||||
|
||||
$total_pagination = count($agents);
|
||||
$all_modules = agents_get_modules($agents, false, $filter_module_group, true, false);
|
||||
|
||||
$modules_by_name = array();
|
||||
|
@ -172,15 +181,15 @@ function mainAgentsModules() {
|
|||
$nagents = count($agents);
|
||||
|
||||
if ($all_modules == false || $agents == false) {
|
||||
echo "<div class='nf'>".__('There are no agents with modules')."</div>";
|
||||
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no agents with modules') ) );
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" style="width:98%;" class="agents_modules_table">';
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" style="width:100%;" class="agents_modules_table">';
|
||||
|
||||
echo "<tr>";
|
||||
|
||||
echo "<th width='140px' height='25px' valign='bottom' style='text-align: right !important;'>" . __("Agents") . " / " . __("Modules") . "</th>";
|
||||
echo "<th width='140px' style='text-align: right !important;'>" . __("Agents") . " / " . __("Modules") . "</th>";
|
||||
|
||||
if ($hor_offset > 0) {
|
||||
$new_hor_offset = $hor_offset-$block;
|
||||
|
@ -242,13 +251,12 @@ function mainAgentsModules() {
|
|||
|
||||
echo "</tr>";
|
||||
|
||||
$filter_agents = array('offset' => (int) $offset,
|
||||
'limit' => (int) $config['block_size'], 'disabled' => 0);
|
||||
$filter_agents = array('offset' => (int) $offset, 'disabled' => 0);
|
||||
if ($group_id > 0) {
|
||||
$filter_agents['id_grupo'] = $group_id;
|
||||
}
|
||||
// Prepare pagination
|
||||
ui_pagination ((int)count(agents_get_agents ($filter_agents)));
|
||||
ui_pagination ($total_pagination);
|
||||
|
||||
foreach ($agents as $agent) {
|
||||
// Get stats for this group
|
||||
|
@ -392,7 +400,7 @@ function mainAgentsModules() {
|
|||
";
|
||||
}
|
||||
|
||||
extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agents_modules/icon_menu.png', "v1r1");
|
||||
extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agents_modules/icon_menu.png', "v1r1","view");
|
||||
extensions_add_main_function('mainAgentsModules');
|
||||
|
||||
?>
|
||||
|
|
|
@ -216,5 +216,5 @@ function extension_api_checker() {
|
|||
}
|
||||
|
||||
extensions_add_godmode_function('extension_api_checker');
|
||||
extensions_add_godmode_menu_option(__('API checker'), 'PM', 'gsetup', null, "v1r1");
|
||||
extensions_add_godmode_menu_option(__('API checker'), 'PM', 'gextensions', null, "v1r1");
|
||||
?>
|
|
@ -362,5 +362,5 @@ function extension_db_status_execute_sql_file($url, $connection) {
|
|||
}
|
||||
|
||||
extensions_add_godmode_function('extension_db_status');
|
||||
extensions_add_godmode_menu_option(__('DB Status'), 'PM', 'gdbman', null, "v1r1");
|
||||
extensions_add_godmode_menu_option(__('DB Status'), 'PM', 'gextensions', null, "v1r1", 'gdbman');
|
||||
?>
|
|
@ -158,7 +158,7 @@ function dbmgr_extension_main () {
|
|||
}
|
||||
|
||||
/* This adds a option in the operation menu */
|
||||
extensions_add_godmode_menu_option (__('DB interface'), 'PM','gdbman',"dbmanager/icon.png","v1r1");
|
||||
extensions_add_godmode_menu_option (__('DB interface'), 'PM','gextensions',"dbmanager/icon.png","v1r1", 'gdbman');
|
||||
|
||||
/* This sets the function to be called when the extension is selected in the operation menu */
|
||||
extensions_add_godmode_function ('dbmgr_extension_main');
|
||||
|
|
|
@ -167,9 +167,9 @@ function mainModuleGroups() {
|
|||
|
||||
ui_print_page_header (__("Combined table of agent group and module group"), "images/module_group.png", false, "", false, '');
|
||||
|
||||
echo "<p>" .
|
||||
__("This table shows in columns the modules group and in rows agents group. The cell shows all modules") .
|
||||
"</p>";
|
||||
ui_print_info_message ( array('no_close'=>true, 'message'=>
|
||||
__("This table shows in columns the modules group and in rows agents group. The cell shows all modules") )
|
||||
);
|
||||
|
||||
|
||||
$agentGroups = users_get_groups ($config['id_user'], "AR", false);
|
||||
|
@ -178,20 +178,22 @@ function mainModuleGroups() {
|
|||
if (!empty($agentGroups) && !empty($modelGroups)) {
|
||||
array_walk($modelGroups, 'translate'); //Translate all head titles to language is set
|
||||
|
||||
$table = null;
|
||||
$table->headstyle[] = "width: 20%";
|
||||
foreach ($modelGroups as $i => $n) {
|
||||
$modelGroups[$i] = ui_print_truncate_text($n, GENERIC_SIZE_TEXT);
|
||||
$table->headstyle[] = "width: 7%";
|
||||
$modelGroups[$i] = ui_print_truncate_text($n, GENERIC_SIZE_TEXT, true, true, true, '…', 'color:#FFF');
|
||||
}
|
||||
|
||||
$head = $modelGroups;
|
||||
array_unshift($head, ' ');
|
||||
|
||||
//Metaobject use in html_print_table
|
||||
$table = null;
|
||||
$table->align[0] = 'right'; //Align to right the first column.
|
||||
$table->align[0] = 'left'; //Align to left the first column.
|
||||
$table->style[0] = 'color: #ffffff; '.
|
||||
'background-color: #373737; font-weight: bolder; padding-right: 10px;';
|
||||
'background-color: #373737; font-weight: bolder; padding-right: 10px; width:20%; ';
|
||||
$table->head = $head;
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
|
||||
//The content of table
|
||||
$tableData = array();
|
||||
|
@ -201,7 +203,7 @@ function mainModuleGroups() {
|
|||
$fired = false;
|
||||
$row = array();
|
||||
|
||||
array_push($row, ui_print_truncate_text($name, GENERIC_SIZE_TEXT));
|
||||
array_push($row, ui_print_truncate_text($name, GENERIC_SIZE_TEXT, true, true, true, '…', 'color:#FFF'));
|
||||
|
||||
foreach ($modelGroups as $idModelGroup => $modelGroup) {
|
||||
$fired = false;
|
||||
|
@ -247,29 +249,29 @@ function mainModuleGroups() {
|
|||
else {
|
||||
|
||||
if ($fired) {
|
||||
$color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired.
|
||||
$color = '#FFA631'; //Orange when the cell for this model group and agent has at least one alert fired.
|
||||
}
|
||||
else if (array_key_exists(1, $states)) {
|
||||
$color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
|
||||
$color = '#FC4444'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
|
||||
$font_color = '#ffffff';
|
||||
}
|
||||
elseif (array_key_exists(2, $states)) {
|
||||
$color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
|
||||
$color = '#FAD403'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
|
||||
}
|
||||
elseif (array_key_exists(3, $states)) {
|
||||
$color = '#babdb6'; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
|
||||
$color = '#B2B2B2 '; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
|
||||
}
|
||||
elseif (array_key_exists(0, $states)) {
|
||||
$color = '#8ae234'; //Green when the cell for this model group and agent has OK state all modules.
|
||||
$color = '#80BA27'; //Green when the cell for this model group and agent has OK state all modules.
|
||||
}
|
||||
elseif (array_key_exists(5, $states)) {
|
||||
$color = '#729fcf'; // Blue when the cell for this module group and all modules have not init value.
|
||||
$color = '#5BB6E5'; // Blue when the cell for this module group and all modules have not init value.
|
||||
}
|
||||
|
||||
|
||||
$alinkStart = '<a class="info_cell" rel="ajax.php?page=extensions/module_groups&get_info_alert_module_group=1&module_group=' . $idModelGroup . '&id_agent_group=' . $idAgentGroup . '"
|
||||
href="index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&ag_group=' . $idAgentGroup .
|
||||
'&modulegroup=' . $idModelGroup . '" style="color: ' . $font_color . '; font-size: 18px;";>';
|
||||
$alinkStart = '<a class="info_cell" rel="ajax.php?page=extensions/module_groups&get_info_alert_module_group=1&module_group=' .
|
||||
$idModelGroup . '&id_agent_group=' . $idAgentGroup . '"href="index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&ag_group=' .
|
||||
$idAgentGroup . '&modulegroup=' . $idModelGroup . '" style="color: ' . $font_color . '; font-size: 18px;";>';
|
||||
$alinkEnd = '</a>';
|
||||
}
|
||||
|
||||
|
@ -284,13 +286,13 @@ function mainModuleGroups() {
|
|||
array_push($tableData,$row);
|
||||
}
|
||||
$table->data = $tableData;
|
||||
echo "<div style='width:98%; overflow-x:auto;'>";
|
||||
echo "<div style='width:100%; overflow-x:auto;'>";
|
||||
html_print_table($table);
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='legend_basic' style='width: 94%'>";
|
||||
echo "<div class='legend_basic' style='width: 98.6%'>";
|
||||
|
||||
echo "<table>";
|
||||
echo "<table >";
|
||||
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>" . __('Legend') . "</b></td></tr>";
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_ALERTFIRED . ";'></div></td><td>" . __("Orange cell when the module group and agent have at least one alarm fired.") . "</td></tr>";
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_CRITICAL . ";'></div></td><td>" . __("Red cell when the module group and agent have at least one module in critical status and the others in any status") . "</td></tr>";
|
||||
|
@ -320,6 +322,6 @@ function mainModuleGroups() {
|
|||
<?php
|
||||
}
|
||||
|
||||
extensions_add_operation_menu_option(__("Module groups"), 'estado', 'module_groups/brick.png', "v1r1");
|
||||
extensions_add_operation_menu_option(__("Module groups"), 'estado', 'module_groups/brick.png', "v1r1","view");
|
||||
extensions_add_main_function('mainModuleGroups');
|
||||
?>
|
||||
|
|
|
@ -101,19 +101,19 @@ function main_net_tools () {
|
|||
function mostrarColumns(ValueSelect){
|
||||
value = ValueSelect.value;
|
||||
if ( value==3 ) {
|
||||
document.getElementById('netToolTable').width=800;
|
||||
document.getElementById('snmpcolumn').style.display='block';
|
||||
$('netToolTable').css('width','100%');
|
||||
$('#snmpcolumn').show();
|
||||
}
|
||||
else{
|
||||
document.getElementById('netToolTable').width=650;
|
||||
document.getElementById('snmpcolumn').style.display='none';
|
||||
$('netToolTable').css('width','100%');
|
||||
$('#snmpcolumn').hide();
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
|
||||
echo "<div>";
|
||||
echo "<form name='actionbox' method='post'>";
|
||||
echo "<table class=databox width=650 id=netToolTable>";
|
||||
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 -> Extensions -> Config Network Tools'));
|
||||
|
@ -143,7 +143,7 @@ function main_net_tools () {
|
|||
echo __("SNMP Community") . " ";
|
||||
echo "<input name=community type=text value='public'>";
|
||||
echo "</td><td>";
|
||||
echo "<input name=submit type=submit class='sub next' value='".__('Execute')."'>";
|
||||
echo "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>";
|
||||
echo "</td>";
|
||||
echo "</tr></table>";
|
||||
echo "</form>";
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 570 B |
|
@ -80,7 +80,7 @@ function pandoralogs_extension_main () {
|
|||
view_logfile ($logs_directory."/pandora_server.error");
|
||||
}
|
||||
|
||||
extensions_add_godmode_menu_option (__('System logfiles'), 'PM','glog', null, "v1r1");
|
||||
extensions_add_godmode_menu_option (__('System logfiles'), 'PM','', null, "v1r1");
|
||||
extensions_add_godmode_function('pandoralogs_extension_main');
|
||||
|
||||
?>
|
|
@ -42,10 +42,12 @@ function pandora_realtime_graphs () {
|
|||
$canvas .= '</div>';
|
||||
echo $canvas;
|
||||
|
||||
$table->width = '99%';
|
||||
$table->width = '100%';
|
||||
$table->id = 'table-form';
|
||||
$table->class = 'databox';
|
||||
$table->class = 'databox filters';
|
||||
$table->style = array ();
|
||||
$table->cellpadding = '0';
|
||||
$table->cellspacing = '0';
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->style[1] = 'font-weight: bold;';
|
||||
$table->style[2] = 'font-weight: bold;';
|
||||
|
@ -62,17 +64,16 @@ function pandora_realtime_graphs () {
|
|||
$graph = get_parameter('graph', 'cpu_load');
|
||||
$refresh = get_parameter('refresh', '1000');
|
||||
|
||||
$data['graph'] = __('Graph') . '<br>' . html_print_select ($graph_fields, 'graph', $graph, '', '', 0, true);
|
||||
$data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'clearGraph()', 'class="sub delete"', true);
|
||||
$data['graph'] = __('Graph') . ' ' . html_print_select ($graph_fields, 'graph', $graph, '', '', 0, true);
|
||||
|
||||
$refresh_fields[1000] = human_time_description_raw(1, true, 'large');
|
||||
$refresh_fields[5000] = human_time_description_raw(5, true, 'large');
|
||||
$refresh_fields[10000] = human_time_description_raw(10, true, 'large');
|
||||
$refresh_fields[30000] = human_time_description_raw(30, true, 'large');
|
||||
|
||||
$data['refresh'] = __('Refresh interval') . '<br>' . html_print_select ($refresh_fields, 'refresh', $refresh, '', '', 0, true);
|
||||
$data['incremental'] = __('Incremental') . '<br>' . html_print_checkbox ('incremental', 1, 0, true);
|
||||
|
||||
$data['refresh'] = __('Refresh interval') . ' ' . html_print_select ($refresh_fields, 'refresh', $refresh, '', '', 0, true);
|
||||
$data['incremental'] = __('Incremental') . ' ' . html_print_checkbox ('incremental', 1, 0, true);
|
||||
$data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'clearGraph()', 'class="sub delete" style="margin-top:0px;"', true);
|
||||
$table->data[] = $data;
|
||||
|
||||
|
||||
|
@ -85,10 +86,10 @@ function pandora_realtime_graphs () {
|
|||
|
||||
$data = array();
|
||||
|
||||
$data['snmp_address'] = __('Target IP') . '<br>' . html_print_input_text ('ip_target', $snmp_address, '', 50, 255, true);
|
||||
$data['snmp_address'] = __('Target IP') . ' ' . html_print_input_text ('ip_target', $snmp_address, '', 50, 255, true);
|
||||
$table->colspan[1]['snmp_address'] = 2;
|
||||
|
||||
$data['snmp_community'] = __('Community') . '<br>' . html_print_input_text ('snmp_community', $snmp_community, '', 50, 255, true);
|
||||
$data['snmp_community'] = __('Community') . ' ' . html_print_input_text ('snmp_community', $snmp_community, '', 50, 255, true);
|
||||
$table->colspan[1]['snmp_community'] = 2;
|
||||
|
||||
$table->data[] = $data;
|
||||
|
@ -99,12 +100,11 @@ function pandora_realtime_graphs () {
|
|||
$snmp_versions['2c'] = '2c';
|
||||
|
||||
$data = array();
|
||||
$data['snmp_oid'] = __('OID') . '<br>' . html_print_input_text ('snmp_oid', $snmp_oid, '', 100, 255, true);
|
||||
$data['snmp_oid'] .= html_print_button (__('SNMP walk'), 'snmp_walk', false, 'snmpBrowserWindow()', 'class="sub next"', true);
|
||||
$data['snmp_oid'] = __('OID') . ' ' . html_print_input_text ('snmp_oid', $snmp_oid, '', 100, 255, true);
|
||||
$table->colspan[2]['snmp_oid'] = 2;
|
||||
|
||||
$data['snmp_ver'] = __('Version') . '<br>' . html_print_select ($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true);
|
||||
|
||||
$data['snmp_ver'] = __('Version') . ' ' . html_print_select ($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true);
|
||||
$data['snmp_ver'] .= ' ' . html_print_button (__('SNMP walk'), 'snmp_walk', false, 'snmpBrowserWindow()', 'class="sub next"', true);
|
||||
$table->colspan[2]['snmp_ver'] = 2;
|
||||
|
||||
$table->data[] = $data;
|
||||
|
@ -128,7 +128,7 @@ function pandora_realtime_graphs () {
|
|||
set_js_value('timezone_offset', date('Z', time()));
|
||||
}
|
||||
|
||||
extensions_add_operation_menu_option (__('Realtime graphs'), null, null, "v1r1");
|
||||
extensions_add_operation_menu_option (__('Realtime graphs'), "estado", null, "v1r1","view");
|
||||
extensions_add_main_function ('pandora_realtime_graphs');
|
||||
|
||||
$db = NULL;
|
||||
|
|
|
@ -52,7 +52,7 @@ if (isset($_GET['get_ptr'])) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
extensions_add_godmode_menu_option (__('Resource exportation'), 'PM','gservers','', "v1r1");
|
||||
extensions_add_godmode_menu_option (__('Resource exportation'), 'PM','gagente','', "v1r1");
|
||||
extensions_add_godmode_function('resource_exportation_extension_main');
|
||||
}
|
||||
|
||||
|
|
|
@ -872,6 +872,6 @@ function resource_registration_extension_main() {
|
|||
process_upload_xml($xml);
|
||||
}
|
||||
|
||||
extensions_add_godmode_menu_option (__('Resource registration'), 'PM','gservers','', "v1r1");
|
||||
extensions_add_godmode_menu_option (__('Resource registration'), 'PM','gagente','', "v1r1");
|
||||
extensions_add_godmode_function('resource_registration_extension_main');
|
||||
?>
|
||||
|
|
|
@ -53,13 +53,15 @@ function ssh_gateway () {
|
|||
}
|
||||
|
||||
echo "<form method=post>";
|
||||
echo "<table class=databox cellspacing=4 cellpadding=4>";
|
||||
echo "<table class='databox filters' cellspacing=4 cellpadding=4 width=100%>";
|
||||
echo "<td>".__("Host address")."<td><input type=text size=25 value='$HOST' name=host>";
|
||||
echo "<tr>";
|
||||
//echo "<tr>";
|
||||
echo "<td>".__("User")."<td><input type=text size=25 value='$USER' name=user>" . ui_print_help_tip(__('For security reasons the following characters are not allowed: %s', '< > | ` $ ; &'), true);
|
||||
echo "<td rowspan=2 vertical_aling='middle'> <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 "<tr><td>";
|
||||
echo "<td>";
|
||||
echo __("Connect mode")."<td><select name=mode>";
|
||||
if ($MODE == "telnet") {
|
||||
echo "<option>telnet";
|
||||
|
@ -71,8 +73,7 @@ function ssh_gateway () {
|
|||
}
|
||||
echo "</select>";
|
||||
|
||||
echo " <input type=submit name=connect class='sub upd' value=".__("Connect").">";
|
||||
echo "<td><input type=hidden name=commit value=1>";
|
||||
|
||||
echo "</form></table>";
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 486 B |
|
@ -802,7 +802,7 @@ function consoleMode() {
|
|||
if (!isset($argv)) {
|
||||
//Execution across the browser
|
||||
extensions_add_godmode_function('mainSystemInfo');
|
||||
extensions_add_godmode_menu_option(__('System Info'), 'PM', 'gsetup', null, "v1r1");
|
||||
extensions_add_godmode_menu_option(__('System Info'), 'PM', 'gextensions', null, "v1r1");
|
||||
}
|
||||
else {
|
||||
$dir = dirname($_SERVER['PHP_SELF']);
|
||||
|
|
|
@ -20,12 +20,12 @@ function vnc_view() {
|
|||
|
||||
$display = get_parameter("display", 0);
|
||||
echo "<form method=post>";
|
||||
echo "<table class=databox width=500>";
|
||||
echo "<table class='databox filters' width=100%>";
|
||||
echo "<tr><td>";
|
||||
echo __("VNC Display (:0 by default)") . " ";
|
||||
echo "<input type=text name=display value=$display>";
|
||||
echo "</td><td>";
|
||||
echo "<input type=submit class='sub next' value='".__("Send")."'>";
|
||||
echo "<input type=submit class='sub next' style='margin-top:0px;' value='".__("Send")."'>";
|
||||
echo "</td>";
|
||||
echo "</tr></table>";
|
||||
$port = 5800 + $display;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -70,3 +70,26 @@ INSERT INTO tconfig (token, value) VALUES ('post_process_custom_values', '{"0.00
|
|||
ALTER TABLE tnetwork_map ADD COLUMN id_tag NUMBER(11, 0) DEFAULT 0;
|
||||
ALTER TABLE tnetwork_map ADD COLUMN store_group NUMBER(11, 0) DEFAULT 0;
|
||||
UPDATE tnetwork_map SET store_group = id_group;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tperfil`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tperfil ADD COLUMN map_view NUMBER(1, 0) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE tperfil ADD COLUMN map_edit NUMBER(1, 0) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE tperfil ADD COLUMN map_management NUMBER(1, 0) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE tperfil ADD COLUMN vconsole_view NUMBER(1, 0) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE tperfil ADD COLUMN vconsole_edit NUMBER(1, 0) DEFAULT 0 NOT NULL;
|
||||
ALTER TABLE tperfil ADD COLUMN vconsole_management NUMBER(1, 0) DEFAULT 0 NOT NULL;
|
||||
|
||||
UPDATE tperfil SET map_view = 1, vconsole_view = 1 WHERE report_view = 1;
|
||||
UPDATE tperfil SET map_edit = 1, vconsole_edit = 1 WHERE report_edit = 1;
|
||||
UPDATE tperfil SET map_management = 1, vconsole_management = 1 WHERE report_management = 1;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tsessions_php
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE tsessions_php (
|
||||
id_session VARCHAR2(52) NOT NULL PRIMARY KEY,
|
||||
last_active NUMBER(20, 0) NOT NULL,
|
||||
data CLOB default ''
|
||||
);
|
||||
|
|
|
@ -68,3 +68,26 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('post_process_custom_values', '
|
|||
ALTER TABLE "tnetwork_map" ADD COLUMN "id_tag" INTEGER DEFAULT 0;
|
||||
ALTER TABLE "tnetwork_map" ADD COLUMN "store_group" INTEGER DEFAULT 0;
|
||||
UPDATE "tnetwork_map" SET "store_group" = "id_group";
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tperfil`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE "tperfil" ADD COLUMN "map_view" SMALLINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE "tperfil" ADD COLUMN "map_edit" SMALLINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE "tperfil" ADD COLUMN "map_management" SMALLINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE "tperfil" ADD COLUMN "vconsole_view" SMALLINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE "tperfil" ADD COLUMN "vconsole_edit" SMALLINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE "tperfil" ADD COLUMN "vconsole_management" SMALLINT NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE "tperfil" SET "map_view" = 1, "vconsole_view" = 1 WHERE "report_view" = 1;
|
||||
UPDATE "tperfil" SET "map_edit" = 1, "vconsole_edit" = 1 WHERE "report_edit" = 1;
|
||||
UPDATE "tperfil" SET "map_management" = 1, "vconsole_management" = 1 WHERE "report_management" = 1;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table tsessions_php
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE "tsessions_php" (
|
||||
"id_session" SERIAL NOT NULL PRIMARY KEY,
|
||||
"last_active" INTEGER NOT NULL,
|
||||
"data" TEXT default ''
|
||||
);
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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&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>
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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">
|
||||
<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>
|
||||
<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>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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>
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
global $config;
|
||||
check_login ();
|
||||
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>
|
|
@ -71,6 +71,37 @@ config_check();
|
|||
$table->styleTable = 'margin: auto; margin-top: 0px;';
|
||||
$table->rowclass[0] = '';
|
||||
|
||||
// Search bar
|
||||
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
|
||||
if (!isset($config['search_keywords'])) {
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
|
||||
}
|
||||
else {
|
||||
if (strlen($config['search_keywords']) == 0)
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
|
||||
else
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = false; </script>';
|
||||
}
|
||||
|
||||
$search_bar .= '<input type="text" id="keywords" name="keywords"';
|
||||
if (!isset($config['search_keywords']))
|
||||
$search_bar .= "value='" . __("Enter keywords to search") . "'";
|
||||
else if (strlen($config['search_keywords']) == 0)
|
||||
$search_bar .= "value='" . __("Enter keywords to search") . "'";
|
||||
else
|
||||
$search_bar .= "value='" . $config['search_keywords'] . "'";
|
||||
|
||||
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
|
||||
onkeyup="javascript: fieldKeyWordEmpty = false;"
|
||||
style="margin-top:5px;" class="search_input" />';
|
||||
|
||||
//$search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
|
||||
|
||||
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
|
||||
$search_bar .= '</form>';
|
||||
|
||||
$table->data[0]['searchbar'] = $search_bar;
|
||||
|
||||
// Servers check
|
||||
$servers = array();
|
||||
$servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver');
|
||||
|
@ -220,7 +251,7 @@ config_check();
|
|||
$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_warning.png", true, array ("title" => __('You have %d warning(s)', $config["alert_cnt"]), "id" => "yougotalert", "class" => "bot")) . $maintenance_link_close;
|
||||
$maintenance_img = $maintenance_link_open_img . html_print_image ("images/header_yellow.png", true, array ("title" => __('You have %d warning(s)', $config["alert_cnt"]), "id" => "yougotalert", "class" => "bot")) . $maintenance_link_close;
|
||||
}
|
||||
else {
|
||||
$maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot"));
|
||||
|
@ -263,39 +294,6 @@ config_check();
|
|||
$table->data[0][9] .= '</a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Search bar
|
||||
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
|
||||
if (!isset($config['search_keywords'])) {
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
|
||||
}
|
||||
else {
|
||||
if (strlen($config['search_keywords']) == 0)
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
|
||||
else
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = false; </script>';
|
||||
}
|
||||
|
||||
$search_bar .= '<input type="text" id="keywords" name="keywords"';
|
||||
if (!isset($config['search_keywords']))
|
||||
$search_bar .= "value='" . __("Enter keywords to search") . "'";
|
||||
else if (strlen($config['search_keywords']) == 0)
|
||||
$search_bar .= "value='" . __("Enter keywords to search") . "'";
|
||||
else
|
||||
$search_bar .= "value='" . $config['search_keywords'] . "'";
|
||||
|
||||
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
|
||||
onkeyup="javascript: fieldKeyWordEmpty = false;"
|
||||
style="margin-top:5px;" class="search_input" />';
|
||||
|
||||
//$search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
|
||||
|
||||
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
|
||||
$search_bar .= '</form>';
|
||||
|
||||
$table->data[0]['searchbar'] = $search_bar;
|
||||
|
||||
$table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true);
|
||||
|
||||
html_print_table($table);
|
||||
|
|
|
@ -62,44 +62,47 @@ if (!empty($config['login_background'])) {
|
|||
$login_body_style = "style=\"background-image: url('$background_url');\"";
|
||||
}
|
||||
echo '<div id="login_body" ' . $login_body_style . '></div>';
|
||||
echo '<div id="login_outer">';
|
||||
echo '<div class="login_page"><div id="login_outer">';
|
||||
echo '<div class="databox_login" id="login">';
|
||||
echo '<div id="login_inner">';
|
||||
|
||||
echo '
|
||||
<div id="login_in">
|
||||
<form method="post" action="' . ui_get_full_url('index.php'.$url) . '" >';
|
||||
echo '<div id="login_in">';
|
||||
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
|
||||
/* CUSTOM BRANDING STARTS HERE */
|
||||
|
||||
// Replace the following with your own URL and logo.
|
||||
// A mashup of the Pandora FMS logo and your companies highly preferred
|
||||
echo '<table id="login_layout"><tr><td rowspan=2 style="width: 200px;">';
|
||||
|
||||
echo '<a href="' . $logo_link . '">';
|
||||
if (defined ('METACONSOLE')) {
|
||||
html_print_image ("enterprise/meta/images/pandora_login_enterprise.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
|
||||
}
|
||||
else if (defined ('PANDORA_ENTERPRISE')) {
|
||||
html_print_image ($config['homeurl'] . "/images/pandora_login_enterprise.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
|
||||
}
|
||||
else {
|
||||
html_print_image ($config['homeurl'] . "/images/pandora_login.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
|
||||
}
|
||||
echo '</a>';
|
||||
|
||||
// This prints the current pandora console version.
|
||||
// For stable/live function it might be wise to comment it out
|
||||
|
||||
/* CUSTOM BRANDING ENDS HERE */
|
||||
echo '</td><td>';
|
||||
echo '<table id="login_layout">';
|
||||
echo'<tr style="height:15px;"><td>';
|
||||
echo '<div class="login_links">';
|
||||
echo '<a href="http://wiki.pandorafms.com/" target="_blank">' . __('Help') . '</a>';
|
||||
echo ' | ';
|
||||
echo '<a href="http://forums.pandorafms.com/" target="_blank">' . __('Support') . '</a>';
|
||||
echo '</div>';
|
||||
echo '</td></tr><tr><td>';
|
||||
echo '</td></tr>';
|
||||
echo'<tr>
|
||||
<td class="login_border" rowspan=2 style="width: 160px;">';
|
||||
|
||||
echo '<a href="' . $logo_link . '">';
|
||||
if (defined ('METACONSOLE')) {
|
||||
html_print_image ("images/logo_login.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
|
||||
}
|
||||
else if (defined ('PANDORA_ENTERPRISE')) {
|
||||
html_print_image ("images/logo_login.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
|
||||
}
|
||||
else {
|
||||
html_print_image ("images/logo_login.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
|
||||
}
|
||||
echo '</a>';
|
||||
|
||||
// This prints the current pandora console version.
|
||||
// For stable/live function it might be wise to comment it out
|
||||
|
||||
/* CUSTOM BRANDING ENDS HERE */
|
||||
echo '</td><td style="padding-top: 15px;">';
|
||||
|
||||
switch ($login_screen) {
|
||||
case 'login':
|
||||
|
@ -108,20 +111,22 @@ echo '
|
|||
html_print_input_hidden ($key, $value);
|
||||
}
|
||||
}
|
||||
echo '<div class="login_nick_text">';
|
||||
echo __('User') . '<br>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="login_nick">';
|
||||
html_print_input_text_extended ("nick", '', "nick", '', '', '' , false, '', 'class="login login_user"');
|
||||
echo '</div>';
|
||||
echo '<div class="login_pass_text">';
|
||||
echo __('Password') . '<br>';
|
||||
echo '</div>';
|
||||
html_print_image ("/images/usuario_login.png", false);
|
||||
html_print_input_text_extended ("nick", __('User'), "nick", '', '', '' , false,
|
||||
array('onfocus' => "javascript:if ( $('.login_user').val() == 'User') $('.login_user').val('');",
|
||||
'onblur'=>"javascript: if ( $('.login_user').val() == false) $('.login_user').val('". __('User')."');"), 'class="login login_user" ');
|
||||
echo '</div><br />';
|
||||
echo '<div class="login_pass">';
|
||||
html_print_input_text_extended ("pass", '', "pass", '', '', '' ,false, '', 'class="login login_password"', false, true);
|
||||
html_print_image ("/images/candado_login.png", false);
|
||||
html_print_input_text_extended ("pass", 'pass', "pass", '', '', '' ,false,
|
||||
array('onfocus' => "javascript:if ( $('.login_password').val() == 'pass') $('.login_password').val('');",
|
||||
'onblur'=>"javascript:if ( $('.login_password').val() == false) $('.login_password').val('". __('pass')."');"),
|
||||
'class="login login_password"', false, true);
|
||||
echo '</div>';
|
||||
echo '<div class="login_button">';
|
||||
html_print_submit_button(__("Login") . ' >', "login_button", false, 'class="sub next_login"');
|
||||
html_print_submit_button(__("Login"), "login_button", false, 'class="sub next_login"');
|
||||
echo '</div>';
|
||||
break;
|
||||
case 'logout':
|
||||
|
@ -165,10 +170,11 @@ echo '</form>
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
if (defined ('METACONSOLE')) {
|
||||
echo '<div id="ver_num" style="text-align: center;">';
|
||||
echo '<div id="ver_num">';
|
||||
}
|
||||
else {
|
||||
echo '<div id="ver_num">';
|
||||
|
@ -180,7 +186,7 @@ echo $pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_versi
|
|||
if (isset ($login_failed)) {
|
||||
echo '<div id="login_failed" title="Login failed" style="">';
|
||||
|
||||
echo '<div style="position:absolute; top:0px; text-align: center; left:0%; right:0%; height:100px; width:330px; margin: 0 auto; ">';
|
||||
echo '<div style="position:absolute; top:0px; text-align: center; left:0%; right:0%; height:100px; width:400px; margin: 0 auto; ">';
|
||||
|
||||
echo '<div id="error_login" style="margin-top: 20px">';
|
||||
echo '<strong style="font-size: 10pt">' . $config["auth_error"] . '</strong>';
|
||||
|
@ -322,7 +328,7 @@ html_print_div(array('id' => 'modal_alert', 'hidden' => true));
|
|||
background: "black"
|
||||
},
|
||||
width: 500,
|
||||
height: 300
|
||||
height: 200
|
||||
})
|
||||
.show ();
|
||||
}
|
||||
|
@ -361,7 +367,7 @@ html_print_div(array('id' => 'modal_alert', 'hidden' => true));
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 200,
|
||||
height: 160,
|
||||
width: 400,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
|
|
|
@ -28,7 +28,7 @@ check_login ();
|
|||
require_once ("include/functions_reporting.php");
|
||||
require_once ($config["homedir"] . '/include/functions_graph.php');
|
||||
|
||||
ui_print_page_header (__('Welcome to Pandora FMS Web Console'));
|
||||
ui_print_page_header (__('Welcome to Pandora FMS Web Console'),'',false,"",false);
|
||||
|
||||
if (tags_has_user_acl_tags()) {
|
||||
ui_print_tags_warning();
|
||||
|
@ -36,10 +36,10 @@ if (tags_has_user_acl_tags()) {
|
|||
|
||||
|
||||
?>
|
||||
<table border="0" width="98%">
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
|
||||
<td width="30%" style="padding-right: 10px;" valign="top">
|
||||
<td width="25%" style="padding-right: 20px;" valign="top">
|
||||
|
||||
|
||||
<?php
|
||||
|
@ -54,14 +54,20 @@ if (tags_has_user_acl_tags()) {
|
|||
$table->cellspacing = 4;
|
||||
$table->head = array ();
|
||||
$table->data = array ();
|
||||
$table->style[0] = 'text-align:center;';
|
||||
$table->headstyle[0] = 'text-align:center;';
|
||||
$table->width = "100%";
|
||||
$table->head[0] = '<span>' . __('Pandora FMS Overview') . '</span>';
|
||||
$table->head_colspan[0] = 4;
|
||||
|
||||
// Indicators
|
||||
$tdata = array();
|
||||
$tdata[0] = reporting_get_stats_indicators($data);
|
||||
$stats = reporting_get_stats_indicators($data, 120, 10,false);
|
||||
$status = '<table class="status_tactical">';
|
||||
foreach ( $stats as $stat ) {
|
||||
$status .= '<tr><td><b>' . $stat['title'] . '</b>' . '</td><td>' . $stat['graph'] . "</td></tr>" ;
|
||||
}
|
||||
$status .= '</table>';
|
||||
$table->data[0][0] = $status;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$table->data[] = $tdata;
|
||||
|
@ -74,7 +80,7 @@ if (tags_has_user_acl_tags()) {
|
|||
|
||||
// Modules by status
|
||||
$tdata = array();
|
||||
$tdata[0] = reporting_get_stats_modules_status($data);
|
||||
$tdata[0] = reporting_get_stats_modules_status($data,180, 100);
|
||||
$table->rowclass[] = '';
|
||||
$table->data[] = $tdata;
|
||||
|
||||
|
@ -97,7 +103,7 @@ if (tags_has_user_acl_tags()) {
|
|||
|
||||
</td>
|
||||
|
||||
<td width="70%" valign="top">
|
||||
<td width="75%" valign="top">
|
||||
|
||||
|
||||
<?php
|
||||
|
@ -114,7 +120,7 @@ if (tags_has_user_acl_tags()) {
|
|||
//////////////////NEWS BOARD/////////////////////////////
|
||||
echo '<div id="news_board">';
|
||||
|
||||
echo '<table cellpadding="4" cellspacing="4" class="databox">';
|
||||
echo '<table cellpadding="4" width=100% cellspacing="4" class="databox">';
|
||||
echo '<tr><th><span>' . __('News board') . '</span></th></tr>';
|
||||
if ($config["prominent_time"] == "timestamp") {
|
||||
$comparation_suffix = "";
|
||||
|
|
|
@ -27,14 +27,11 @@ if (isset ($config["autohidden_menu"]) && $config["autohidden_menu"]) {
|
|||
}
|
||||
|
||||
$menu_container_id = '';
|
||||
if ($autohidden_menu) {
|
||||
$menu_container_id = 'menu_container';
|
||||
}
|
||||
|
||||
// Menu container prepared to autohide menu
|
||||
echo '<div id="' . $menu_container_id . '">';
|
||||
|
||||
echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
|
||||
//echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
|
||||
require ("operation/menu.php");
|
||||
|
||||
//Check all enterprise ACL used in godmenu items to print menu headers
|
||||
|
@ -47,12 +44,12 @@ if (check_acl ($config['id_user'], 0, "AW") ||
|
|||
check_acl ($config['id_user'], 0, "EW") ||
|
||||
check_acl ($config['id_user'], 0, "DW")) {
|
||||
|
||||
echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
|
||||
//echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
|
||||
}
|
||||
|
||||
require ("godmode/menu.php");
|
||||
|
||||
require ("links_menu.php");
|
||||
//require ("links_menu.php");
|
||||
|
||||
echo '</div>'; //menu_container
|
||||
|
||||
|
@ -67,6 +64,7 @@ if (isset($config['fixed_header'])) {
|
|||
$config_fixed_header = $config['fixed_header'];
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
|
@ -94,7 +92,6 @@ function open_submenus () {
|
|||
$('div.menu>ul>li.selected>ul').removeClass('invisible');
|
||||
}
|
||||
|
||||
|
||||
function close_submenus () {
|
||||
$.each(menuState, function (index, value) {
|
||||
if (value)
|
||||
|
@ -104,7 +101,7 @@ function close_submenus () {
|
|||
}
|
||||
|
||||
$(document).ready( function() {
|
||||
|
||||
/*
|
||||
$("img.toggle").click (function (e) {
|
||||
//In case the links gets activated, we don't want to follow link
|
||||
e.preventDefault();
|
||||
|
@ -126,7 +123,7 @@ $(document).ready( function() {
|
|||
|
||||
$.cookie(cookie_name_encoded, JSON.stringify(menuState), {expires: 7});
|
||||
});
|
||||
|
||||
//Cerrar aqui los comentarios cuando esté el menu terminado
|
||||
if (fixed_menu) {
|
||||
$('div#menu')
|
||||
.css('position', 'fixed')
|
||||
|
@ -157,77 +154,184 @@ $(document).ready( function() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (autohidden_menu) {
|
||||
|
||||
$('#menu_container').hover (handlerIn, handlerOut);
|
||||
var openTime = 0;
|
||||
var handsIn = 0;
|
||||
|
||||
$('#main').css('margin-left', '50px');
|
||||
hide_menu_pretty();
|
||||
|
||||
function handlerIn() {
|
||||
handsIn = 1;
|
||||
if (openTime == 0) {
|
||||
show_menu();
|
||||
openTime = new Date().getTime();
|
||||
|
||||
// Close in 1 second if is not closed manually
|
||||
setTimeout(function() {
|
||||
if(openTime > 0 && handsIn == 0) {
|
||||
hide_menu();
|
||||
openTime = 0;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function handlerOut() {
|
||||
handsIn = 0;
|
||||
var openedTime = new Date().getTime() - openTime;
|
||||
|
||||
if (openedTime > 1000) {
|
||||
hide_menu();
|
||||
openTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function show_menu () {
|
||||
|
||||
function show_menu () {
|
||||
$('#menu_container').animate({"left": "+=80px"}, 200, function () {
|
||||
if (fixed_menu) {
|
||||
$('#menu_container').parent().css('overflow', 'auto');
|
||||
}
|
||||
});
|
||||
show_menu_pretty();
|
||||
//show_menu_pretty();
|
||||
}
|
||||
|
||||
function show_menu_pretty() {
|
||||
open_submenus();
|
||||
$('div.menu ul li').css('background-position', '');
|
||||
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').show();
|
||||
$('.titop').css('color', 'white');
|
||||
$('.bg3').css('color', 'white');
|
||||
$('.bg4').css('color', 'white');
|
||||
function show_menu_pretty() {
|
||||
open_submenus();
|
||||
$('div.menu ul li').css('background-position', '');
|
||||
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').show();
|
||||
$('.titop').css('color', 'white');
|
||||
$('.bg3').css('color', 'white');
|
||||
$('.bg4').css('color', 'white');
|
||||
}
|
||||
|
||||
function hide_menu () {
|
||||
if (fixed_menu) {
|
||||
$('#menu_container').parent().css('overflow', 'hidden');
|
||||
}
|
||||
|
||||
function hide_menu () {
|
||||
if (fixed_menu) {
|
||||
$('#menu_container').parent().css('overflow', 'hidden');
|
||||
$('#menu_container').animate({"left": "-=80px"}, 100);
|
||||
//hide_menu_pretty();
|
||||
}
|
||||
|
||||
function hide_menu_pretty() {
|
||||
close_submenus();
|
||||
$('div.menu li').css('background-position', '85px 5px');
|
||||
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').hide();
|
||||
$('.titop').css('color', $('.titop').css('background-color'));
|
||||
$('.bg3').css('color', $('.bg3').css('background-color'));
|
||||
$('.bg4').css('color', $('.bg4').css('background-color'));
|
||||
}
|
||||
*/
|
||||
if (autohidden_menu) {
|
||||
|
||||
//handlerIn, handlerOut);
|
||||
//openTime = 0;
|
||||
//handsIn = 0;
|
||||
|
||||
//$('#main').css('margin-left', '50px');
|
||||
//hide_menu_pretty();
|
||||
/*
|
||||
$('#menu').hover(function() {
|
||||
handsIn = 1;
|
||||
if (openTime == 0) {
|
||||
show_menu();
|
||||
openTime = new Date().getTime();
|
||||
}
|
||||
$('#menu_container').animate({"left": "-=80px"}, 100);
|
||||
hide_menu_pretty();
|
||||
}
|
||||
|
||||
function hide_menu_pretty() {
|
||||
close_submenus();
|
||||
$('div.menu li').css('background-position', '85px 5px');
|
||||
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').hide();
|
||||
$('.titop').css('color', $('.titop').css('background-color'));
|
||||
$('.bg3').css('color', $('.bg3').css('background-color'));
|
||||
$('.bg4').css('color', $('.bg4').css('background-color'));
|
||||
}
|
||||
}).mouseleave(function(){
|
||||
handsIn = 0;
|
||||
setTimeout(function() {
|
||||
openedTime = new Date().getTime() - openTime;
|
||||
if(openedTime > 3000 && handsIn == 0) {
|
||||
hide_menu();
|
||||
openTime = 0;
|
||||
}
|
||||
}, 3500);
|
||||
});
|
||||
*/
|
||||
handsInMenu = 0;
|
||||
openTimeMenu = 0;
|
||||
$('#menu').mouseenter(function() {
|
||||
$('div#title_menu').show();
|
||||
handsInMenu = 1;
|
||||
openTimeMenu = new Date().getTime();
|
||||
$('#menu').css('width', '145px');
|
||||
$('li.menu_icon').addClass( " no_hidden_menu" );
|
||||
$('ul.submenu').css('left', '144px');
|
||||
}).mouseleave(function(){
|
||||
handsInMenu = 0;
|
||||
setTimeout(function() {
|
||||
openedMenu = new Date().getTime() - openTimeMenu;
|
||||
if(openedMenu > 1000 && handsInMenu == 0) {
|
||||
$('#menu').css('width', '45px');
|
||||
$('li.menu_icon').removeClass( " no_hidden_menu");
|
||||
$('ul.submenu').css('left', '44px');
|
||||
$('div#title_menu').hide();
|
||||
}
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('div#title_menu').hide();
|
||||
}
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
openTime = 0;
|
||||
openTime2 = 0;
|
||||
handsIn = 0;
|
||||
handsIn2 = 0;
|
||||
|
||||
$('.menu_icon').mouseenter(function(){
|
||||
table_hover = $(this);
|
||||
handsIn = 1;
|
||||
openTime = new Date().getTime();
|
||||
$("ul#sub"+table_hover[0].id).show();
|
||||
//$('div#menu').offset().top;
|
||||
//$('div#menu').css('overflow','visible');
|
||||
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(){
|
||||
//$('div#menu').css('overflow', 'hidden');
|
||||
table_noHover = $(this);
|
||||
handsIn = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime;
|
||||
if(opened > 3000 && handsIn == 0) {
|
||||
openTime = 4000;
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
}
|
||||
}, 3500);
|
||||
});
|
||||
|
||||
|
||||
- $('.has_submenu').mouseenter(function(){
|
||||
table_hover2 = $(this);
|
||||
handsIn2 = 1;
|
||||
openTime2 = new Date().getTime();
|
||||
$("#sub"+table_hover2[0].id).show();
|
||||
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(){
|
||||
table_noHover2 = table_hover2;
|
||||
handsIn2 = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime2;
|
||||
if(opened >= 3000 && handsIn2 == 0) {
|
||||
openTime2 = 4000;
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
}
|
||||
}, 3500);
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#container').click(function(){
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined')
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
if( typeof(table_hover2) != 'undefined')
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
$('#menu').css('width', '45px');
|
||||
$('li.menu_icon').removeClass( " no_hidden_menu");
|
||||
$('ul.submenu').css('left', '44px');
|
||||
$('div#title_menu').hide();
|
||||
});
|
||||
|
||||
$('div.menu>ul>li>ul>li>a').click(function(){
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined')
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
if( typeof(table_hover2) != 'undefined')
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
$('#menu').css('width', '45px');
|
||||
$('li.menu_icon').removeClass( " no_hidden_menu");
|
||||
$('ul.submenu').css('left', '44px');
|
||||
$('div#title_menu').hide();
|
||||
});
|
||||
$('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();
|
||||
if( typeof(table_hover2) != 'undefined')
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
$('#menu').css('width', '45px');
|
||||
$('li.menu_icon').removeClass( " no_hidden_menu");
|
||||
$('ul.submenu').css('left', '44px');
|
||||
$('div#title_menu').hide();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -34,9 +34,9 @@ $agent_name = agents_get_name($id_agente);
|
|||
$agent_name = md5($agent_name);
|
||||
|
||||
/* Map with the current position */
|
||||
echo "<div id=\"" . $agent_name . "_agent_map\" style=\"border:1px solid black; width:98%; height: 30em;\"></div>";
|
||||
echo "<div id=\"" . $agent_name . "_agent_map\" style=\"border:1px solid black; width:100%; height: 30em;\"></div>";
|
||||
|
||||
if (!gis_get_agent_map($id_agente, "500px", "98%", false)) {
|
||||
if (!gis_get_agent_map($id_agente, "500px", "100%", false)) {
|
||||
ui_print_error_message(__("There is no default map. Please go to the setup for to set a default map."));
|
||||
echo "<script type='text/javascript'>
|
||||
$(document).ready(function() {
|
||||
|
@ -46,32 +46,38 @@ if (!gis_get_agent_map($id_agente, "500px", "98%", false)) {
|
|||
}
|
||||
|
||||
if ($agentData === false) {
|
||||
echo "<p>" . __("There is no GIS data for this agent, so it's positioned in default position of map.") . "</p>";
|
||||
ui_print_info_message ( array ( 'no_close' => true, 'message' =>
|
||||
__("There is no GIS data for this agent, so it's positioned in default position of map.") ) );
|
||||
}
|
||||
echo "<div class='warn'>" .
|
||||
__("Warning: When you change the Agent position, the agent automatically activates the 'Ignore new GIS data' option") . "</div>";
|
||||
ui_print_warning_message (array ( 'no_close' => true, 'message' =>
|
||||
__("When you change the Agent position, the agent automatically activates the 'Ignore new GIS data' option") ) );
|
||||
|
||||
$table->width = '85%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->data = array();
|
||||
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->head[0] =__('Agent position');
|
||||
$table->head_colspan[0] = 2;
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = "text-align:center";
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[2] = 'font-weight: bold; ';
|
||||
|
||||
$table->data[1][0] = __('Latitude: ');
|
||||
$table->data[1][1] = html_print_input_text_extended ('latitude', $agentData['stored_latitude'], 'text-latitude', '', 20, 20, false, '',
|
||||
array('onchange' => "setIgnoreGISDataEnabled()", 'onkeyup' => "setIgnoreGISDataEnabled()"), true);
|
||||
|
||||
$table->data[2][0] = __('Longitude: ');
|
||||
$table->data[2][1] = html_print_input_text_extended ('longitude', $agentData['stored_longitude'], 'text-longitude', '', 20, 20, false, '',
|
||||
$table->data[1][2] = __('Longitude: ');
|
||||
$table->data[1][3] = html_print_input_text_extended ('longitude', $agentData['stored_longitude'], 'text-longitude', '', 20, 20, false, '',
|
||||
array('onchange' => "setIgnoreGISDataEnabled()", 'onkeyup' => "setIgnoreGISDataEnabled()"), true);
|
||||
|
||||
$table->data[3][0] = __('Altitude: ');
|
||||
$table->data[3][1] = html_print_input_text_extended ('altitude', $agentData['stored_altitude'], 'text-altitude', '', 10, 10, false, '',
|
||||
$table->data[2][0] = __('Altitude: ');
|
||||
$table->data[2][1] = html_print_input_text_extended ('altitude', $agentData['stored_altitude'], 'text-altitude', '', 10, 10, false, '',
|
||||
array('onchange' => "setIgnoreGISDataEnabled()", 'onkeyup' => "setIgnoreGISDataEnabled()"), true);
|
||||
|
||||
$table->data[4][0] = __('Ignore new GIS data:');
|
||||
$table->data[4][1] = __('Yes').' '.html_print_radio_button_extended ("update_gis_data", 0, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[4][1] .= __('No').' '.html_print_radio_button_extended ("update_gis_data", 1, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[2][2] = __('Ignore new GIS data:');
|
||||
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended ("update_gis_data", 0, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
|
||||
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended ("update_gis_data", 1, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
|
||||
|
||||
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
|
||||
echo "<form method='post' action='" . $url . "' onsubmit ='return validateFormFields();'>";
|
||||
|
|
|
@ -119,8 +119,6 @@ if ($new_agent) {
|
|||
$server_name = reset(array_keys($servers));
|
||||
}
|
||||
|
||||
echo '<div style="height: 5px"> </div>';
|
||||
|
||||
if (!$new_agent) {
|
||||
// Agent remote configuration editor
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
|
@ -140,8 +138,8 @@ if ($disk_conf_delete) {
|
|||
|
||||
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
|
||||
$table->width = '98%';
|
||||
$table->class = "databox_color";
|
||||
$table->width = '100%';
|
||||
$table->class = "databox filters";
|
||||
|
||||
$table->head = array ();
|
||||
$table->style = array ();
|
||||
|
@ -216,7 +214,7 @@ if ($id_agente) {
|
|||
}
|
||||
</style>
|
||||
<?php
|
||||
$table->rowspan[1][2] = 7;
|
||||
$table->rowspan[1][2] = 3;
|
||||
if ($id_agente) {
|
||||
$table->data[1][2] =
|
||||
"<a id='qr_code_agent_view' href='javascript: show_dialog_qrcode(null, \"" .
|
||||
|
@ -276,8 +274,8 @@ $table->data[7][1] = html_print_input_text ('comentarios', $comentarios,
|
|||
html_print_table ($table);
|
||||
unset($table);
|
||||
|
||||
$table->width = '98%';
|
||||
$table->class = "databox_color";
|
||||
$table->width = '100%';
|
||||
$table->class = "databox filters";
|
||||
|
||||
$table->head = array ();
|
||||
$table->style = array ();
|
||||
|
@ -390,8 +388,8 @@ $table->data[7][1] = html_print_checkbox('quiet', 1, $quiet, true);
|
|||
ui_toggle(html_print_table ($table, true), __('Advanced options'));
|
||||
unset($table);
|
||||
|
||||
$table->width = '98%';
|
||||
$table->class = "databox_color";
|
||||
$table->width = '100%';
|
||||
$table->class = "databox filters";
|
||||
|
||||
$table->head = array ();
|
||||
$table->style = array ();
|
||||
|
@ -531,7 +529,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
|||
|
||||
echo '"' . implode(', ', $elements) . '"';
|
||||
?>,
|
||||
width: 300,
|
||||
width: '100%',
|
||||
theme : "advanced",
|
||||
theme_advanced_path : false,
|
||||
statusbar : false,
|
||||
|
|
|
@ -164,7 +164,6 @@ if (isset ($_POST["template_id"])) {
|
|||
// TEMPLATE ASSIGMENT FORM
|
||||
// ==========================
|
||||
|
||||
echo "<br>";
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
|
||||
|
||||
$nps = db_get_all_fields_in_table ("tnetwork_profile", "name");
|
||||
|
@ -177,12 +176,12 @@ foreach ($nps as $row) {
|
|||
$select[$row["id_np"]] = $row["name"];
|
||||
}
|
||||
|
||||
echo '<table width="98%" cellpadding="2" cellspacing="2" class="databox" >';
|
||||
echo '<table width="100%" cellpadding="0" cellspacing="0" class="databox filters" >';
|
||||
echo "<tr><td class='datos' style='width:50%'>";
|
||||
html_print_select ($select, "template_id", '', '', '', 0, false, false, true, '', false, 'max-width: 200px !important');
|
||||
echo '</td>';
|
||||
echo '<td class="datos">';
|
||||
html_print_submit_button (__('Assign'), 'crt', false, 'class="sub next"');
|
||||
html_print_submit_button (__('Assign'), 'crt', false, 'class="sub next" style="margin-top:0px;"');
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo "</form>";
|
||||
|
@ -213,10 +212,10 @@ if ($result === false) {
|
|||
$result = array ();
|
||||
}
|
||||
|
||||
$table->width = '98%';
|
||||
$table->cellpadding = 4;
|
||||
$table->cellspacing = 4;
|
||||
$table->class = "databox";
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->class = "databox data";
|
||||
$table->head = array ();
|
||||
$table->data = array ();
|
||||
$table->align = array ();
|
||||
|
@ -226,13 +225,16 @@ $table->head[1] = __('Type');
|
|||
$table->head[2] = __('Description');
|
||||
$table->head[3] = __('Action');
|
||||
|
||||
$table->align[1] = "center";
|
||||
$table->align[3] = "center";
|
||||
$table->align[1] = "left";
|
||||
$table->align[3] = "left";
|
||||
$table->size[0] = "30%";
|
||||
$table->size[1] = "5%";
|
||||
$table->size[3] = "8%";
|
||||
|
||||
foreach ($result as $row) {
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<span style="font-size: 7.2pt">' . $row["nombre"];
|
||||
$data[0] = '<span>' . $row["nombre"];
|
||||
if ($row["id_tipo_modulo"] > 0) {
|
||||
$data[1] = html_print_image("images/" . modules_show_icon_type ($row["id_tipo_modulo"]), true, array("border" => "0"));
|
||||
}
|
||||
|
@ -253,6 +255,6 @@ if (!empty ($table->data)) {
|
|||
unset ($table);
|
||||
}
|
||||
else {
|
||||
echo '<div class="nf">No modules</div>';
|
||||
ui_print_empty_data ( __('No modules') ) ;
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -708,10 +708,10 @@ if ($create_modules) {
|
|||
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
|
||||
echo "<form method='post' id='walk_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente=$id_agent'>";
|
||||
|
||||
$table->width = '98%';
|
||||
|
||||
$table->valign[0] = 'top';
|
||||
$table->valign[1] = 'top';
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->class = 'databox filters';
|
||||
|
||||
$table->data[0][0] = '<b>' . __('Target IP') . '</b>';
|
||||
$table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
|
||||
|
@ -738,10 +738,7 @@ html_print_table($table);
|
|||
unset($table);
|
||||
|
||||
//SNMP3 OPTIONS
|
||||
$table->width = '98%';
|
||||
|
||||
$table->valign[0] = 'top';
|
||||
$table->valign[1] = 'top';
|
||||
$table->width = '100%';
|
||||
|
||||
$table->data[2][1] = '<b>'.__('Auth user').'</b>';
|
||||
$table->data[2][2] = html_print_input_text ('snmp3_auth_user', $snmp3_auth_user, '', 15, 60, true);
|
||||
|
@ -799,7 +796,7 @@ if (!$fail) {
|
|||
html_print_input_hidden('snmp3_privacy_pass', $snmp3_privacy_pass);
|
||||
html_print_input_hidden('snmp3_security_level', $snmp3_security_level);
|
||||
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
|
||||
// Mode selector
|
||||
$modes = array();
|
||||
|
|
|
@ -325,10 +325,10 @@ foreach ($interfaces as $interface) {
|
|||
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
|
||||
echo "<form method='post' id='walk_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=$id_agent'>";
|
||||
|
||||
$table->width = '98%';
|
||||
|
||||
$table->valign[0] = 'top';
|
||||
$table->valign[1] = 'top';
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->class = 'databox filters';
|
||||
|
||||
$table->data[0][0] = '<b>' . __('Target IP') . '</b>';
|
||||
$table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
|
||||
|
@ -355,10 +355,7 @@ html_print_table($table);
|
|||
unset($table);
|
||||
|
||||
//SNMP3 OPTIONS
|
||||
$table->width = '98%';
|
||||
|
||||
$table->valign[0] = 'top';
|
||||
$table->valign[1] = 'top';
|
||||
$table->width = '100%';
|
||||
|
||||
$table->data[2][1] = '<b>'.__('Auth user').'</b>';
|
||||
$table->data[2][2] = html_print_input_text ('snmp3_auth_user', $snmp3_auth_user, '', 15, 60, true);
|
||||
|
@ -422,10 +419,7 @@ if (!empty($interfaces_list)) {
|
|||
html_print_input_hidden('snmp3_privacy_pass', $snmp3_privacy_pass);
|
||||
html_print_input_hidden('snmp3_security_level', $snmp3_security_level);
|
||||
|
||||
$table->width = '98%';
|
||||
|
||||
$table->valign[0] = 'top';
|
||||
$table->valign[1] = 'top';
|
||||
$table->width = '100%';
|
||||
|
||||
//Agent selector
|
||||
$table->data[0][0] = '<b>'.__('Interfaces').'</b>';
|
||||
|
|
|
@ -247,10 +247,10 @@ if ($create_modules) {
|
|||
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
|
||||
echo "<form method='post' id='wmi_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
|
||||
$table->width = '98%';
|
||||
|
||||
$table->valign[0] = 'top';
|
||||
$table->valign[1] = 'top';
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->class = 'databox filters';
|
||||
|
||||
$table->data[0][0] = '<b>' . __('Target IP') . '</b>';
|
||||
$table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
|
||||
|
|
|
@ -355,6 +355,26 @@ if ($id_agente) {
|
|||
. html_print_image ("images/wand_agent.png", true, array ( "title" => __('Agent wizard')))
|
||||
. '</a>';
|
||||
|
||||
// Hidden subtab layer
|
||||
$agent_wizard['sub_menu'] .= '<ul class="mn subsubmenu" style="display:none; float:none;">';
|
||||
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
|
||||
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'
|
||||
. html_print_image ("images/wand_snmp.png", true, array ( "title" => __('SNMP Wizard')))
|
||||
. '</a>';
|
||||
$agent_wizard['sub_menu'] .= '</li>';
|
||||
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
|
||||
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente='.$id_agente.'">'
|
||||
. html_print_image ("images/wand_interfaces.png", true, array ( "title" => __('SNMP Interfaces wizard')))
|
||||
. '</a>';
|
||||
$agent_wizard['sub_menu'] .= '</li>';
|
||||
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
|
||||
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente='.$id_agente.'">'
|
||||
. html_print_image ("images/wand_wmi.png", true, array ( "title" => __('WMI Wizard')))
|
||||
. '</a>';
|
||||
$agent_wizard['sub_menu'] .= '</li>';
|
||||
$agent_wizard['sub_menu'] .= '</ul>';
|
||||
|
||||
|
||||
if ($tab == "agent_wizard")
|
||||
$agent_wizard['active'] = true;
|
||||
else
|
||||
|
@ -1539,31 +1559,8 @@ switch ($tab) {
|
|||
break;
|
||||
}
|
||||
|
||||
// Hidden subtab layer
|
||||
echo '<div id="agent_wizard_subtabs">';
|
||||
echo '<ul class="mn subsubmenu" style="background: #555555;">';
|
||||
|
||||
echo '<li class="nomn tab_godmode" style="text-align: center;">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'
|
||||
. html_print_image ("images/wand_snmp.png", true, array ( "title" => __('SNMP Wizard')))
|
||||
. '</a>';
|
||||
echo '<li>';
|
||||
|
||||
echo '<li class="nomn tab_godmode" style="text-align: center;">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente='.$id_agente.'">'
|
||||
. html_print_image ("images/wand_interfaces.png", true, array ( "title" => __('SNMP Interfaces wizard')))
|
||||
. '</a>';
|
||||
echo '<li>';
|
||||
|
||||
echo '<li class="nomn tab_godmode" style="text-align: center;">';
|
||||
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente='.$id_agente.'">'
|
||||
. html_print_image ("images/wand_wmi.png", true, array ( "title" => __('WMI Wizard')))
|
||||
. '</a>';
|
||||
echo '<li>';
|
||||
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
var wizard_tab_showed = 0;
|
||||
|
@ -1572,23 +1569,23 @@ echo '</div>';
|
|||
// Control the tab and subtab hover. When mouse leave one,
|
||||
// check if is hover the other before hide the subtab
|
||||
$('.agent_wizard_tab').hover(agent_wizard_tab_show, agent_wizard_tab_hide);
|
||||
|
||||
$('#agent_wizard_subtabs').hover(agent_wizard_tab_show, agent_wizard_tab_hide);
|
||||
|
||||
});
|
||||
|
||||
// Set the position and width of the subtab
|
||||
/*
|
||||
function agent_wizard_tab_setup() {
|
||||
$('#agent_wizard_subtabs').css('left', $('.agent_wizard_tab').offset().left)
|
||||
$('#agent_wizard_subtabs').css('top', $('.agent_wizard_tab').offset().top + $('.agent_wizard_tab').height() + 4)
|
||||
$('#agent_wizard_subtabs').css('width', $('.agent_wizard_tab').width() + 6)
|
||||
$('#agent_wizard_subtabs').css('left', $('.agent_wizard_tab').offset().left-5)
|
||||
$('#agent_wizard_subtabs').css('top', $('.agent_wizard_tab').offset().top + $('.agent_wizard_tab').height() + 7)
|
||||
$('#agent_wizard_subtabs').css('width', $('.agent_wizard_tab').width() + 19)
|
||||
}
|
||||
|
||||
*/
|
||||
function agent_wizard_tab_show() {
|
||||
agent_wizard_tab_setup();
|
||||
|
||||
wizard_tab_showed = wizard_tab_showed + 1;
|
||||
|
||||
if(wizard_tab_showed == 1) {
|
||||
$('#agent_wizard_subtabs').show("fast");
|
||||
$('.subsubmenu').show("fast");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1597,14 +1594,10 @@ echo '</div>';
|
|||
|
||||
setTimeout(function() {
|
||||
if(wizard_tab_showed <= 0) {
|
||||
$('#agent_wizard_subtabs').hide("fast");
|
||||
$('.subsubmenu').hide("fast");
|
||||
}
|
||||
},500);
|
||||
},1500);
|
||||
}
|
||||
|
||||
$(window).resize(function() {
|
||||
agent_wizard_tab_setup();
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -125,7 +125,7 @@ if ($disable_agent) {
|
|||
__('Successfully disabled'), __('Could not be disabled'));
|
||||
}
|
||||
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox' width='98%' style='font-weight: bold; margin-bottom: 10px;'>
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
|
||||
<tr>";
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>";
|
||||
|
@ -165,14 +165,6 @@ echo "</form>";
|
|||
echo "<td>";
|
||||
echo "</tr></table>";
|
||||
|
||||
echo '<div style="text-align: right; float: right;">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
html_print_input_hidden ('new_agent', 1);
|
||||
html_print_submit_button (__('Create agent'), 'crt-1', false, 'class="sub next"');
|
||||
echo "</form>";
|
||||
echo "</div>";
|
||||
|
||||
|
||||
$order_collation = "";
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
|
@ -422,7 +414,7 @@ ui_pagination ($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modifi
|
|||
|
||||
if ($agents !== false) {
|
||||
|
||||
echo "<table cellpadding='4' id='agent_list' cellspacing='4' width='98%' class='databox'>";
|
||||
echo "<table cellpadding='4' id='agent_list' cellspacing='4' width='100%' class='databox data'>";
|
||||
echo "<th>".__('Agent name') . ' ' .
|
||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' .
|
||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '</a>';
|
||||
|
@ -572,7 +564,7 @@ if ($agents !== false) {
|
|||
}
|
||||
echo "</table>";
|
||||
ui_pagination ($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled", $offset);
|
||||
echo "<table width='98%'><tr><td align='right'>";
|
||||
echo "<table width='100%'><tr><td align='right'>";
|
||||
}
|
||||
else {
|
||||
echo "<div class='nf'>" . __('There are no defined agents') . "</div>";
|
||||
|
@ -581,7 +573,7 @@ else {
|
|||
|
||||
if (check_acl ($config["id_user"], 0, "AW")) {
|
||||
// Create agent button
|
||||
echo '<div style="text-align: right; float: right;">';
|
||||
echo '<div style="text-align: right;">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
html_print_input_hidden ('new_agent', 1);
|
||||
html_print_submit_button (__('Create agent'), 'crt-2', false,
|
||||
|
|
|
@ -32,16 +32,16 @@ $search_string = io_safe_output(urldecode(trim(get_parameter ("search_string", "
|
|||
// Search string filter form
|
||||
//echo '<form id="create_module_type" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'">';
|
||||
echo '<form id="create_module_type" method="post" action="'.$url.'">';
|
||||
echo '<table width="98%" cellpadding="2" cellspacing="2" class="databox" >';
|
||||
echo "<tr><td class='datos' style='width:20%'>";
|
||||
echo '<table width="100%" cellpadding="2" cellspacing="2" class="databox filters" >';
|
||||
echo "<tr><td class='datos' style='width:20%; font-weight: bold;'>";
|
||||
echo __('Search') . ' ' .
|
||||
html_print_input_text ('search_string', $search_string, '', 15, 255, true);
|
||||
echo "</td>";
|
||||
echo "<td class='datos' style='width:20%'>";
|
||||
html_print_submit_button (__('Filter'), 'filter', false, 'class="sub search"');
|
||||
echo "</td>";
|
||||
echo "<td class='datos' style='width:20%'>";
|
||||
echo '</form>';
|
||||
echo "<td class='datos' style='width:20%'></td>";
|
||||
//echo '</form>';
|
||||
// Check if there is at least one server of each type available to assign that
|
||||
// kind of modules. If not, do not show server type in combo
|
||||
|
||||
|
@ -110,7 +110,9 @@ if (($policy_page) || (isset($agent))) {
|
|||
|
||||
if ($show_creation) {
|
||||
// Create module/type combo
|
||||
echo '<form id="create_module_type" method="post" action="'.$url.'">';
|
||||
//echo '<form id="create_module_type" method="post" action="'.$url.'">';
|
||||
echo '<td class="datos" style="font-weight: bold;">';
|
||||
echo __("Type");
|
||||
html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' );
|
||||
html_print_input_hidden ('edit_module', 1);
|
||||
echo '</td>';
|
||||
|
@ -118,15 +120,16 @@ if (($policy_page) || (isset($agent))) {
|
|||
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo "</form>";
|
||||
//echo "</form>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
echo '<div style="text-align: right; width: 98%;">';
|
||||
echo '<div style="text-align: right; width: 100%;padding-top:10px;padding-bottom:10px">';
|
||||
echo "<strong>";
|
||||
echo "<a style='color: #004A1B;' target='_blank' href='http://pandorafms.com/Library/Library/'>".__("Get more modules in Pandora FMS Library")."</a>";
|
||||
echo "<a style='color: #373737;' target='_blank' href='http://pandorafms.com/Library/Library/'>".__("Get more modules in Pandora FMS Library")."</a>";
|
||||
echo "</strong>";
|
||||
echo '</div>';
|
||||
|
||||
|
@ -476,7 +479,7 @@ $total_modules = db_get_value_sql($sql_total_modules);
|
|||
$total_modules = isset ($total_modules) ? $total_modules : 0;
|
||||
|
||||
if ($modules === false) {
|
||||
echo "<div class='nf'>" . __('No available data to show') . "</div>";
|
||||
ui_print_empty_data ( __('No available data to show') );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -494,7 +497,8 @@ if ($paginate_module) {
|
|||
ui_pagination($total_modules, $url);
|
||||
}
|
||||
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
$table->head = array ();
|
||||
$table->head[0] = __('Name') . ' ' .
|
||||
'<a href="' . $url . '&sort_field=name&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '</a>' .
|
||||
|
@ -526,7 +530,7 @@ $table->rowstyle = array();
|
|||
$table->style = array ();
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->size = array ();
|
||||
$table->size[2] = '55px';
|
||||
$table->size[2] = '70px';
|
||||
$table->align = array ();
|
||||
$table->align[2] = 'left';
|
||||
$table->align[8] = 'left';
|
||||
|
|
|
@ -114,14 +114,14 @@ if (strstr($page, "policy_modules") === false && $id_agent_module) {
|
|||
$update_module_id = (int) get_parameter_get ('update_module');
|
||||
|
||||
$table_simple->id = 'simple';
|
||||
$table_simple->width = '98%';
|
||||
$table_simple->class = 'databox_color';
|
||||
$table_simple->width = '100%';
|
||||
$table_simple->class = 'databox';
|
||||
$table_simple->data = array ();
|
||||
$table_simple->colspan = array ();
|
||||
$table_simple->style = array ();
|
||||
$table_simple->style[0] = 'font-weight: bold; vertical-align: top; width: 26%';
|
||||
$table_simple->style[0] = 'font-weight: bold; width: 26%;';
|
||||
$table_simple->style[1] = 'width: 40%';
|
||||
$table_simple->style[2] = 'font-weight: bold; vertical-align: top';
|
||||
$table_simple->style[2] = 'font-weight: bold;';
|
||||
|
||||
#$table_simple->colspan[4][1] = 3;
|
||||
$table_simple->colspan[5][1] = 3;
|
||||
|
@ -292,13 +292,13 @@ else {
|
|||
|
||||
/* Advanced form part */
|
||||
$table_advanced->id = 'advanced';
|
||||
$table_advanced->width = '98%';
|
||||
$table_advanced->class = 'databox_color';
|
||||
$table_advanced->width = '100%';
|
||||
$table_advanced->class = 'databox';
|
||||
$table_advanced->data = array ();
|
||||
$table_advanced->style = array ();
|
||||
$table_advanced->style[0] =
|
||||
$table_advanced->style[3] =
|
||||
$table_advanced->style[5] = 'font-weight: bold; vertical-align: top';
|
||||
$table_advanced->style[5] = 'font-weight: bold;';
|
||||
$table_advanced->colspan = array ();
|
||||
|
||||
$table_advanced->data[0][0] = __('Description');
|
||||
|
|
|
@ -159,6 +159,9 @@ if ($create_downtime || $update_downtime) {
|
|||
else if ($type_execution == 'once' && $datetime_from >= $datetime_to) {
|
||||
ui_print_error_message(__('Not created. Error inserting data') . ". " .__('The end date must be higher than the start date'));
|
||||
}
|
||||
else if ($type_execution == 'once' && $datetime_to <= $now) {
|
||||
ui_print_error_message(__('Not created. Error inserting data') . ". " .__('The end date must be higher than the current time'));
|
||||
}
|
||||
else if ($type_execution == 'periodically'
|
||||
&& (($type_periodicity == 'weekly' && $periodically_time_from >= $periodically_time_to)
|
||||
|| ($type_periodicity == 'monthly' && $periodically_day_from == $periodically_day_to && $periodically_time_from >= $periodically_time_to))) {
|
||||
|
@ -216,7 +219,6 @@ if ($create_downtime || $update_downtime) {
|
|||
'description' => $description,
|
||||
'date_from' => $datetime_from,
|
||||
'date_to' => $datetime_to,
|
||||
'executed' => 0,
|
||||
'id_group' => $id_group,
|
||||
'only_alerts' => 0,
|
||||
'monday' => $monday,
|
||||
|
@ -307,18 +309,22 @@ if ($id_downtime > 0) {
|
|||
$type_downtime = $result['type_downtime'];
|
||||
$type_execution = $result['type_execution'];
|
||||
$type_periodicity = $result['type_periodicity'];
|
||||
$executed = $result['executed'];
|
||||
|
||||
if ($id_group == 0)
|
||||
$id_group = $result['id_group'];
|
||||
}
|
||||
|
||||
// when the planned down time is in execution, only action to postpone on once type is enabled and the other are disabled.
|
||||
$disabled_in_execution = $executed ? 1 : 0;
|
||||
|
||||
$table->class = 'databox_color';
|
||||
$table->width = '98%';
|
||||
$table->data = array ();
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text ('name', $name, '', 25, 40, true);
|
||||
$table->data[0][1] = html_print_input_text ('name', $name, '', 25, 40, true, $disabled_in_execution);
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = html_print_select_groups(false, "AW", true, 'id_group', $id_group, '', '', 0, true);
|
||||
$table->data[1][1] = html_print_select_groups(false, "AW", true, 'id_group', $id_group, '', '', 0, true, false, true, '', $disabled_in_execution);
|
||||
$table->data[2][0] = __('Description');
|
||||
$table->data[2][1] = html_print_textarea ('description', 3, 35, $description, '', true);
|
||||
|
||||
|
@ -329,11 +335,12 @@ $table->data[3][1] = html_print_select(array('quiet' => __('Quiet'),
|
|||
'disable_agents' => __('Disabled Agents'),
|
||||
'disable_agents_alerts' => __('Disabled only Alerts')),
|
||||
'type_downtime', $type_downtime, 'change_type_downtime()', '', 0, true, false, true,
|
||||
'');
|
||||
'', $disabled_in_execution);
|
||||
$table->data[4][0] = __('Execution');
|
||||
$table->data[4][1] = html_print_select(array('once' => __('Once'),
|
||||
'periodically' => __('Periodically')),
|
||||
'type_execution', $type_execution, 'change_type_execution();', '', 0, true);
|
||||
'type_execution', $type_execution, 'change_type_execution();', '', 0, true,
|
||||
false, true, '', $disabled_in_execution);
|
||||
|
||||
$days = array_combine(range(1, 31), range(1, 31));
|
||||
$table->data[5][0] = __('Configure the time') . " " . ui_print_help_icon ('planned_downtime_time', true);;
|
||||
|
@ -345,9 +352,9 @@ $table->data[5][1] = "
|
|||
__('From:') .
|
||||
"</td>
|
||||
<td>".
|
||||
html_print_input_text ('once_date_from', $once_date_from, '', 10, 10, true) .
|
||||
html_print_input_text ('once_date_from', $once_date_from, '', 10, 10, true, $disabled_in_execution) .
|
||||
ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) .
|
||||
html_print_input_text ('once_time_from', $once_time_from, '', 9, 9, true) .
|
||||
html_print_input_text ('once_time_from', $once_time_from, '', 9, 9, true, $disabled_in_execution) .
|
||||
ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) .
|
||||
"</td>
|
||||
</tr>
|
||||
|
@ -372,7 +379,8 @@ $table->data[5][1] = "
|
|||
'weekly' => __('Weekly'),
|
||||
'monthly' => __('Monthly')),
|
||||
'type_periodicity', $type_periodicity,
|
||||
'change_type_periodicity();', '', 0, true) .
|
||||
'change_type_periodicity();', '', 0, true,
|
||||
false, true, '', $disabled_in_execution) .
|
||||
"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -380,25 +388,25 @@ $table->data[5][1] = "
|
|||
<table id='weekly_item' style='display: none;'>
|
||||
<tr>
|
||||
<td>" . __('Mon') .
|
||||
html_print_checkbox ('monday', 1, $monday, true) .
|
||||
html_print_checkbox ('monday', 1, $monday, true, $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . __('Tue') .
|
||||
html_print_checkbox ('tuesday', 1, $tuesday, true) .
|
||||
html_print_checkbox ('tuesday', 1, $tuesday, true, $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . __('Wed') .
|
||||
html_print_checkbox ('wednesday', 1, $wednesday, true) .
|
||||
html_print_checkbox ('wednesday', 1, $wednesday, true, $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . __('Thu') .
|
||||
html_print_checkbox ('thursday', 1, $thursday, true) .
|
||||
html_print_checkbox ('thursday', 1, $thursday, true, $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . __('Fri') .
|
||||
html_print_checkbox ('friday', 1, $friday, true) .
|
||||
html_print_checkbox ('friday', 1, $friday, true, $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . __('Sat') .
|
||||
html_print_checkbox ('saturday', 1, $saturday, true) .
|
||||
html_print_checkbox ('saturday', 1, $saturday, true, $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . __('Sun') .
|
||||
html_print_checkbox ('sunday', 1, $sunday, true) .
|
||||
html_print_checkbox ('sunday', 1, $sunday, true, $disabled_in_execution) .
|
||||
"</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -407,12 +415,14 @@ $table->data[5][1] = "
|
|||
<td>" . __('From day:') . "</td>
|
||||
<td>".
|
||||
html_print_select($days,
|
||||
'periodically_day_from', $periodically_day_from, '', '', 0, true) .
|
||||
'periodically_day_from', $periodically_day_from, '', '', 0, true,
|
||||
false, true, '', $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . __('To day:') . "</td>
|
||||
<td>".
|
||||
html_print_select($days,
|
||||
'periodically_day_to', $periodically_day_to, '', '', 0, true) .
|
||||
'periodically_day_to', $periodically_day_to, '', '', 0, true,
|
||||
false, true, '', $disabled_in_execution) .
|
||||
"</td>
|
||||
<td>" . ui_print_help_tip(__('The end day must be higher than the start day'), true) . "</td>
|
||||
</tr>
|
||||
|
@ -423,7 +433,7 @@ $table->data[5][1] = "
|
|||
<td>".
|
||||
html_print_input_text (
|
||||
'periodically_time_from',
|
||||
$periodically_time_from, '', 7, 7, true) .
|
||||
$periodically_time_from, '', 7, 7, true, $disabled_in_execution) .
|
||||
ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds').
|
||||
".<br>".__('The end time must be higher than the start time'), true) .
|
||||
"</td>
|
||||
|
@ -431,7 +441,7 @@ $table->data[5][1] = "
|
|||
<td>".
|
||||
html_print_input_text (
|
||||
'periodically_time_to',
|
||||
$periodically_time_to, '', 7, 7, true) .
|
||||
$periodically_time_to, '', 7, 7, true, $disabled_in_execution) .
|
||||
ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds').
|
||||
".<br>".__('The end time must be higher than the start time'), true) .
|
||||
"</td>
|
||||
|
@ -498,7 +508,7 @@ if ($id_downtime > 0) {
|
|||
}
|
||||
|
||||
$disabled_add_button = false;
|
||||
if (empty($data)) {
|
||||
if (empty($data) || $disabled_in_execution) {
|
||||
$disabled_add_button = true;
|
||||
}
|
||||
|
||||
|
@ -589,11 +599,13 @@ if ($id_downtime > 0) {
|
|||
if (($type_downtime != 'disable_agents_alerts')
|
||||
&& ($type_downtime != 'disable_agents')) {
|
||||
|
||||
$data[5] = '<a href="javascript:show_editor_module(' . $downtime["id_agente"] . ');">' .
|
||||
$href = $executed ? 'javascript:void(0);' : 'javascript:show_editor_module(' . $downtime["id_agente"] . ');';
|
||||
$data[5] = '<a href="' . $href . '">' .
|
||||
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Delete'))) . "</a>";
|
||||
|
||||
}
|
||||
$data[5] .= '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor'.
|
||||
$href = $executed ? 'javascript:void(0);' : 'index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor';
|
||||
$data[5] .= '<a href="' . $href .
|
||||
'&id_agent=' . $downtime["id_agente"] .
|
||||
'&delete_downtime_agent=1' .
|
||||
'&id_downtime_agent=' . $downtime["id"] .
|
||||
|
@ -994,5 +1006,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
|
|||
}
|
||||
});
|
||||
}
|
||||
// Disable datepickers when it has readonly attribute
|
||||
$('input.hasDatepicker[readonly]').disable();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -499,6 +499,12 @@ else {
|
|||
'delete_downtime=1&id_downtime='.$downtime['id'].'">' .
|
||||
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete')));
|
||||
}
|
||||
elseif ($downtime["executed"] == 1 && $downtime['type_execution'] == 'once'){
|
||||
$data[8] = '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&' .
|
||||
'edit_downtime=1&id_downtime='.$downtime['id'].'">' .
|
||||
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>';
|
||||
$data[9]= "N/A";
|
||||
}
|
||||
else {
|
||||
$data[8]= "N/A";
|
||||
$data[9]= "N/A";
|
||||
|
|
|
@ -31,17 +31,21 @@ include_once($config['homedir'] . '/include/functions_users.php');
|
|||
$pure = get_parameter('pure', 0);
|
||||
|
||||
$table->id = 'add_alert_table';
|
||||
$table->class = 'databox';
|
||||
$table->width = '98%';
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->head = array ();
|
||||
$table->data = array ();
|
||||
$table->size = array ();
|
||||
$table->size = array ();
|
||||
$table->size[0] = '20%';
|
||||
$table->size[1] = '80%';
|
||||
$table->style[0] = 'font-weight: bold; vertical-align: top;';
|
||||
$table->align[0] = 'left';
|
||||
$table->align[1] = 'left';
|
||||
$table->size[0] = '10%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '10%';
|
||||
$table->size[3] = '20%';
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[1] = 'font-weight: bold; ';
|
||||
$table->style[2] = 'font-weight: bold; ';
|
||||
$table->style[3] = 'font-weight: bold; ';
|
||||
|
||||
// This is because if this view is reused after list alert view then
|
||||
// styles in the previous view can affect this table.
|
||||
$table->rowstyle[0] = '';
|
||||
|
@ -76,7 +80,7 @@ $table->data[0][1] .= '<span id="value"> </span></span>';
|
|||
$table->data[0][1] .= ' <span id="module_loading" class="invisible">';
|
||||
$table->data[0][1] .= html_print_image('images/spinner.png', true) . '</span>';
|
||||
|
||||
$table->data[1][0] = __('Template');
|
||||
$table->data[0][2] = __('Template');
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
||||
$templates = alerts_get_alert_templates (false, array ('id', 'name'));
|
||||
|
@ -87,18 +91,18 @@ else {
|
|||
$templates = alerts_get_alert_templates (array ('id_group IN (' . $filter_groups . ')'), array ('id', 'name'));
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_select (index_array ($templates, 'id', 'name'),
|
||||
$table->data[0][3] = html_print_select (index_array ($templates, 'id', 'name'),
|
||||
'template', '', '', __('Select'), 0, true, false, true, '', false, 'width: 250px;');
|
||||
$table->data[1][1] .= ' <a class="template_details invisible" href="#">' .
|
||||
$table->data[0][3] .= ' <a class="template_details invisible" href="#">' .
|
||||
html_print_image("images/zoom.png", true, array("class" => 'img_help')) . '</a>';
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
$table->data[1][1] .= html_print_image ('images/add.png', true);
|
||||
$table->data[1][1] .= __('Create Template');
|
||||
$table->data[1][1] .= '</a>';
|
||||
$table->data[0][3] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
$table->data[0][3] .= html_print_image ('images/add.png', true);
|
||||
$table->data[0][3] .= __('Create Template');
|
||||
$table->data[0][3] .= '</a>';
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('Actions');
|
||||
$table->data[1][0] = __('Actions');
|
||||
|
||||
$groups_user = users_get_groups($config["id_user"]);
|
||||
if (!empty($groups_user)) {
|
||||
|
@ -106,28 +110,27 @@ if (!empty($groups_user)) {
|
|||
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
|
||||
$actions = db_get_all_rows_sql($sql);
|
||||
}
|
||||
$table->data[2][1] = '<div class="actions_container">';
|
||||
$table->data[2][1] .= html_print_select(
|
||||
|
||||
$table->data[1][1] = html_print_select(
|
||||
index_array($actions, 'id', 'name'), 'action_select', '', '',
|
||||
__('Default action'), '0', true, '', true, '', false,
|
||||
'width: 250px;');
|
||||
$table->data[2][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
|
||||
$table->data[2][1] .= __('Number of alerts match from').' ';
|
||||
$table->data[2][1] .= html_print_input_text ('fires_min', '', '', 4, 10, true);
|
||||
$table->data[2][1] .= ' ' . __('to') . ' ';
|
||||
$table->data[2][1] .= html_print_input_text ('fires_max', '', '', 4, 10, true);
|
||||
$table->data[2][1] .= ui_print_help_icon ("alert-matches", true,
|
||||
$table->data[1][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
|
||||
$table->data[1][1] .= __('Number of alerts match from').' ';
|
||||
$table->data[1][1] .= html_print_input_text ('fires_min', '', '', 4, 10, true);
|
||||
$table->data[1][1] .= ' ' . __('to') . ' ';
|
||||
$table->data[1][1] .= html_print_input_text ('fires_max', '', '', 4, 10, true);
|
||||
$table->data[1][1] .= ui_print_help_icon ("alert-matches", true,
|
||||
ui_get_full_url(false, false, false, false));
|
||||
$table->data[2][1] .= '</span>';
|
||||
$table->data[2][1] .= '</div>';
|
||||
$table->data[1][1] .= '</span>';
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
$table->data[2][1] .= '<br>' . html_print_image ('images/add.png', true);
|
||||
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
$table->data[2][1] .= __('Create Action');
|
||||
$table->data[2][1] .= '</a>';
|
||||
$table->data[1][1] .= '' . html_print_image ('images/add.png', true);
|
||||
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
$table->data[1][1] .= __('Create Action');
|
||||
$table->data[1][1] .= '</a>';
|
||||
}
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_extended_select_for_time ('module_action_threshold', 0, '', 0,
|
||||
$table->data[1][2] = __('Threshold');
|
||||
$table->data[1][3] = html_print_extended_select_for_time ('module_action_threshold', 0, '', 0,
|
||||
__('None'), false, true) . ui_print_help_icon ('action_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
|
||||
echo '<form class="add_alert_form" method="post">';
|
||||
|
|
|
@ -48,13 +48,14 @@ else {
|
|||
}
|
||||
|
||||
// Table for filter controls
|
||||
$form_filter = '<form method="post" action="index.php?sec=' . $sec . '&sec2=' . $sec2 . '&refr=' . ((int)get_parameter('refr', 0)) . '&pure='.$config["pure"].'">';
|
||||
$form_filter .= "<input type='hidden' name='search' value='1' />\n";
|
||||
$form_filter .= '<table style="width: 98%;" cellpadding="4" cellspacing="4" class="databox">'."\n";
|
||||
$form_filter .= "<tr>\n";
|
||||
$form_filter .= "<td>" . __('Template name') . "</td><td>";
|
||||
$form_filter = '<form method="post" action="index.php?sec=' . $sec . '&sec2=' . $sec2 . '&refr=' . ((int)get_parameter('refr', 0)) .
|
||||
'&pure='.$config["pure"].'">';
|
||||
$form_filter .= "<input type='hidden' name='search' value='1' />";
|
||||
$form_filter .= '<table style="width: 100%;" cellpadding="0" cellspacing="0" class="databox filters">';
|
||||
$form_filter .= "<tr>";
|
||||
$form_filter .= "<td style='font-weight: bold;'>" . __('Template name') . "</td><td>";
|
||||
$form_filter .= html_print_input_text ('template_name', $templateName, '', 12, 255, true);
|
||||
$form_filter .= "</td>\n";
|
||||
$form_filter .= "</td>";
|
||||
$temp = agents_get_agents();
|
||||
$arrayAgents = array();
|
||||
|
||||
|
@ -65,7 +66,7 @@ if ($temp) {
|
|||
}
|
||||
}
|
||||
|
||||
$form_filter .= "<td>".__('Agents')."</td><td>";
|
||||
$form_filter .= "<td style='font-weight: bold;'>".__('Agents')."</td><td>";
|
||||
|
||||
|
||||
$params = array();
|
||||
|
@ -79,12 +80,12 @@ $params['metaconsole_enabled'] = false;
|
|||
$form_filter .= ui_print_agent_autocomplete_input($params);
|
||||
|
||||
|
||||
$form_filter .= "</td>\n";
|
||||
$form_filter .= "</td>";
|
||||
|
||||
$form_filter .= "<td>".__('Module name')."</td><td>";
|
||||
$form_filter .= "<td style='font-weight: bold;'>".__('Module name')."</td><td>";
|
||||
$form_filter .= html_print_input_text ('module_name', $moduleName, '', 12, 255, true);
|
||||
$form_filter .= "</td>\n";
|
||||
$form_filter .= "</tr>\n";
|
||||
$form_filter .= "</td>";
|
||||
$form_filter .= "</tr>";
|
||||
|
||||
$all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
||||
|
@ -94,7 +95,7 @@ if ($groups_user === false) {
|
|||
}
|
||||
$groups_id = implode(',', array_keys($groups_user));
|
||||
|
||||
$form_filter .= "<tr>\n";
|
||||
$form_filter .= "<tr>";
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
|
@ -111,39 +112,47 @@ if (is_array($temp)) {
|
|||
$arrayActions[$actionElement['id']] = $actionElement['name'];
|
||||
}
|
||||
}
|
||||
$form_filter .= "<td>".__('Actions')."</td><td>";
|
||||
$form_filter .= "<td style='font-weight: bold;'>".__('Actions')."</td><td>";
|
||||
$form_filter .= html_print_select ($arrayActions, "action_id", $actionID, '', __('All'), -1, true);
|
||||
$form_filter .= "</td>\n";
|
||||
$form_filter .= "<td>".__('Field content')."</td><td>";
|
||||
$form_filter .= html_print_input_text ('field_content', $fieldContent, '', 12, 255, true);
|
||||
$form_filter .= "</td>\n";
|
||||
$form_filter .= "<td>".__('Priority')."</td><td>";
|
||||
$form_filter .= html_print_select (get_priorities (), 'priority',$priority, '', __('All'), -1, true);
|
||||
$form_filter .= "</td>";
|
||||
$form_filter .= "</tr>\n";
|
||||
$form_filter .= "<td style='font-weight: bold;'>".__('Field content')."</td><td>";
|
||||
$form_filter .= html_print_input_text ('field_content', $fieldContent, '', 12, 255, true);
|
||||
$form_filter .= "</td>";
|
||||
$form_filter .= "<td style='font-weight: bold;'>".__('Priority')."</td><td>";
|
||||
$form_filter .= html_print_select (get_priorities (), 'priority',$priority, '', __('All'), -1, true);
|
||||
$form_filter .= "</td style='font-weight: bold;'>";
|
||||
$form_filter .= "</tr>";
|
||||
|
||||
$form_filter .= "<tr>\n";
|
||||
$form_filter .= "<td>".__('Enabled / Disabled')."</td><td>";
|
||||
$form_filter .= "<tr>";
|
||||
$form_filter .= "<td style='font-weight: bold;'>".__('Enabled / Disabled')."</td><td>";
|
||||
$ed_list = array ();
|
||||
$ed_list[0] = __('Enable');
|
||||
$ed_list[1] = __('Disable');
|
||||
$form_filter .= html_print_select ($ed_list, 'enabledisable', $enabledisable, '', __('All'), -1, true);
|
||||
$form_filter .= "</td><td>".__('Standby')."</td><td>";
|
||||
$form_filter .= "</td><td style='font-weight: bold;'>".__('Standby')."</td><td>";
|
||||
$sb_list = array ();
|
||||
$sb_list[1] = __('Standby on');
|
||||
$sb_list[0] = __('Standby off');
|
||||
$form_filter .= html_print_select ($sb_list, 'standby', $standby, '', __('All'), -1, true);
|
||||
$form_filter .= "</td></tr>\n";
|
||||
$form_filter .= "</td></tr>";
|
||||
if ( defined("METACONSOLE") ) {
|
||||
$form_filter .= "<tr>";
|
||||
$form_filter .= "<td colspan='6' align='right'>";
|
||||
$form_filter .= html_print_submit_button (__('Update'), '', false, 'class="sub upd"', true);
|
||||
$form_filter .= "</td>";
|
||||
$form_filter .= "</tr>";
|
||||
$form_filter .= "</table>";
|
||||
}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);
|
||||
$form_filter .= "</div>";
|
||||
}
|
||||
|
||||
$form_filter .= "<tr>\n";
|
||||
$form_filter .= "<td colspan='6' align='right'>";
|
||||
$form_filter .= html_print_submit_button (__('Update'), '', false, 'class="sub upd"', true);
|
||||
$form_filter .= "</td>";
|
||||
$form_filter .= "</tr>\n";
|
||||
$form_filter .= "</table>\n";
|
||||
$form_filter .= "</form>\n";
|
||||
$form_filter .= "</form>";
|
||||
if ( defined("METACONSOLE"))
|
||||
echo "<br>";
|
||||
|
||||
echo "<br>";
|
||||
ui_toggle($form_filter, __('Alert control filter'), __('Toggle filter(s)'));
|
||||
|
||||
$simple_alerts = array();
|
||||
|
@ -323,9 +332,14 @@ if (!$id_agente) {
|
|||
else {
|
||||
$url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente . '&offset=' . $offset . $form_params;
|
||||
}
|
||||
|
||||
$table->class = 'alert_list databox';
|
||||
$table->width = '98%';
|
||||
if ( defined("METACONSOLE") )
|
||||
$table->class = 'alert_list databox';
|
||||
else
|
||||
$table->class = 'databox filters';
|
||||
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->size = array ();
|
||||
|
||||
$table->align[2] = 'left';
|
||||
|
@ -353,7 +367,7 @@ if (! $id_agente) {
|
|||
else {
|
||||
/* Different sizes or the layout screws up */
|
||||
$table->size[0] = '0%';
|
||||
$table->size[1] = '30%';
|
||||
$table->size[1] = '10%';
|
||||
$table->size[2] = '30%';
|
||||
/* if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
||||
$table->size[4] = '25%';
|
||||
|
@ -674,7 +688,7 @@ if (isset($data)) {
|
|||
html_print_table ($table);
|
||||
}
|
||||
else {
|
||||
echo "<div class='nf'>" . __('No alerts defined') . "</div>";
|
||||
ui_print_info_message ( array('no_close' => true, 'message' => __('No alerts defined') ) );
|
||||
}
|
||||
|
||||
// Create alert button
|
||||
|
|
|
@ -50,7 +50,7 @@ ui_print_page_header (__('Alert details'), "images/op_alerts.png", false, "", fa
|
|||
|
||||
// TABLE DETAILS
|
||||
|
||||
$table_details->class = 'alternate';
|
||||
$table_details->class = 'databox';
|
||||
$table_details->width = '100%';
|
||||
$table_details->size = array ();
|
||||
$table_details->data = array();
|
||||
|
@ -129,7 +129,7 @@ if (enterprise_installed() && $alert['id_policy_alerts'] != 0) {
|
|||
|
||||
// TABLE CONDITIONS
|
||||
|
||||
$table_conditions->class = 'alternate';
|
||||
$table_conditions->class = 'databox';
|
||||
$table_conditions->width = '100%';
|
||||
$table_conditions->size = array ();
|
||||
$table_conditions->data = array();
|
||||
|
|
|
@ -302,7 +302,7 @@ $(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);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ $id = (int) get_parameter ('id');
|
|||
$update = (string)get_parameter('update', 0);
|
||||
$create = (string)get_parameter('create', 0);
|
||||
|
||||
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
||||
if ($id) {
|
||||
$permission = events_check_event_filter_group ($id);
|
||||
if (!$permission) { // User doesn't have permissions to see this filter
|
||||
|
@ -180,15 +182,12 @@ $table->data = array ();
|
|||
$table->data[0][0] = '<b>'.__('Filter name').'</b>';
|
||||
$table->data[0][1] = html_print_input_text ('id_name', $id_name, false, 20, 80, true);
|
||||
|
||||
$table->data[1][0] = '<b>'.__('Filter group').'</b>' . ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true);
|
||||
$table->data[1][1] = html_print_select_groups($config['id_user'], "EW",
|
||||
$own_info['is_admin'], 'id_group_filter', $id_group_filter, '', '', -1, true,
|
||||
false, false);
|
||||
$table->data[1][0] = '<b>'.__('Save in group').'</b>' . ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true);
|
||||
$table->data[1][1] = html_print_select_groups($config['id_user'], "ER", users_can_manage_group_all(), "id_group_filter", $id_group_filter, '', '', -1, true, false, false, '', false, '', false, false, 'id_group_filter', $strict_user);
|
||||
|
||||
$table->data[2][0] = '<b>'.__('Group').'</b>';
|
||||
$table->data[2][1] = html_print_select_groups($config['id_user'], "EW",
|
||||
users_can_manage_group_all(), 'id_group', $id_group, '', '', -1, true,
|
||||
false, false);
|
||||
$table->data[2][1] = html_print_select_groups($config["id_user"], "ER", true,
|
||||
'id_group', $id_group, '', '', -1, true, false, false, '', false, false, false, false, 'id_group', $strict_user);
|
||||
|
||||
$types = get_event_types ();
|
||||
// Expand standard array to add not_normal (not exist in the array, used only for searches)
|
||||
|
@ -237,11 +236,14 @@ $table->data[9][1] = html_print_input_text ('event_view_hr', $event_view_hr, '',
|
|||
|
||||
$table->data[10][0] = '<b>' . __('User ack.') . '</b>'. ' ' . ui_print_help_tip (__('Choose between the users who have validated an event. '), true);
|
||||
|
||||
# Fix : Only admin user can see all users
|
||||
$users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all(0));
|
||||
|
||||
$table->data[10][1] = html_print_select ($users, "id_user_ack", $id_user_ack, '', __('Any'), 0, true);
|
||||
if ($strict_user) {
|
||||
$users = array($config['id_user']=>$config['id_user']);
|
||||
} else {
|
||||
$users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all(0));
|
||||
}
|
||||
|
||||
$table->data[10][1] = html_print_select($users, "id_user_ack", $id_user_ack, '', __('Any'), 0, true);
|
||||
|
||||
$repeated_sel[0] = __("All events");
|
||||
$repeated_sel[1] = __("Group events");
|
||||
$table->data[11][0] = '<b>' . __('Repeated') . '</b>';
|
||||
|
@ -280,6 +282,7 @@ foreach ($tags as $id_tag => $tag) {
|
|||
$tag_without_temp[$id_tag] = $tag;
|
||||
}
|
||||
}
|
||||
|
||||
$add_with_tag_disabled = empty($tags_select_with);
|
||||
$remove_with_tag_disabled = empty($tag_with_temp);
|
||||
$add_without_tag_disabled = empty($tags_select_without);
|
||||
|
@ -538,4 +541,4 @@ function replace_hidden_tags(what_button) {
|
|||
$(id_hidden).val(Base64.encode(jQuery.toJSON(value_store)));
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -101,7 +101,7 @@ if(defined("METACONSOLE"))
|
|||
$table->width = '100%';
|
||||
$table->head = array ();
|
||||
$table->head[0] = __('Name');
|
||||
$table->head[1] = __('Filter group');
|
||||
$table->head[1] = __('Group');
|
||||
$table->head[2] = __('Event type');
|
||||
$table->head[3] = __('Event status');
|
||||
$table->head[4] = __('Severity');
|
||||
|
|
|
@ -38,7 +38,7 @@ $buttons['view'] = array('active' => false,
|
|||
|
||||
$buttons['filter'] = array('active' => false,
|
||||
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&section=filter&pure='.$config['pure'].'">' .
|
||||
html_print_image("images/filter_mc.png", true, array ("title" => __('Create filter'))) . '</a>');
|
||||
html_print_image("images/filter_mc.png", true, array ("title" => __('Filter list'))) . '</a>');
|
||||
|
||||
if (check_acl ($config["id_user"], 0, "PM")) {
|
||||
$buttons['responses'] = array('active' => false,
|
||||
|
|
|
@ -147,6 +147,10 @@ if (defined('METACONSOLE')) {
|
|||
agents_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
|
||||
echo '<div class="notify">';
|
||||
echo __("Edit or delete groups can cause problems with synchronization");
|
||||
echo '</div>';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ $snmp_versions['2'] = 'v. 2';
|
|||
$snmp_versions['2c'] = 'v. 2c';
|
||||
$snmp_versions['3'] = 'v. 3';
|
||||
|
||||
$table->width = '99%';
|
||||
$table->width = '100%';
|
||||
$table->data = array ();
|
||||
|
||||
|
||||
|
|
|
@ -25,251 +25,264 @@ $menu_godmode = array ();
|
|||
$menu_godmode['class'] = 'godmode';
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AW") || check_acl ($config['id_user'], 0, "AD")) {
|
||||
$menu_godmode["gagente"]["text"] = __('Manage monitoring');
|
||||
$menu_godmode["gagente"]["text"] = __('Resources');
|
||||
$menu_godmode["gagente"]["sec2"] = "godmode/agentes/modificar_agente";
|
||||
$menu_godmode["gagente"]["id"] = "god-agents";
|
||||
|
||||
$menu_godmode["gagente"]["id"] = "god-resources";
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
$sub = array ();
|
||||
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
|
||||
$sub["godmode/agentes/modificar_agente"]["subsecs"] = array(
|
||||
"godmode/agentes/configurar_agente");
|
||||
|
||||
enterprise_hook("duplicate_confi_submenu");
|
||||
|
||||
$sub["godmode/groups/group_list"]["text"] = __('Manage groups');
|
||||
/*
|
||||
$sub["godmode/agentes/planned_downtime.list"]["text"] = __('Scheduled downtime');
|
||||
*/
|
||||
|
||||
|
||||
if (check_acl ($config["id_user"], 0, "PM")) {
|
||||
$sub["godmode/agentes/fields_manager"]["text"] = __('Manage custom fields');
|
||||
$sub["godmode/agentes/fields_manager"]["text"] = __('Custom fields');
|
||||
}
|
||||
enterprise_hook('agents_submenu');
|
||||
|
||||
|
||||
$sub["godmode/modules/manage_nc_groups"]["text"] = __('Component groups');
|
||||
// Category
|
||||
$sub["godmode/category/category"]["text"] = __('Module categories');
|
||||
$sub["godmode/category/category"]["subsecs"] = "godmode/category/edit_category";
|
||||
$sub["godmode/modules/module_list"]["text"] = __('Module types');
|
||||
|
||||
if (check_acl ($config["id_user"], 0, "PM")) {
|
||||
$sub["godmode/groups/modu_group_list"]["text"] = __('Module groups');
|
||||
}
|
||||
// GIS
|
||||
if (check_acl ($config['id_user'], 0, "IW")) {
|
||||
if ($config['activate_gis']) {
|
||||
$sub["godmode/gis_maps/index"]["text"] = __('GIS Maps builder');
|
||||
$sub["godmode/gis_maps/index"]["refr"] = (int)get_parameter('refr', 60);
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['activate_netflow']) {
|
||||
//Netflow
|
||||
$sub["godmode/netflow/nf_edit"]["text"] = __('Netflow filters');
|
||||
}
|
||||
|
||||
$menu_godmode["gagente"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
$menu_godmode["gmassive"]["text"] = __('Massive operations');
|
||||
$menu_godmode["gmassive"]["sec2"] = "godmode/massive/massive_operations";
|
||||
$menu_godmode["gmassive"]["id"] = "god-massive";
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "UM")) {
|
||||
$menu_godmode["gusuarios"]["text"] = __('Profiles');
|
||||
$menu_godmode["gusuarios"]["sec2"] = "godmode/users/user_list";
|
||||
$menu_godmode["gusuarios"]["id"] = "god-users";
|
||||
|
||||
$sub = array ();
|
||||
$sub["godmode/massive/massive_operations&tab=massive_agents"]["text"] = __('Agents operations');
|
||||
$sub["godmode/massive/massive_operations&tab=massive_modules"]["text"] = __('Modules operations');
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub["godmode/massive/massive_operations&tab=massive_users"]["text"] = __('Users operations');
|
||||
}
|
||||
$sub["godmode/massive/massive_operations&tab=massive_alerts"]["text"] = __('Alerts operations');
|
||||
enterprise_hook('massivepolicies_submenu');
|
||||
enterprise_hook('massivesnmp_submenu');
|
||||
enterprise_hook('massivesatellite_submenu');
|
||||
|
||||
$menu_godmode["gmassive"]["sub"] = $sub;
|
||||
}
|
||||
$sub['godmode/users/user_list']['text'] = __('Users management');
|
||||
$sub['godmode/users/profile_list']['text'] = __('Profile management');
|
||||
$sub["godmode/groups/group_list"]["text"] = __('Manage agents groups');
|
||||
// Tag
|
||||
$sub["godmode/tag/tag"]["text"] = __('Module tags');
|
||||
$sub["godmode/tag/tag"]["subsecs"] = "godmode/tag/edit_tag";
|
||||
|
||||
/*
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
enterprise_hook ('services_godmenu');
|
||||
enterprise_hook ('enterprise_acl_submenu');
|
||||
$menu_godmode["gusuarios"]["sub"] = $sub;
|
||||
}
|
||||
*/
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$menu_godmode["gmodules"]["text"] = __('Manage modules');
|
||||
$menu_godmode["gmodules"]["text"] = __('Configuration');
|
||||
$menu_godmode["gmodules"]["sec2"] = "godmode/modules/manage_network_templates";
|
||||
$menu_godmode["gmodules"]["id"] = "god-modules";
|
||||
|
||||
$menu_godmode["gmodules"]["id"] = "god-configuration";
|
||||
|
||||
$sub = array ();
|
||||
$sub["godmode/modules/manage_nc_groups"]["text"] = __('Component groups');
|
||||
|
||||
$sub["godmode/modules/manage_network_components"]["text"] = __('Network components');
|
||||
enterprise_hook ('components_submenu');
|
||||
$sub["godmode/modules/manage_network_templates"]["text"] = __('Module templates');
|
||||
enterprise_hook ('inventory_submenu');
|
||||
|
||||
// Tag
|
||||
$sub["godmode/tag/tag"]["text"] = __('Manage tags');
|
||||
$sub["godmode/tag/tag"]["subsecs"] = "godmode/tag/edit_tag";
|
||||
|
||||
// Category
|
||||
$sub["godmode/category/category"]["text"] = __('Manage categories');
|
||||
$sub["godmode/category/category"]["subsecs"] = "godmode/category/edit_category";
|
||||
|
||||
$sub["godmode/modules/module_list"]["text"] = __('Module types');
|
||||
|
||||
if (check_acl ($config["id_user"], 0, "PM")) {
|
||||
$sub["godmode/groups/modu_group_list"]["text"] = __('Module groups');
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
enterprise_hook ('policies_menu');
|
||||
}
|
||||
|
||||
enterprise_hook('agents_submenu');
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
$sub["gmassive"]["text"] = __('Massive operations');
|
||||
$sub["gmassive"]["type"] = "direct";
|
||||
$sub["gmassive"]["subtype"] = "nolink";
|
||||
$sub2 = array ();
|
||||
$sub2["godmode/massive/massive_operations&tab=massive_agents"]["text"] = __('Agents operations');
|
||||
$sub2["godmode/massive/massive_operations&tab=massive_modules"]["text"] = __('Modules operations');
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub2["godmode/massive/massive_operations&tab=massive_users"]["text"] = __('Users operations');
|
||||
}
|
||||
$sub2["godmode/massive/massive_operations&tab=massive_alerts"]["text"] = __('Alerts operations');
|
||||
enterprise_hook('massivepolicies_submenu');
|
||||
enterprise_hook('massivesnmp_submenu');
|
||||
enterprise_hook('massivesatellite_submenu');
|
||||
|
||||
$sub["gmassive"]["sub2"] = $sub2;
|
||||
}
|
||||
|
||||
|
||||
$menu_godmode["gmodules"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "LM") || check_acl ($config['id_user'], 0, "AD")) {
|
||||
$menu_godmode["galertas"]["text"] = __('Manage alerts');
|
||||
$menu_godmode["galertas"]["text"] = __('Alerts');
|
||||
$menu_godmode["galertas"]["sec2"] = "godmode/alerts/alert_list";
|
||||
$menu_godmode["galertas"]["id"] = "god-alerts";
|
||||
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
$sub = array ();
|
||||
$sub["godmode/alerts/alert_templates"]["text"] = __('Templates');
|
||||
$sub["godmode/alerts/alert_actions"]["text"] = __('Actions');
|
||||
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub["godmode/alerts/alert_commands"]["text"] = __('Commands');
|
||||
}
|
||||
$sub["godmode/alerts/alert_special_days"]["text"] = __('Special days list');
|
||||
enterprise_hook('eventalerts_submenu');
|
||||
|
||||
$sub["godmode/snmpconsole/snmp_alert"]["text"] = __("SNMP alerts");
|
||||
|
||||
$menu_godmode["galertas"]["sub"] = $sub;
|
||||
}
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
enterprise_hook ('policies_menu');
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "UM")) {
|
||||
$menu_godmode["gusuarios"]["text"] = __('Manage users');
|
||||
$menu_godmode["gusuarios"]["sec2"] = "godmode/users/user_list";
|
||||
$menu_godmode["gusuarios"]["id"] = "god-users";
|
||||
|
||||
$sub = array ();
|
||||
$sub['godmode/users/profile_list']['text'] = __('Manage profiles');
|
||||
|
||||
$menu_godmode["gusuarios"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
// GIS
|
||||
if (check_acl ($config['id_user'], 0, "IW")) {
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$menu_godmode["godgismaps"]["text"] = __('GIS Maps builder');
|
||||
$menu_godmode["godgismaps"]["sec2"] = "godmode/gis_maps/index";
|
||||
$menu_godmode["godgismaps"]["refr"] = (int)get_parameter('refr', 60);
|
||||
$menu_godmode["godgismaps"]["id"] = "god-gismaps";
|
||||
}
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "EW")) {
|
||||
// Manage events
|
||||
$menu_godmode["geventos"]["text"] = __('Manage events');
|
||||
$menu_godmode["geventos"]["text"] = __('Events');
|
||||
$menu_godmode["geventos"]["sec2"] = "godmode/events/events&section=filter";
|
||||
$menu_godmode["geventos"]["id"] = "god-events";
|
||||
|
||||
|
||||
// Custom event fields
|
||||
$sub = array ();
|
||||
$sub["godmode/events/events&section=filter"]["text"] = __('Event filters');
|
||||
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub["godmode/events/events&section=fields"]["text"] = __('Custom events');
|
||||
$sub["godmode/events/events&section=responses"]["text"] = __('Event responses');
|
||||
}
|
||||
|
||||
|
||||
$menu_godmode["geventos"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
|
||||
// Servers
|
||||
$menu_godmode["gservers"]["text"] = __('Manage servers');
|
||||
$menu_godmode["gservers"]["text"] = __('Servers');
|
||||
$menu_godmode["gservers"]["sec2"] = "godmode/servers/modificar_server";
|
||||
$menu_godmode["gservers"]["id"] = "god-servers";
|
||||
|
||||
|
||||
$sub = array ();
|
||||
$sub["godmode/servers/manage_recontask"]["text"] = __('Manage recontask');
|
||||
|
||||
$sub["godmode/servers/modificar_server"]["text"] = __('Manage servers');
|
||||
$sub["godmode/servers/manage_recontask"]["text"] = __('Recon task');
|
||||
|
||||
//This subtabs are only for Pandora Admin
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sub["godmode/servers/plugin"]["text"] = __('Manage plugins');
|
||||
|
||||
$sub["godmode/servers/recon_script"]["text"] = __('Manage recon script');
|
||||
|
||||
$sub["godmode/servers/plugin"]["text"] = __('Plugins');
|
||||
|
||||
$sub["godmode/servers/recon_script"]["text"] = __('Recon script');
|
||||
|
||||
enterprise_hook('export_target_submenu');
|
||||
}
|
||||
|
||||
|
||||
$menu_godmode["gservers"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "LW")) {
|
||||
enterprise_hook ('snmpconsole_menu');
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
// Audit
|
||||
$menu_godmode["glog"]["text"] = __('System audit log');
|
||||
$menu_godmode["glog"]["sec2"] = "godmode/admin_access_logs";
|
||||
$menu_godmode["glog"]["id"] = "god-audit";
|
||||
|
||||
// Setup
|
||||
$menu_godmode["gsetup"]["text"] = __('Setup');
|
||||
$menu_godmode["gsetup"]["sec2"] = "godmode/setup/setup§ion=general";
|
||||
$menu_godmode["gsetup"]["id"] = "god-setup";
|
||||
|
||||
|
||||
$sub = array ();
|
||||
|
||||
// Options Setup
|
||||
$sub["general"]["text"] = __('General Setup');
|
||||
$sub2 = array ();
|
||||
|
||||
$sub["godmode/setup/file_manager"]["text"] = __('File manager');
|
||||
|
||||
$sub2["godmode/setup/setup&section=general"]["text"] = __('General Setup');
|
||||
$sub2["godmode/setup/setup&section=general"]["refr"] = 0;
|
||||
|
||||
enterprise_hook ('password_submenu');
|
||||
enterprise_hook ('enterprise_submenu');
|
||||
enterprise_hook ('historydb_submenu');
|
||||
enterprise_hook ('log_collector_submenu');
|
||||
|
||||
$sub2["godmode/setup/setup&section=auth"]["text"] = __('Authentication');
|
||||
$sub2["godmode/setup/setup&section=auth"]["refr"] = 0;
|
||||
|
||||
$sub2["godmode/setup/setup&section=perf"]["text"] = __('Performance');
|
||||
$sub2["godmode/setup/setup&section=perf"]["refr"] = 0;
|
||||
|
||||
$sub2["godmode/setup/setup&section=vis"]["text"] = __('Visual styles');
|
||||
$sub2["godmode/setup/setup&section=vis"]["refr"] = 0;
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
if ($config['activate_netflow']) {
|
||||
$sub2["godmode/setup/setup&section=net"]["text"] = __('Netflow');
|
||||
$sub2["godmode/setup/setup&section=net"]["refr"] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($config['activate_gis'])
|
||||
$sub["godmode/setup/gis"]["text"] = __('Map conections GIS');
|
||||
$sub["godmode/setup/links"]["text"] = __('Links');
|
||||
$sub["godmode/setup/news"]["text"] = __('Site news');
|
||||
$sub2["godmode/setup/gis"]["text"] = __('Map conections GIS');
|
||||
|
||||
$sub["general"]["sub2"] = $sub2;
|
||||
$sub["godmode/setup/os"]["text"] = __('Edit OS');
|
||||
$sub["godmode/setup/license"]["text"] = __('License');
|
||||
|
||||
$sub["godmode/update_manager/update_manager"]["text"] = __('Update manager');
|
||||
|
||||
enterprise_hook ('enterprise_acl_submenu');
|
||||
|
||||
enterprise_hook ('skins_submenu');
|
||||
$sub["extras/pandora_diag"]["text"] = __('Diagnostic info');
|
||||
|
||||
|
||||
$menu_godmode["gsetup"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "AW")) {
|
||||
if ($config['activate_netflow']) {
|
||||
//Netflow
|
||||
$menu_godmode["netf"]["text"] = __('Netflow filters');
|
||||
$menu_godmode["netf"]["sec2"] = "godmode/netflow/nf_edit";
|
||||
$menu_godmode["netf"]["id"] = "god-netflow";
|
||||
}
|
||||
}
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$menu_godmode["gextensions"]["text"] = __('Admin tools');
|
||||
$menu_godmode["gextensions"]["sec2"] = "godmode/extensions";
|
||||
$menu_godmode["gextensions"]["id"] = "god-extensions";
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "DM")) {
|
||||
$menu_godmode["gdbman"]["text"] = __('DB maintenance');
|
||||
$menu_godmode["gdbman"]["sec2"] = "godmode/db/db_main";
|
||||
$menu_godmode["gdbman"]["id"] = "god-dbmaint";
|
||||
|
||||
$sub = array ();
|
||||
$sub["godmode/db/db_info"]["text"] = __('DB information');
|
||||
$sub["godmode/db/db_purge"]["text"] = __('Database purge');
|
||||
$sub["godmode/db/db_refine"]["text"] = __('Database debug');
|
||||
$sub["godmode/db/db_audit"]["text"] = __('Database audit');
|
||||
$sub["godmode/db/db_event"]["text"] = __('Database event');
|
||||
|
||||
$menu_godmode["gdbman"]["sub"] = $sub;
|
||||
// Audit //meter en extensiones
|
||||
$sub["godmode/admin_access_logs"]["text"] = __('System audit log');
|
||||
$sub["godmode/setup/links"]["text"] = __('Links');
|
||||
$sub["godmode/update_manager/update_manager"]["text"] = __('Update manager');
|
||||
$sub["gextmaneger"]["sub2"] = $sub2;
|
||||
if (check_acl ($config['id_user'], 0, "DM")) {
|
||||
$sub["gdbman"]["text"] = __('DB maintenance');
|
||||
$sub["gdbman"]["type"] = "direct";
|
||||
$sub["gdbman"]["subtype"] = "nolink";
|
||||
$sub2 = array ();
|
||||
$sub2["godmode/db/db_info"]["text"] = __('DB information');
|
||||
$sub2["godmode/db/db_purge"]["text"] = __('Database purge');
|
||||
$sub2["godmode/db/db_refine"]["text"] = __('Database debug');
|
||||
$sub2["godmode/db/db_audit"]["text"] = __('Database audit');
|
||||
$sub2["godmode/db/db_event"]["text"] = __('Database event');
|
||||
|
||||
$sub["gdbman"]["sub2"] = $sub2;
|
||||
}
|
||||
$sub["extras/pandora_diag"]["text"] = __('Diagnostic info');
|
||||
$sub["godmode/setup/news"]["text"] = __('Site news');
|
||||
$sub["godmode/setup/file_manager"]["text"] = __('File manager');
|
||||
$menu_godmode["gextensions"]["sub"] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
|
||||
if (is_array ($config['extensions'])) {
|
||||
$menu_godmode["gextensions"]["text"] = __('Extensions');
|
||||
$menu_godmode["gextensions"]["sec2"] = "godmode/extensions";
|
||||
$menu_godmode["gextensions"]["id"] = "god-extensions";
|
||||
|
||||
$sub = array ();
|
||||
$sub["gextmaneger"]["text"] = __('Extension manager');
|
||||
$sub["gextmaneger"]["type"] = "direct";
|
||||
$sub["gextmaneger"]["subtype"] = "nolink";
|
||||
$sub2 = array ();
|
||||
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
//If no godmode_menu is a operation extension
|
||||
if ($extension['godmode_menu'] == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$extmenu = $extension['godmode_menu'];
|
||||
|
||||
if ($extmenu["name"] == 'DB interface' && !check_acl ($config['id_user'], 0, "DM")) {
|
||||
|
||||
if ($extmenu["name"] == 'DB interface' && !check_acl ($config['id_user'], 0, "DM")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
//Check the ACL for this user
|
||||
if (! check_acl ($config['id_user'], 0, $extmenu['acl'])) {
|
||||
continue;
|
||||
|
@ -277,37 +290,51 @@ if (check_acl ($config['id_user'], 0, "PM")) {
|
|||
|
||||
//Check if was displayed inside other menu
|
||||
if ($extension['godmode_menu']["fatherId"] == '') {
|
||||
$sub[$extmenu["sec2"]]["text"] = $extmenu["name"];
|
||||
$sub[$extmenu["sec2"]]["refr"] = 0;
|
||||
$sub2[$extmenu["sec2"]]["text"] = __($extmenu["name"]);
|
||||
$sub2[$extmenu["sec2"]]["refr"] = 0;
|
||||
}
|
||||
else {
|
||||
if (array_key_exists('fatherId',$extmenu)) {
|
||||
if (strlen($extmenu['fatherId']) > 0) {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
if ($extmenu["name"] != 'DB interface') {
|
||||
if (!empty($config['refr'])) {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["refr"] = $config['refr'];
|
||||
if (array_key_exists('subfatherId',$extmenu)) {
|
||||
if (strlen($extmenu['subfatherId']) > 0) {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["refr"] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["sec"] = 'extensions';
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["extension"] = true;
|
||||
$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'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions';
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
|
||||
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
}
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["icon"] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions';
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
|
||||
|
||||
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
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'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["sec"] = 'gextensions';
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["extension"] = true;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]["enterprise"] = $extension['enterprise'];
|
||||
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$menu_godmode["gextensions"]["sub"] = $sub;
|
||||
$sub["gextmaneger"]["sub2"] = $sub2;
|
||||
$submenu = array_merge($menu_godmode["gextensions"]["sub"],$sub);
|
||||
$menu_godmode["gextensions"]["sub"] = $submenu;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$config['pure']) {
|
||||
menu_print_menu ($menu_godmode);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ function push_table_row ($row, $id = false) {
|
|||
|
||||
|
||||
$table->id = 'network_component';
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox';
|
||||
$table->style = array ();
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
|
|
|
@ -17,6 +17,18 @@ global $config;
|
|||
|
||||
require_once ($config['homedir'] . '/include/functions_visual_map.php');
|
||||
|
||||
// ACL for the general permission
|
||||
$vconsoles_read = check_acl ($config['id_user'], 0, "VR");
|
||||
$vconsoles_write = check_acl ($config['id_user'], 0, "VW");
|
||||
$vconsoles_manage = check_acl ($config['id_user'], 0, "VM");
|
||||
|
||||
if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access map builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$pure = (int)get_parameter('pure', 0);
|
||||
$hack_metaconsole = '';
|
||||
if (defined('METACONSOLE'))
|
||||
|
@ -31,113 +43,142 @@ $copy_layout = (bool) get_parameter ('copy_layout');
|
|||
$delete_layout = (bool) get_parameter ('delete_layout');
|
||||
$refr = (int) get_parameter('refr');
|
||||
|
||||
if ($delete_layout) {
|
||||
db_process_sql_delete ('tlayout_data', array ('id_layout' => $id_layout));
|
||||
$result = db_process_sql_delete ('tlayout', array ('id' => $id_layout));
|
||||
if ($result) {
|
||||
db_pandora_audit( "Visual console builder", "Delete visual console #$id_layout");
|
||||
ui_print_success_message(__('Successfully deleted'));
|
||||
db_clean_cache();
|
||||
if ($delete_layout || $copy_layout) {
|
||||
// Visual console required
|
||||
if (empty($id_layout)) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access map builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Visual console builder", "Fail try to delete visual console #$id_layout");
|
||||
ui_print_error_message(__('Not deleted. Error deleting data'));
|
||||
|
||||
$group_id = db_get_value("id_group", "tlayout", "id", $id_layout);
|
||||
if ($group_id === false) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access map builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
$id_layout = 0;
|
||||
}
|
||||
|
||||
// ACL for the visual console
|
||||
// $vconsole_read = check_acl ($config['id_user'], $group_id, "VR");
|
||||
$vconsole_write = check_acl ($config['id_user'], $group_id, "VW");
|
||||
$vconsole_manage = check_acl ($config['id_user'], $group_id, "VM");
|
||||
|
||||
if ($copy_layout) {
|
||||
// Number of inserts
|
||||
$ninsert = (int) 0;
|
||||
if (!$vconsole_write && !$vconsole_manage) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access map builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Return from DB the source layout
|
||||
$layout_src = db_get_all_rows_filter ("tlayout","id = " . $id_layout);
|
||||
|
||||
// Name of dst
|
||||
$name_dst = get_parameter ("name_dst", $layout_src[0]['name'] . " copy");
|
||||
|
||||
// Create the new Console
|
||||
$idGroup = $layout_src[0]['id_group'];
|
||||
$background = $layout_src[0]['background'];
|
||||
$height = $layout_src[0]['height'];
|
||||
$width = $layout_src[0]['width'];
|
||||
$visualConsoleName = $name_dst;
|
||||
|
||||
$values = array('name' => $visualConsoleName, 'id_group' => $idGroup, 'background' => $background, 'height' => $height, 'width' => $width);
|
||||
$result = db_process_sql_insert('tlayout', $values);
|
||||
|
||||
$idNewVisualConsole = $result;
|
||||
|
||||
if ($result) {
|
||||
$ninsert = 1;
|
||||
if ($delete_layout) {
|
||||
db_process_sql_delete ('tlayout_data', array ('id_layout' => $id_layout));
|
||||
$result = db_process_sql_delete ('tlayout', array ('id' => $id_layout));
|
||||
if ($result) {
|
||||
db_pandora_audit( "Visual console builder", "Delete visual console #$id_layout");
|
||||
ui_print_success_message(__('Successfully deleted'));
|
||||
db_clean_cache();
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Visual console builder", "Fail try to delete visual console #$id_layout");
|
||||
ui_print_error_message(__('Not deleted. Error deleting data'));
|
||||
}
|
||||
$id_layout = 0;
|
||||
}
|
||||
|
||||
if ($copy_layout) {
|
||||
// Number of inserts
|
||||
$ninsert = (int) 0;
|
||||
|
||||
// Return from DB the items of the source layout
|
||||
$data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_layout);
|
||||
// Return from DB the source layout
|
||||
$layout_src = db_get_all_rows_filter ("tlayout","id = " . $id_layout);
|
||||
|
||||
if (!empty($data_layout_src)) {
|
||||
// Name of dst
|
||||
$name_dst = get_parameter ("name_dst", $layout_src[0]['name'] . " copy");
|
||||
|
||||
// Create the new Console
|
||||
$idGroup = $layout_src[0]['id_group'];
|
||||
$background = $layout_src[0]['background'];
|
||||
$height = $layout_src[0]['height'];
|
||||
$width = $layout_src[0]['width'];
|
||||
$visualConsoleName = $name_dst;
|
||||
|
||||
$values = array('name' => $visualConsoleName, 'id_group' => $idGroup, 'background' => $background, 'height' => $height, 'width' => $width);
|
||||
$result = db_process_sql_insert('tlayout', $values);
|
||||
|
||||
$idNewVisualConsole = $result;
|
||||
|
||||
if ($result) {
|
||||
$ninsert = 1;
|
||||
|
||||
//By default the id parent 0 is always 0.
|
||||
$id_relations = array(0 => 0);
|
||||
// Return from DB the items of the source layout
|
||||
$data_layout_src = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $id_layout);
|
||||
|
||||
for ($a=0; $a < count($data_layout_src); $a++) {
|
||||
if (!empty($data_layout_src)) {
|
||||
|
||||
// Changing the source id by the new visual console id
|
||||
$data_layout_src[$a]['id_layout'] = $idNewVisualConsole;
|
||||
//By default the id parent 0 is always 0.
|
||||
$id_relations = array(0 => 0);
|
||||
|
||||
$old_id = $data_layout_src[$a]['id'];
|
||||
|
||||
// Unsetting the source's id
|
||||
unset($data_layout_src[$a]['id']);
|
||||
|
||||
// Configure the cloned Console
|
||||
$result = db_process_sql_insert('tlayout_data', $data_layout_src[$a]);
|
||||
|
||||
$id_relations[$old_id] = 0;
|
||||
|
||||
if ($result !== false) {
|
||||
$id_relations[$old_id] = $result;
|
||||
}
|
||||
|
||||
if ($result)
|
||||
$ninsert++;
|
||||
}// for each item of console
|
||||
|
||||
$inserts = count($data_layout_src) + 1;
|
||||
|
||||
// If the number of inserts is correct, the copy is completed
|
||||
if ($ninsert == $inserts) {
|
||||
|
||||
//Update the ids of parents
|
||||
$items = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $idNewVisualConsole);
|
||||
|
||||
foreach ($items as $item) {
|
||||
$new_parent = $id_relations[$item['parent_item']];
|
||||
for ($a=0; $a < count($data_layout_src); $a++) {
|
||||
|
||||
db_process_sql_update('tlayout_data',
|
||||
array('parent_item' => $new_parent), array('id' => $item['id']));
|
||||
// Changing the source id by the new visual console id
|
||||
$data_layout_src[$a]['id_layout'] = $idNewVisualConsole;
|
||||
|
||||
$old_id = $data_layout_src[$a]['id'];
|
||||
|
||||
// Unsetting the source's id
|
||||
unset($data_layout_src[$a]['id']);
|
||||
|
||||
// Configure the cloned Console
|
||||
$result = db_process_sql_insert('tlayout_data', $data_layout_src[$a]);
|
||||
|
||||
$id_relations[$old_id] = 0;
|
||||
|
||||
if ($result !== false) {
|
||||
$id_relations[$old_id] = $result;
|
||||
}
|
||||
|
||||
if ($result)
|
||||
$ninsert++;
|
||||
}// for each item of console
|
||||
|
||||
$inserts = count($data_layout_src) + 1;
|
||||
|
||||
// If the number of inserts is correct, the copy is completed
|
||||
if ($ninsert == $inserts) {
|
||||
|
||||
//Update the ids of parents
|
||||
$items = db_get_all_rows_filter ("tlayout_data", "id_layout = " . $idNewVisualConsole);
|
||||
|
||||
foreach ($items as $item) {
|
||||
$new_parent = $id_relations[$item['parent_item']];
|
||||
|
||||
db_process_sql_update('tlayout_data',
|
||||
array('parent_item' => $new_parent), array('id' => $item['id']));
|
||||
}
|
||||
|
||||
|
||||
ui_print_success_message(__('Successfully copied'));
|
||||
db_clean_cache();
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
ui_print_error_message(__('Not copied. Error copying data'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the array is empty the copy is completed
|
||||
ui_print_success_message(__('Successfully copied'));
|
||||
db_clean_cache();
|
||||
}
|
||||
else {
|
||||
ui_print_error_message(__('Not copied. Error copying data'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the array is empty the copy is completed
|
||||
ui_print_success_message(__('Successfully copied'));
|
||||
db_clean_cache();
|
||||
ui_print_error_message(__('Not copied. Error copying data'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ui_print_error_message(__('Not copied. Error copying data'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->data = array ();
|
||||
$table->head = array ();
|
||||
$table->head[0] = __('Map name');
|
||||
|
@ -146,31 +187,34 @@ $table->head[2] = __('Items');
|
|||
|
||||
// Fix: IW was the old ACL for report editing, now is RW
|
||||
//Only for RW flag
|
||||
if (check_acl ($config['id_user'], 0, "RW")) {
|
||||
if ($vconsoles_write || $vconsoles_manage) {
|
||||
$table->head[3] = __('Copy');
|
||||
$table->head[4] = __('Delete');
|
||||
}
|
||||
|
||||
$table->align = array ();
|
||||
$table->align[0] = 'left';
|
||||
$table->align[1] = 'center';
|
||||
$table->align[2] = 'center';
|
||||
$table->align[3] = 'center';
|
||||
$table->align[4] = 'center';
|
||||
$table->align[1] = 'left';
|
||||
$table->align[2] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
$table->align[4] = 'left';
|
||||
|
||||
// Only display maps of "All" group if user is administrator
|
||||
// or has "RR" privileges, otherwise show only maps of user group
|
||||
// or has "VR" privileges, otherwise show only maps of user group
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "RR"))
|
||||
if ($own_info['is_admin'] || $vconsoles_read)
|
||||
$maps = visual_map_get_user_layouts ();
|
||||
else
|
||||
$maps = visual_map_get_user_layouts ($config['id_user'], false, false, false);
|
||||
|
||||
if (!$maps) {
|
||||
echo '<div class="nf">'.__('No maps defined').'</div>';
|
||||
ui_print_info_message ( array('no_close'=>true, 'message'=> __('No maps defined') ) );
|
||||
}
|
||||
else {
|
||||
foreach ($maps as $map) {
|
||||
// ACL for the visual console permission
|
||||
$vconsole_write = check_acl ($config['id_user'], $map['id_group'], "VW");
|
||||
$vconsole_manage = check_acl ($config['id_user'], $map['id_group'], "VM");
|
||||
|
||||
$data = array ();
|
||||
|
||||
|
@ -187,7 +231,7 @@ else {
|
|||
$data[2] = db_get_sql ("SELECT COUNT(*) FROM tlayout_data WHERE id_layout = ".$map['id']);
|
||||
|
||||
// Fix: IW was the old ACL for report editing, now is RW
|
||||
if (check_acl ($config['id_user'], 0, "RW")) {
|
||||
if ($vconsole_write || $vconsole_manage) {
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
$data[3] = '<a class="copy_visualmap" href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&copy_layout=1">'.html_print_image ("images/copy.png", true).'</a>';
|
||||
|
@ -212,13 +256,11 @@ else {
|
|||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
}
|
||||
|
||||
// Fix: IW was the old ACL to check for report editing, now is RW
|
||||
//Only for RW flag
|
||||
if (check_acl ($config['id_user'], 0, "RW")) {
|
||||
if ($vconsoles_write || $vconsoles_manage) {
|
||||
if (!defined('METACONSOLE'))
|
||||
echo '<form action="index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder" method="post">';
|
||||
else {
|
||||
echo '<form action="index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '" method="post">';
|
||||
echo '<form action="index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure=' . $pure . '" method="post">';
|
||||
}
|
||||
html_print_input_hidden ('edit_layout', 1);
|
||||
html_print_submit_button (__('Create'), '', false, 'class="sub next"');
|
||||
|
|
|
@ -369,7 +369,10 @@ switch ($action) {
|
|||
$search_name = "%$search%' OR description LIKE '%$search%";
|
||||
}
|
||||
|
||||
$table_aux->width = '99%';
|
||||
$table_aux->width = '100%';
|
||||
$table_aux->class = 'databox filters';
|
||||
$table_aux->cellpadding = 0;
|
||||
$table_aux->cellspacing = 0;
|
||||
if(defined('METACONSOLE')){
|
||||
$table_aux->class = 'databox_filters';
|
||||
$table_aux->width = '96%';
|
||||
|
@ -462,10 +465,15 @@ switch ($action) {
|
|||
$table->width = '0px';
|
||||
if (sizeof ($reports)) {
|
||||
$table->id = 'report_list';
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
if(defined('METACONSOLE')){
|
||||
$table->class = 'databox';
|
||||
$table->width = '100%';
|
||||
}
|
||||
|
||||
$table->head = array ();
|
||||
$table->align = array ();
|
||||
$table->align[2] = 'center';
|
||||
|
@ -476,6 +484,13 @@ switch ($action) {
|
|||
$table->head[1] = __('Description');
|
||||
$table->head[2] = __('HTML');
|
||||
$table->head[3] = __('XML');
|
||||
$table->size[0] = '20%';
|
||||
$table->size[1] = '30%';
|
||||
$table->size[2] = '2%';
|
||||
$table->size[3] = '2%';
|
||||
$table->size[4] = '2%';
|
||||
$table->size[5] = '2%';
|
||||
$table->size[6] = '2%';
|
||||
|
||||
$next = 4;
|
||||
//Calculate dinamically the number of the column
|
||||
|
@ -487,21 +502,22 @@ switch ($action) {
|
|||
if (check_acl ($config['id_user'], 0, "RM")) {
|
||||
|
||||
$table->head[$next] = __('Private');
|
||||
$table->size[$next] = '40px';
|
||||
$table->size[$next] = '2%';
|
||||
if(defined('METACONSOLE'))
|
||||
$table->align[$next] = '';
|
||||
else
|
||||
$table->align[$next] = 'center';
|
||||
$next++;
|
||||
$table->head[$next] = __('Group');
|
||||
$table->align[$next] = 'center';
|
||||
$table->size[$next] = '15%';
|
||||
|
||||
$next++;
|
||||
if(!defined('METACONSOLE'))
|
||||
$table->head[$next] = '<span title="Operations">' .
|
||||
__('Op.') . '</span>';
|
||||
|
||||
$table->size = array ();
|
||||
$table->size[$next] = '80px';
|
||||
//$table->size = array ();
|
||||
$table->size[$next] = '5%';
|
||||
$table->style[$next] = 'text-align:center;';
|
||||
|
||||
}
|
||||
|
@ -639,15 +655,14 @@ switch ($action) {
|
|||
html_print_table ($table);
|
||||
}
|
||||
else{
|
||||
echo "<br />";
|
||||
echo "<div class='nf'>".__('No data found.')."</div>";
|
||||
ui_print_info_message ( array ( 'no_close' => true, 'message' => __('No data found.') ) );
|
||||
}
|
||||
if (check_acl ($config['id_user'], 0, "RW")) {
|
||||
echo '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=new&pure='.$pure.'">';
|
||||
if (defined("METACONSOLE"))
|
||||
echo '<div class="action-buttons" style="width: 100%; ">';
|
||||
else
|
||||
echo '<div class="action-buttons" style="width: 98%; margin-top: 5px;">';
|
||||
echo '<div class="action-buttons" style="width: 100%;">';
|
||||
html_print_submit_button (__('Create report'), 'create', false, 'class="sub next"');
|
||||
echo "</div>";
|
||||
echo "</form>";
|
||||
|
|
|
@ -17,7 +17,26 @@ global $config;
|
|||
|
||||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "RW")) {
|
||||
if (empty($idVisualConsole)) {
|
||||
// ACL for the a new visual console
|
||||
// if (!isset($vconsole_read))
|
||||
// $vconsole_read = check_acl ($config['id_user'], 0, "VR");
|
||||
if (!isset($vconsole_write))
|
||||
$vconsole_write = check_acl ($config['id_user'], 0, "VW");
|
||||
if (!isset($vconsole_manage))
|
||||
$vconsole_manage = check_acl ($config['id_user'], 0, "VM");
|
||||
}
|
||||
else {
|
||||
// ACL for the existing visual console
|
||||
// if (!isset($vconsole_read))
|
||||
// $vconsole_read = check_acl ($config['id_user'], $idGroup, "VR");
|
||||
if (!isset($vconsole_write))
|
||||
$vconsole_write = check_acl ($config['id_user'], $idGroup, "VW");
|
||||
if (!isset($vconsole_manage))
|
||||
$vconsole_manage = check_acl ($config['id_user'], $idGroup, "VM");
|
||||
}
|
||||
|
||||
if (!$vconsole_write && !$vconsole_manage) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
|
@ -65,7 +84,7 @@ switch ($action) {
|
|||
break;
|
||||
}
|
||||
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
|
@ -85,7 +104,7 @@ $groups = users_get_groups ($config['id_user'], 'RW');
|
|||
$own_info = get_user_info($config['id_user']);
|
||||
// Only display group "All" if user is administrator
|
||||
// or has "RW" privileges
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "RW"))
|
||||
if ($own_info['is_admin'] || $vconsole_write || $vconsole_manage)
|
||||
$display_all_group = true;
|
||||
else
|
||||
$display_all_group = false;
|
||||
|
|
|
@ -1080,7 +1080,7 @@ function cleanFields(item) {
|
|||
tinymce.get('text-label').setContent("(_VALUE_)");
|
||||
}
|
||||
|
||||
fill_parent_select();
|
||||
//fill_parent_select();
|
||||
|
||||
var anyText = $("#any_text").html(); //Trick for catch the translate text.
|
||||
$("#module")
|
||||
|
|
|
@ -17,7 +17,23 @@ global $config;
|
|||
// Login check
|
||||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "RW")) {
|
||||
// Visual console required
|
||||
if (empty($visualConsole)) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// ACL for the existing visual console
|
||||
// if (!isset($vconsole_read))
|
||||
// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR");
|
||||
if (!isset($vconsole_write))
|
||||
$vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW");
|
||||
if (!isset($vconsole_manage))
|
||||
$vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM");
|
||||
|
||||
if (!$vconsole_write && !$vconsole_manage) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
|
|
|
@ -17,7 +17,23 @@ global $config;
|
|||
|
||||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "RW")) {
|
||||
// Visual console required
|
||||
if (empty($visualConsole)) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// ACL for the existing visual console
|
||||
// if (!isset($vconsole_read))
|
||||
// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR");
|
||||
if (!isset($vconsole_write))
|
||||
$vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW");
|
||||
if (!isset($vconsole_manage))
|
||||
$vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM");
|
||||
|
||||
if (!$vconsole_write && !$vconsole_manage) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
|
@ -198,6 +214,7 @@ foreach ($layoutDatas as $layoutData) {
|
|||
case STATIC_GRAPH:
|
||||
case ICON:
|
||||
case GROUP_ITEM:
|
||||
case SERVICE:
|
||||
$table->data[$i + 1][1] =
|
||||
html_print_select ($images_list,
|
||||
'image_' . $idLayoutData, $layoutData['image'], '',
|
||||
|
@ -324,11 +341,9 @@ foreach ($layoutDatas as $layoutData) {
|
|||
$params['javascript_ajax_page'] = '../../ajax.php';
|
||||
$params['disabled_javascript_on_blur_function'] = true;
|
||||
|
||||
$params['print_input_server'] = true;
|
||||
$params['input_server_id'] =
|
||||
$params['input_server_name'] = 'id_server_name_' . $idLayoutData;
|
||||
$params['input_server_value'] =
|
||||
db_get_value('server_name', 'tmetaconsole_setup', 'id', $layoutData['id_metaconsole']);
|
||||
$params['print_input_id_server'] = true;
|
||||
$params['input_id_server_id'] = $params['input_id_server_name'] = 'id_server_id_' . $idLayoutData;
|
||||
$params['input_id_server_value'] = $layoutData['id_metaconsole'];
|
||||
$params['metaconsole_enabled'] = true;
|
||||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_name'] = 'id_agent_' . $idLayoutData;
|
||||
|
|
|
@ -18,27 +18,13 @@ global $statusProcessInDB;
|
|||
|
||||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "RW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once ($config['homedir'] . '/include/functions_visual_map.php');
|
||||
require_once($config['homedir'] . "/include/functions_agents.php");
|
||||
enterprise_include_once('include/functions_visual_map.php');
|
||||
|
||||
$pure = (int)get_parameter('pure', 0);
|
||||
|
||||
if (!empty($idVisualConsole)) {
|
||||
$idVisualConsole = get_parameter('id_visual_console', $idVisualConsole);
|
||||
}
|
||||
else {
|
||||
$idVisualConsole = get_parameter('id_visual_console', 0);
|
||||
}
|
||||
|
||||
$id_layout = 0;
|
||||
// Retrieve the visual console id
|
||||
set_unless_defined ($idVisualConsole, 0); // Set default
|
||||
$idVisualConsole = get_parameter('id_visual_console', $idVisualConsole);
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
$action_name_parameter = 'action';
|
||||
|
@ -53,8 +39,57 @@ $action = get_parameterBetweenListValues($action_name_parameter,
|
|||
|
||||
$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'wizard_services', 'editor'), 'data');
|
||||
|
||||
// Visual console creation tab and actions
|
||||
if (empty($idVisualConsole)) {
|
||||
$visualConsole = null;
|
||||
|
||||
// General ACL
|
||||
//$vconsole_read = check_acl ($config['id_user'], 0, "VR");
|
||||
$vconsole_write = check_acl ($config['id_user'], 0, "VW");
|
||||
$vconsole_manage = check_acl ($config['id_user'], 0, "VM");
|
||||
}
|
||||
// The visual console exists
|
||||
else if ($activeTab != 'data' || ($activeTab == 'data' && $action != 'new')) {
|
||||
|
||||
// Load the visual console data
|
||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||
|
||||
// The visual console should exist.
|
||||
if (empty($visualConsole)) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
}
|
||||
|
||||
// The default group id is 0
|
||||
set_unless_defined ($visualConsole['id_group'], 0);
|
||||
|
||||
// ACL for the existing visual console
|
||||
//$vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR");
|
||||
$vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW");
|
||||
$vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM");
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
}
|
||||
|
||||
// This section is only to manage the visual console
|
||||
if (!$vconsole_write && !$vconsole_manage) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$pure = (int) get_parameter ('pure', 0);
|
||||
$refr = (int) get_parameter ('refr', $config['vc_refr']);
|
||||
|
||||
$id_layout = 0;
|
||||
|
||||
|
||||
//Save/Update data in DB
|
||||
global $statusProcessInDB;
|
||||
|
@ -71,16 +106,30 @@ switch ($activeTab) {
|
|||
|
||||
case 'update':
|
||||
case 'save':
|
||||
$idGroup = get_parameter('id_group');
|
||||
$background = get_parameter('background');
|
||||
$visualConsoleName = get_parameter('name');
|
||||
$idGroup = (int) get_parameter('id_group');
|
||||
$background = (string) get_parameter('background');
|
||||
$visualConsoleName = (string) get_parameter('name');
|
||||
|
||||
$values = array('name' => $visualConsoleName,
|
||||
'id_group' => $idGroup, 'background' => $background);
|
||||
// ACL for the new visual console
|
||||
//$vconsole_read_new = check_acl ($config['id_user'], $idGroup, "VR");
|
||||
$vconsole_write_new = check_acl ($config['id_user'], $idGroup, "VW");
|
||||
$vconsole_manage_new = check_acl ($config['id_user'], $idGroup, "VM");
|
||||
|
||||
// The user should have permissions on the new group
|
||||
if (!$vconsole_write_new && !$vconsole_manage_new) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$values = array(
|
||||
'name' => $visualConsoleName,
|
||||
'id_group' => $idGroup,
|
||||
'background' => $background
|
||||
);
|
||||
|
||||
// If the background is changed the size is reseted
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
$background_now = $visualConsole['background'];
|
||||
if ($background_now != $background && $background) {
|
||||
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
|
||||
|
@ -93,10 +142,18 @@ switch ($activeTab) {
|
|||
$result = false;
|
||||
if ($values['name'] != "" && $values['background'])
|
||||
$result = db_process_sql_update('tlayout', $values, array('id' => $idVisualConsole));
|
||||
if ($result !== false && $values['background']) {
|
||||
if ($result !== false) {
|
||||
db_pandora_audit( "Visual console builder", "Update visual console #$idVisualConsole");
|
||||
$action = 'edit';
|
||||
$statusProcessInDB = array('flag' => true, 'message' => ui_print_success_message(__('Successfully update.'), '', true));
|
||||
|
||||
// Return the updated visual console
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
// Update the ACL
|
||||
//$vconsole_read = $vconsole_read_new;
|
||||
$vconsole_write = $vconsole_write_new;
|
||||
$vconsole_manage = $vconsole_manage_new;
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Visual console builder", "Fail update visual console #$idVisualConsole");
|
||||
|
@ -116,6 +173,14 @@ switch ($activeTab) {
|
|||
$action = 'edit';
|
||||
$statusProcessInDB = array('flag' => true,
|
||||
'message' => ui_print_success_message(__('Successfully created.'), '', true));
|
||||
|
||||
// Return the updated visual console
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
// Update the ACL
|
||||
//$vconsole_read = $vconsole_read_new;
|
||||
$vconsole_write = $vconsole_write_new;
|
||||
$vconsole_manage = $vconsole_manage_new;
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Visual console builder", "Fail try to create visual console");
|
||||
|
@ -125,13 +190,9 @@ switch ($activeTab) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
$visualConsoleName = $visualConsole['name'];
|
||||
$idGroup = $visualConsole['id_group'];
|
||||
$background = $visualConsole['background'];
|
||||
|
@ -147,13 +208,11 @@ switch ($activeTab) {
|
|||
json_encode(array())));
|
||||
|
||||
$delete_items = json_decode($delete_items_json, true);
|
||||
$id_visual_console = (int)get_parameter(
|
||||
'id_visual_console', 0);
|
||||
|
||||
if (!empty($delete_items)) {
|
||||
$result = (bool)db_process_sql_delete(
|
||||
'tlayout_data',
|
||||
array('id_layout' => $id_visual_console,
|
||||
array('id_layout' => $idVisualConsole,
|
||||
'id' => $delete_items));
|
||||
|
||||
}
|
||||
|
@ -187,6 +246,10 @@ switch ($activeTab) {
|
|||
'height' => $height),
|
||||
array('id' => $idVisualConsole));
|
||||
|
||||
// Return the updated visual console
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
|
||||
//Update elements in visual map
|
||||
$idsElements = db_get_all_rows_filter('tlayout_data',
|
||||
array('id_layout' => $idVisualConsole), array('id'));
|
||||
|
@ -218,11 +281,8 @@ switch ($activeTab) {
|
|||
}
|
||||
$agentName = get_parameter('agent_' . $id, '');
|
||||
if (defined('METACONSOLE')) {
|
||||
$values['id_metaconsole'] = db_get_value('id',
|
||||
'tmetaconsole_setup', 'server_name',
|
||||
get_parameter('id_server_name_' . $id, ''));
|
||||
$values['id_agent'] =
|
||||
(int)get_parameter('id_agent_' . $id, 0);
|
||||
$values['id_metaconsole'] = (int) get_parameter('id_server_id_' . $id, '');
|
||||
$values['id_agent'] = (int) get_parameter('id_agent_' . $id, 0);
|
||||
}
|
||||
else {
|
||||
$values['id_agent'] = agents_get_agent_id($agentName);
|
||||
|
@ -232,7 +292,7 @@ switch ($activeTab) {
|
|||
$values['id_layout_linked'] = get_parameter('map_linked_' . $id, 0);
|
||||
|
||||
if (enterprise_installed()) {
|
||||
enterprise_visual_map_update_action_from_list_elements($type, $values);
|
||||
enterprise_visual_map_update_action_from_list_elements($type, $values, $id);
|
||||
}
|
||||
|
||||
db_process_sql_update('tlayout_data', $values, array('id' => $id));
|
||||
|
@ -246,12 +306,10 @@ switch ($activeTab) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||
$visualConsoleName = $visualConsole['name'];
|
||||
$action = 'edit';
|
||||
break;
|
||||
case 'wizard':
|
||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||
$visualConsoleName = $visualConsole['name'];
|
||||
$background = $visualConsole['background'];
|
||||
switch ($action) {
|
||||
|
@ -430,7 +488,6 @@ switch ($activeTab) {
|
|||
}
|
||||
break;
|
||||
case 'wizard_services':
|
||||
$visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole));
|
||||
$visualConsoleName = $visualConsole['name'];
|
||||
switch ($action) {
|
||||
case 'update':
|
||||
|
@ -453,9 +510,6 @@ switch ($activeTab) {
|
|||
case 'new':
|
||||
case 'update':
|
||||
case 'edit':
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
|
||||
$visualConsoleName = $visualConsole['name'];
|
||||
$action = 'edit';
|
||||
break;
|
||||
|
|
|
@ -17,7 +17,23 @@ global $config;
|
|||
|
||||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "RW")) {
|
||||
// Visual console required
|
||||
if (empty($visualConsole)) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// ACL for the existing visual console
|
||||
// if (!isset($vconsole_read))
|
||||
// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR");
|
||||
if (!isset($vconsole_write))
|
||||
$vconsole_write = check_acl ($config['id_user'], $visualConsole['id_group'], "VW");
|
||||
if (!isset($vconsole_manage))
|
||||
$vconsole_manage = check_acl ($config['id_user'], $visualConsole['id_group'], "VM");
|
||||
|
||||
if (!$vconsole_write && !$vconsole_manage) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access report builder");
|
||||
require ("general/noaccess.php");
|
||||
|
@ -31,7 +47,8 @@ $table->id = 'wizard_table';
|
|||
$table->head = array ();
|
||||
if (!defined('METACONSOLE')) {
|
||||
$metaconsole_hack = '';
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
}
|
||||
else {
|
||||
$metaconsole_hack = '../../';
|
||||
|
@ -43,21 +60,17 @@ else {
|
|||
}
|
||||
|
||||
$table->style = array ();
|
||||
if (!defined('METACONSOLE')) {
|
||||
$table->style[0] = 'font-weight: bold; vertical-align: text-top;';
|
||||
$table->style[1] = 'font-weight: bold; vertical-align: middle;';
|
||||
$table->style[2] = 'font-weight: bold; vertical-align: top';
|
||||
}
|
||||
else{
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[1] = 'font-weight: bold; ';
|
||||
$table->style[2] = 'font-weight: bold; ';
|
||||
}
|
||||
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[1] = 'font-weight: bold; ';
|
||||
$table->style[2] = 'font-weight: bold; ';
|
||||
|
||||
$table->size = array ();
|
||||
$table->size[0] = "20%";
|
||||
$table->size[1] = "20%";
|
||||
$table->size[2] = "20%";
|
||||
$table->size[3] = "20%";
|
||||
$table->size[0] = "15%";
|
||||
$table->size[1] = "15%";
|
||||
$table->size[2] = "15%";
|
||||
$table->size[3] = "15%";
|
||||
|
||||
|
||||
$table->align = array();
|
||||
$table->align[0] = 'left';
|
||||
|
@ -167,7 +180,7 @@ if (defined('METACONSOLE')) {
|
|||
$table->rowstyle["all_2"] = 'display: none;';
|
||||
$table->data["all_2"][0] = __('Servers');
|
||||
$table->data["all_2"][1] = html_meta_print_select_servers(false,
|
||||
false, 'servers', '', '', '', 0, true);
|
||||
false, 'servers', '', 'metaconsole_init();', '', 0, true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -194,8 +207,12 @@ $table->data["all_one_item_per_agent"][1] .= html_print_input_hidden(
|
|||
|
||||
$table->rowstyle["all_4"] = 'display: none;';
|
||||
$table->data["all_4"][0] = __('Agents');
|
||||
$table->data["all_4"][1] = html_print_select(
|
||||
agents_get_group_agents(0, false, "none", false, true),
|
||||
|
||||
$agents_list = array();
|
||||
if (!defined('METACONSOLE'))
|
||||
$agents_list = agents_get_group_agents(0, false, "none", false, true);
|
||||
|
||||
$table->data["all_4"][1] = html_print_select($agents_list,
|
||||
'id_agents[]', 0, false, '', '', true, true);
|
||||
$table->data["all_4"][2] = ' <span style="vertical-align: top;">' .
|
||||
__('Modules') . '</span>';
|
||||
|
@ -256,7 +273,7 @@ else {
|
|||
onsubmit="if (! confirm(\''.__('Are you sure to add many elements\nin visual map?').'\')) return false; else return check_fields();">';
|
||||
}
|
||||
|
||||
if(defined("METACONSOLE")){
|
||||
if (defined("METACONSOLE")) {
|
||||
echo "<div class='title_tactical' style='margin-top: 15px; '>" . __('Wizard') . "</div>";
|
||||
}
|
||||
|
||||
|
@ -280,16 +297,14 @@ echo '<span id="none_text" style="display: none;">' . __('None') . '</span>';
|
|||
echo '<span id="loading_text" style="display: none;">' . __('Loading...') . '</span>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var show_only_enabled_modules = true;
|
||||
|
||||
<?php
|
||||
if (defined('METACONSOLE')) {
|
||||
echo 'var url_ajax = "../../ajax.php";';
|
||||
var metaconsole_enabled = <?php echo json_encode(defined('METACONSOLE')); ?>;
|
||||
var show_only_enabled_modules = true;
|
||||
var url_ajax = "ajax.php";
|
||||
|
||||
if (metaconsole_enabled) {
|
||||
url_ajax = "../../ajax.php";
|
||||
}
|
||||
else {
|
||||
echo 'var url_ajax = "ajax.php";';
|
||||
}
|
||||
?>
|
||||
|
||||
$(document).ready (function () {
|
||||
hidden_rows();
|
||||
|
@ -298,40 +313,42 @@ $(document).ready (function () {
|
|||
selected = $("#process_value").val();
|
||||
|
||||
if (selected == <?php echo PROCESS_VALUE_NONE; ?>) {
|
||||
$("tr", "#wizard_table").filter(function () {return /^.*modulegraph_simplevalue.*/.test(this.id); }).hide();
|
||||
$("tr", "#wizard_table").filter(function () {
|
||||
return /^.*modulegraph_simplevalue.*/.test(this.id);
|
||||
}).hide();
|
||||
}
|
||||
else {
|
||||
$("tr", "#wizard_table").filter(function () {return /^.*modulegraph_simplevalue.*/.test(this.id); }).show();
|
||||
$("tr", "#wizard_table").filter(function () {
|
||||
return /^.*modulegraph_simplevalue.*/.test(this.id);
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
|
||||
$("#groups").change (function () {
|
||||
$('#id_agents').attr('disabled', true);
|
||||
$('#id_agents').empty ();
|
||||
$('#id_agents').append ($('<option></option>').html($("#loading_text").html()));
|
||||
$('#id_agents').css ("width", "auto");
|
||||
$('#id_agents').css ("max-width", "");
|
||||
$('#id_agents')
|
||||
.attr('disabled', true)
|
||||
.empty ()
|
||||
.css ("width", "auto")
|
||||
.css ("max-width", "")
|
||||
.append ($('<option></option>').html($("#loading_text").html()));
|
||||
|
||||
var data_params = {"page": "include/ajax/agent",
|
||||
"get_agents_group": 1,
|
||||
"id_group": $("#groups").val(),
|
||||
<?php
|
||||
if (defined('METACONSOLE')) {
|
||||
echo '"id_server": $("#servers").val(),' . "\n";
|
||||
}
|
||||
?>
|
||||
"mode": "json"
|
||||
};
|
||||
var data_params = {
|
||||
page: "include/ajax/agent",
|
||||
get_agents_group: 1,
|
||||
id_group: $("#groups").val(),
|
||||
mode: "json"
|
||||
};
|
||||
|
||||
if (metaconsole_enabled)
|
||||
data_params.id_server = $("#servers").val();
|
||||
|
||||
jQuery.ajax ({
|
||||
data: data_params,
|
||||
async: false,
|
||||
type: 'POST',
|
||||
url: url_ajax,
|
||||
timeout: 10000,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
$('#id_agents').empty ();
|
||||
$('#id_agents').empty();
|
||||
|
||||
if (isEmptyObject(data)) {
|
||||
var noneText = $("#none_text").html(); //Trick for catch the translate text.
|
||||
|
@ -345,35 +362,32 @@ $(document).ready (function () {
|
|||
});
|
||||
}
|
||||
|
||||
$('#id_agents').css ("width", "auto");
|
||||
$('#id_agents').css ("max-width", "");
|
||||
|
||||
|
||||
$('#id_agents').removeAttr('disabled');
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
});
|
||||
|
||||
$("#id_agents").change ( function() {
|
||||
if ($("#hidden-item_per_agent_test").val() == 0)
|
||||
agent_changed_by_multiple_agents(
|
||||
<?php
|
||||
if (defined('METACONSOLE')) {
|
||||
echo "{'data': {'id_server': 'servers', 'metaconsole': 1, 'homedir': '../../'}}";
|
||||
if ($("#hidden-item_per_agent_test").val() == 0) {
|
||||
var options = {};
|
||||
|
||||
if (metaconsole_enabled) {
|
||||
options = {
|
||||
'data': {
|
||||
'id_server': 'servers',
|
||||
'metaconsole': 1,
|
||||
'homedir': '../../'
|
||||
}
|
||||
};
|
||||
}
|
||||
?>
|
||||
);
|
||||
|
||||
agent_changed_by_multiple_agents(options);
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
if (defined('METACONSOLE')) {
|
||||
echo "metaconsole_init();";
|
||||
if (metaconsole_enabled) {
|
||||
metaconsole_init();
|
||||
}
|
||||
?>
|
||||
|
||||
$("select[name='kind_relationship']").change(function() {
|
||||
|
||||
|
@ -484,7 +498,7 @@ function item_per_agent_change(itemPerAgent) {
|
|||
}
|
||||
|
||||
function metaconsole_init() {
|
||||
$("#groups").trigger('change');
|
||||
$("#groups").change();
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
|
|
|
@ -37,7 +37,8 @@ if ($servers === false) {
|
|||
return;
|
||||
}
|
||||
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
$table->size = array ();
|
||||
|
||||
$table->style = array ();
|
||||
|
@ -46,11 +47,13 @@ $table->style[0] = 'font-weight: bold';
|
|||
$table->align = array ();
|
||||
$table->align[1] = 'center';
|
||||
$table->align[3] = 'center';
|
||||
$table->align[4] = 'center';
|
||||
$table->align[5] = 'center';
|
||||
$table->align[8] = 'center';
|
||||
|
||||
$table->title = __('Tactical server information');
|
||||
$table->headstyle[1] = 'text-align:center';
|
||||
$table->headstyle[3] = 'text-align:center';
|
||||
$table->headstyle[8] = 'text-align:center';
|
||||
|
||||
//$table->title = __('Tactical server information');
|
||||
$table->titleclass = 'tabletitle';
|
||||
$table->titlestyle = 'text-transform:uppercase;';
|
||||
|
||||
|
@ -58,7 +61,7 @@ $table->head = array ();
|
|||
$table->head[0] = __('Name');
|
||||
$table->head[1] = __('Status');
|
||||
$table->head[2] = __('Type');
|
||||
$table->head[3] = __('Load') . ui_print_help_tip (__("Modules running on this server / Total modules of this type"), true);
|
||||
$table->head[3] = __('Version');
|
||||
$table->head[4] = __('Modules');
|
||||
$table->head[5] = __('Lag') . ui_print_help_tip (__("Avg. Delay(sec)/Modules delayed"), true);
|
||||
$table->head[6] = __('T/Q') . ui_print_help_tip (__("Threads / Queued modules currently"), true);
|
||||
|
@ -74,7 +77,7 @@ $table->data = array ();
|
|||
|
||||
foreach ($servers as $server) {
|
||||
$data = array ();
|
||||
|
||||
$table->cellclass[][3] = "progress_bar";
|
||||
$data[0] = '<span title="' . $server['version'] . '">' .
|
||||
$server['name'] . '</span>';
|
||||
|
||||
|
@ -90,22 +93,22 @@ foreach ($servers as $server) {
|
|||
if ($server["master"] == 1){
|
||||
$data[2] .= ui_print_help_tip (__("This is a master server"), true);
|
||||
}
|
||||
$data[2] .= '</span> <span style="font-size:8px;"> v' . $server["version"]. '</span>';
|
||||
//$data[2] .= '</span> <span style="font-size:8px;"> v' .. '</span>';
|
||||
|
||||
switch ($server['type']) {
|
||||
case "snmp":
|
||||
case "event":
|
||||
$data[3] = 'N/A';
|
||||
$data[3] = $server["version"];
|
||||
$data[4] = 'N/A';
|
||||
$data[5] = 'N/A';
|
||||
break;
|
||||
case "export":
|
||||
$data[3] = progress_bar($server["load"], 60, 20, $server["lag_txt"], 0);
|
||||
$data[3] = $server["version"];
|
||||
$data[4] = $server["modules"] . " ".__('of')." ". $server["modules_total"];
|
||||
$data[5] = 'N/A';
|
||||
break;
|
||||
default:
|
||||
$data[3] = progress_bar($server["load"], 60, 20, $server["lag_txt"], 0);
|
||||
$data[3] = $server["version"];
|
||||
$data[4] = $server["modules"] . " ".__('of')." ". $server["modules_total"];
|
||||
$data[5] = '<span style="white-space:nowrap;">' .
|
||||
$server["lag_txt"] . '</span>';
|
||||
|
@ -153,6 +156,7 @@ foreach ($servers as $server) {
|
|||
unset($data[8]);
|
||||
}
|
||||
array_push ($table->data, $data);
|
||||
|
||||
}
|
||||
|
||||
if ($tiny) {
|
||||
|
@ -161,6 +165,10 @@ if ($tiny) {
|
|||
unset($table->head[7]);
|
||||
unset($table->head[8]);
|
||||
}
|
||||
|
||||
html_print_table ($table);
|
||||
if ($tiny) {
|
||||
ui_toggle(html_print_table ($table,true), __('Tactical server information'));
|
||||
}
|
||||
else{
|
||||
html_print_table ($table);
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -117,6 +117,13 @@ $row[] = __('Yes') . ' ' .
|
|||
$config_double_auth_enabled, true);
|
||||
$table->data[] = $row;
|
||||
|
||||
$row_timeout = array();
|
||||
$row_timeout[] = __('Session timeout (mins)')
|
||||
. ui_print_help_tip(__("This is defined in minutes"), true);
|
||||
if (empty($config["session_timeout"])) $config["session_timeout"] = 90;
|
||||
$row_timeout[] = html_print_input_text ('session_timeout', $config["session_timeout"], '', 10, 10, true);
|
||||
$table->data[] = $row_timeout;
|
||||
|
||||
echo '<form id="form_setup" method="post">';
|
||||
html_print_input_hidden ('update_config', 1);
|
||||
html_print_table ($table);
|
||||
|
|
|
@ -495,6 +495,17 @@ $table->data[$row][1] = html_print_input_text ('custom_graph_widht',
|
|||
|
||||
$row++;
|
||||
|
||||
$table->data[$row][0] = __('Render data of module type is proc.');
|
||||
$table->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('render_proc', 1, '',
|
||||
$config["render_proc"], true) .
|
||||
' ';
|
||||
$table->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('render_proc', 0, '',
|
||||
$config["render_proc"], true);
|
||||
|
||||
$row++;
|
||||
|
||||
|
||||
echo '<form id="form_setup" method="post">';
|
||||
html_print_input_hidden ('update_config', 1);
|
||||
|
|
|
@ -503,7 +503,7 @@ if ($create_alert || $update_alert) {
|
|||
|
||||
/* SNMP alert filters */
|
||||
|
||||
echo '<table cellpadding="4" cellspacing="4" width="98%" class="databox" style="font-weight: bold">';
|
||||
echo '<table cellpadding="0" cellspacing="0" width="100%" class="databox filter" style="font-weight: bold">';
|
||||
|
||||
// Description
|
||||
echo '<tr><td class="datos" valign="top">'.__('Description').'</td><td class="datos">';
|
||||
|
@ -863,7 +863,8 @@ else {
|
|||
$offset = (int) get_parameter ('offset');
|
||||
|
||||
$table_filter = new stdClass();
|
||||
$table_filter->width = "98%";
|
||||
$table_filter->width = "100%";
|
||||
$table_filter->class = "databox filters";
|
||||
$table_filter->data = array();
|
||||
$table_filter->data[0][0] = __('Free search') . ui_print_help_tip(
|
||||
__('Search by these fields description, OID, Custom Value, SNMP Agent (IP), Single value, each Variable bindings/Datas.'), true);
|
||||
|
@ -884,7 +885,7 @@ else {
|
|||
$form_filter .= '</div>';
|
||||
$form_filter .= '</form>';
|
||||
|
||||
echo "<br>";
|
||||
//echo "<br>";
|
||||
ui_toggle($form_filter,__('Alert SNMP control filter'), __('Toggle filter(s)'));
|
||||
|
||||
$filter = array();
|
||||
|
@ -948,7 +949,7 @@ else {
|
|||
//Overview
|
||||
if ($count == 0) {
|
||||
$result = array ();
|
||||
echo "<div class='nf'>" . __('There are no SNMP alerts') . "</div>";
|
||||
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP alerts') ) );
|
||||
}
|
||||
else {
|
||||
ui_pagination ($count, $url_pagination);
|
||||
|
@ -965,8 +966,8 @@ else {
|
|||
$table->size = array ();
|
||||
$table->cellpadding = 4;
|
||||
$table->cellspacing = 4;
|
||||
$table->width = "98%";
|
||||
$table->class= "databox";
|
||||
$table->width = "100%";
|
||||
$table->class= "databox data";
|
||||
$table->align = array ();
|
||||
|
||||
$table->head[0] = '<span title="' . __('Position') . '">' . __('P.') . '</span>';
|
||||
|
|
|
@ -58,30 +58,31 @@ if ($generate_trap) {
|
|||
}
|
||||
|
||||
$traps_generator = '<form method="POST" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_trap_generator">';
|
||||
$table->width = '90%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->size = array ();
|
||||
$table->data = array ();
|
||||
|
||||
$table->data[0][0] = __('Host address');
|
||||
$table->data[0][1] = html_print_input_text('snmp_host_address', $snmp_host_address, '', 50, 255, true);
|
||||
|
||||
$table->data[1][0] = __('Community');
|
||||
$table->data[1][1] = html_print_input_text('snmp_community', $snmp_community, '', 50, 255, true);
|
||||
$table->data[0][2] = __('Community');
|
||||
$table->data[0][3] = html_print_input_text('snmp_community', $snmp_community, '', 50, 255, true);
|
||||
|
||||
$table->data[2][0] = __('Enterprise String');
|
||||
$table->data[2][1] = html_print_input_text('snmp_oid', $snmp_oid, '', 50, 255, true);
|
||||
|
||||
$table->data[2][2] = __('Value');
|
||||
$table->data[2][3] = html_print_input_text('snmp_value', $snmp_value, '', 50, 255, true);
|
||||
|
||||
$table->data[3][0] = __('SNMP Agent');
|
||||
$table->data[3][1] = html_print_input_text('snmp_agent', $snmp_agent, '', 50, 255, true);
|
||||
|
||||
$table->data[4][0] = __('SNMP Type').' '.ui_print_help_icon ("snmp_trap_types", true);
|
||||
$table->data[4][1] = html_print_input_text('snmp_type', $snmp_type, '', 50, 255, true);
|
||||
$table->data[3][2] = __('SNMP Type').' '.ui_print_help_icon ("snmp_trap_types", true);
|
||||
$table->data[3][3] = html_print_input_text('snmp_type', $snmp_type, '', 50, 255, true);
|
||||
|
||||
$types = array(0 => 'Cold start (0)', 1 => 'Warm start (1)', 2 => 'Link down (2)', 3 => 'Link up (3)', 4 => 'Authentication failure (4)', 5 => 'EGP neighbor loss (5)', 6 => 'Enterprise (6)');
|
||||
$table->data[4][1] = html_print_select($types, 'snmp_type', $snmp_type, '', __('Select'), -1, true, false, false);
|
||||
|
||||
$table->data[5][0] = __('Value');
|
||||
$table->data[5][1] = html_print_input_text('snmp_value', $snmp_value, '', 50, 255, true);
|
||||
$table->data[3][3] = html_print_select($types, 'snmp_type', $snmp_type, '', __('Select'), -1, true, false, false);
|
||||
|
||||
|
||||
$traps_generator .= html_print_table($table, true);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue