Merge branch 'develop' into feature/alias_freandly_name

Conflicts:
	pandora_agents/unix/pandora_agent
	pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql
	pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql
	pandora_console/godmode/agentes/agent_manager.php
	pandora_console/godmode/agentes/modificar_agente.php
	pandora_console/godmode/agentes/planned_downtime.editor.php
	pandora_console/godmode/massive/massive_delete_modules.php
	pandora_console/godmode/massive/massive_edit_modules.php
	pandora_console/include/class/Tree.class.php
	pandora_console/include/functions_graph.php
	pandora_console/include/functions_treeview.php
	pandora_console/include/functions_ui.php
	pandora_console/operation/agentes/estado_agente.php
	pandora_console/operation/agentes/status_monitor.php
	pandora_console/pandoradb.sql
This commit is contained in:
Daniel Maya 2017-02-16 16:05:21 +01:00
commit d39b108c1f
579 changed files with 166035 additions and 130760 deletions

6
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,6 @@
variables:
GIT_STRATEGY: clone
test:
script:
- docker run --rm -h pandorafms -t -v "$CI_PROJECT_DIR:/tmp/pandorafms" pandorafms/pandorafms-base /tmp/pandorafms/tests/test.sh

View File

@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/pandorafms/pandorafms.svg?branch=develop)](https://travis-ci.org/pandorafms/pandorafms)
[![Pandora logo](http://pandorafms.com/github/logo_2.png)](http://pandorafms.org)
[![Pandora logo](http://wolf359.artica.es/public_images/logo_pandora_community.png)](http://pandorafms.org)
Pandora FMS is a monitoring software for IT infrastructure management which includes network equipment, Windows and Unix servers, virtual infrastructure and all different kind of applications. It has a large amount of features, making it a new generation software which discovers all the monitoring issues that an organization may need.
@ -33,13 +33,13 @@ Pandora FMS is a monitoring tool that not only measures if a parameter is right
* Multiuser, several levels of ACL management.
### Screenshots
![screenshot 1](http://pandorafms.com/github/agent_list.png)
![screenshot 1](http://wolf359.artica.es/public_images/captura-pantalla-pandora3.png)
<br />
<br />
![screenshot 2](http://pandorafms.com/github/captura_pantalla5.png)
![screenshot 2](http://wolf359.artica.es/public_images/pandora6.0sp3-monitor-view.png)
<br />
<br />
![screenshot 3](http://pandorafms.com/github/pandora_sla_report2.png)
![screenshot 3](http://wolf359.artica.es/public_images/pandora6.0sp3-agentview.png)
<br />
<br />
![screenshot 4](http://pandorafms.com/github/services.png)
![screenshot 4](http://wolf359.artica.es/public_images/pandora6.0sp3-sample-visual-console.png)

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, AIX version
# Version 7.0dev, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, FreeBSD Version
# Version 7.0dev, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, HP-UX Version
# Version 7.0dev, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, GNU/Linux
# Version 7.0dev, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, GNU/Linux
# Version 7.0dev, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, Solaris Version
# Version 7.0dev, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 6.1dev
# Version 7.0dev
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 6.1dev, AIX version
# Version 7.0dev, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 6.1dev
# Version 7.0dev
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 6.1dev, HPUX Version
# Version 7.0dev, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev
# Version 7.0dev
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev
# Version 7.0dev
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev
# Version 7.0dev
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 6.1dev, Solaris version
# Version 7.0dev, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, AIX version
# Version 7.0dev, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -28,6 +28,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers)
#group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable
# this feature

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 6.1dev-160922
Version: 7.0dev-170216
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="6.1dev-160922"
pandora_version="7.0dev-170216"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
@ -37,6 +37,7 @@ mkdir -p temp_package/usr/sbin/
mkdir -p temp_package/etc/pandora/plugins
mkdir -p temp_package/etc/pandora/collections
mkdir -p temp_package/etc/init.d/
mkdir -p temp_package/lib/systemd/system/
mkdir -p temp_package/var/log/pandora/
mkdir -p temp_package/var/spool/pandora/data_out
mkdir -p temp_package/usr/share/man/man1/
@ -63,6 +64,7 @@ cp -aRf tentacle_client temp_package/usr/bin/
cp -aRf pandora_agent temp_package/usr/bin/
cp -aRf pandora_agent_exec temp_package/usr/bin/pandora_agent_exec
cp -aRf pandora_agent_daemon temp_package/etc/init.d/pandora_agent_daemon
cp -aRf pandora_agent_daemon.service temp_package/lib/systemd/system/pandora_agent_daemon.service
cp -aRf pandora_agent_logrotate temp_package/etc/logrotate.d/pandora_agent
cp Linux/pandora_agent.conf temp_package/etc/pandora/

View File

@ -22,7 +22,12 @@ chgrp root $PANDORA_LOG
chown -R root:root $PANDORA_BIN
chown -R root:root $PANDORA_EXEC_BIN
echo "Linking start-up daemon script to /etc/rc$INITLV.d";
update-rc.d pandora_agent_daemon defaults
echo "Enabling start-up agent daemon";
if [ -x `command -v systemctl` ]; then
systemctl daemon-reload
systemctl enable pandora_agent_daemon
else
update-rc.d pandora_agent_daemon defaults
fi
echo "Please, now setup the $PANDORA_HOME/pandora_agent.conf and before start the /etc/init.d/pandora_agent_daemon"
echo "Please, now setup the $PANDORA_HOME/pandora_agent.conf and before start the pandora_agent_daemon service"

View File

@ -8,4 +8,9 @@ PANDORA_CFG=/etc/pandora
#rm -rf $PANDORA_CFG/plugins
#rm -rf $PANDORA_CFG/pandora_agent.conf
update-rc.d -f pandora_agent_daemon remove
if [ -x `command -v systemctl` ]; then
systemctl disable pandora_agent_daemon
systemctl daemon-reload
else
update-rc.d -f pandora_agent_daemon remove
fi

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, GNU/Linux
# Version 7.0dev, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -42,6 +42,9 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers)
#group Servers
# Group password (if defined).
#group_password
# address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example
#address auto

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, FreeBSD Version
# Version 7.0dev, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -11,6 +11,7 @@ server_ip localhost
server_path /var/spool/pandora/data_in
temporal /tmp
logfile /var/log/pandora/pandora_agent.log
#include /etc/pandora/pandora_agent_alt.conf
#broker_agent name_agent
@ -49,10 +50,19 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers)
group Servers
# Group password (if defined).
#group_password
# address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example
address auto
# or setting a fixed IP address, like for example:
#address 192.168.36.73
# Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable
# this feature
# autotime 1
#autotime 1
# Timezone offset: Difference with the server timezone
#timezone_offset 0
@ -139,9 +149,6 @@ xml_buffer 1
# Minimum available bytes in the temporal directory to enable the XML buffer
temporal_min_size 1024
# Agent mode: Learn (default), No-learn, Autodisable
# agent_mode autodisable
#Secondary server configuration
#==============================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, HP-UX Version
# Version 7.0dev, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -30,6 +30,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers)
#group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable
# this feature

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, GNU/Linux
# Version 7.0dev, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -50,6 +50,9 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers)
group Servers
# Group password (if defined).
#group_password
# address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example
address auto
@ -242,7 +245,7 @@ module_end
# This plugin detects all disk and report free space (%)
module_plugin pandora_df_free
module_plugin pandora_df_used
# This plugin detects system free memory and free swap (in %)

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, GNU/Linux
# Version 7.0dev, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -41,6 +41,9 @@ udp_server_auth_address 0.0.0.0
# Group assigned for this agent (descriptive, p.e: Servers)
#group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, NetBSD Version
# Version 7.0dev, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -33,6 +33,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers)
group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable
# this feature

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 6.1dev, Solaris Version
# Version 7.0dev, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -30,6 +30,9 @@ debug 0
# Group assigned for this agent (descriptive, p.e: Servers)
#group Servers
# Group password (if defined).
#group_password
# Autotime: Enforce to server to ignore timestamp coming from this
# agent, used when agents has no timer or it's inestable. 1 to enable
# this feature

View File

@ -40,8 +40,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '6.1dev';
use constant AGENT_BUILD => '160922';
use constant AGENT_VERSION => '7.0dev';
use constant AGENT_BUILD => '170216';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -136,9 +136,12 @@ my %DefaultConf = (
'debug' => 0,
'agent_name' => '',
'agent_alias' => hostname(),
'ehorus_conf' => undef,
'agent_name_cmd' => '',
'description' => '',
'group' => '',
'group_id' => undef,
'group_password' => undef,
'encoding' => 'UTF-8',
'server_port' => 41121,
'transfer_mode' => 'tentacle',
@ -634,6 +637,16 @@ sub parse_conf_modules($) {
# FF interval
} elsif ($line =~ /^\s*module_ff_interval\s+(\S+)\s*$/) {
$module->{'module_ff_interval'} = $1;
} elsif ($line =~ /^\s*module_min_ff_event_normal\s+(\S+)\s*$/) {
$module->{'min_ff_event_normal'} = $1;
} elsif ($line =~ /^\s*module_min_ff_event_warning\s+(\S+)\s*$/) {
$module->{'min_ff_event_warning'} = $1;
} elsif ($line =~ /^\s*module_min_ff_event_critical\s+(\S+)\s*$/) {
$module->{'min_ff_event_critical'} = $1;
} elsif ($line =~ /^\s*module_ff_timeout\s+(\S+)\s*$/) {
$module->{'ff_timeout'} = $1;
} elsif ($line =~ /^\s*module_each_ff\s+(\S+)\s*$/) {
$module->{'each_ff'} = $1;
# Macros
} elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) {
$module->{'macros'}{$1} = $2;
@ -2083,7 +2096,14 @@ sub write_module_xml ($@) {
# Module Alert template
$Xml .= " <crontab>" . $module->{'cron'} . "</crontab>\n" if (defined ($module->{'cron'}) and ($module->{'cron'} ne ""));
# FF threshold configuration
$Xml .= " <min_ff_event_normal>" . $module->{'min_ff_event_normal'} . "</min_ff_event_normal>\n" if (defined ($module->{'min_ff_event_normal'}));
$Xml .= " <min_ff_event_warning>" . $module->{'min_ff_event_warning'} . "</min_ff_event_warning>\n" if (defined ($module->{'min_ff_event_warning'}));
$Xml .= " <min_ff_event_critical>" . $module->{'min_ff_event_critical'} . "</min_ff_event_critical>\n" if (defined ($module->{'min_ff_event_critical'}));
$Xml .= " <ff_timeout>" . $module->{'ff_timeout'} . "</ff_timeout>\n" if (defined ($module->{'ff_timeout'}));
$Xml .= " <each_ff>" . $module->{'each_ff'} . "</each_ff>\n" if (defined ($module->{'each_ff'}));
# Data list
if ($#data > 0) {
$Xml .= " <data><![CDATA[" . join('', @data) . "]]></data>\n";
@ -2376,6 +2396,39 @@ sub config_update ($$) {
close($fh);
}
################################################################################
# Get the eHorus key from the eHorus agent configuration file.
################################################################################
sub get_ehkey {
my $fh;
return '' unless defined($Conf{'ehorus_conf'});
# Open the eHorus configuration file.
if (!open($fh, '<', $Conf{'ehorus_conf'})) {
# Do not write to the log, since ehorus_conf points to the default eHorus configuration file by default.
return '';
}
# Look for the eHorus key.
while (my $line = <$fh>) {
# Skip comments.
next if ($line =~ m/^\s*#/);
if ($line =~ m/\s*eh_key\s+(\S+)/) {
my $eh_key = $1;
close($fh);
return $eh_key;
}
}
# Not found.
close($fh);
return '';
}
################################################################################
# Main.
################################################################################
@ -2526,12 +2579,15 @@ while (1) {
if(defined($Conf{'address'})) {
# Check if address is auto to get the local ip
if ($Conf{'address'} eq 'auto') {
# Tested on Ubuntu, debian, Suse, Solaris 10 and AIX 5.1
my @address_list = `ifconfig -a 2>$DevNull | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{ print \$2 }' | awk -F':' '{ print \$2 }'`;
if ($#address_list < 0) {
# Tested on Red Hat 7
@address_list = `ip addr show 2>$DevNull | grep -v '127.0.0' | grep '[0-9]*\\.[0-9]*\\.[0-9]*' | awk '{print \$2}' | cut -d/ -f1`;
my @address_list;
if( -x "/bin/ip" || -x "/sbin/ip" || -x "/usr/sbin/ip" ) {
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
}
else {
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`;
}
for (my $i = 0; $i <= $#address_list; $i++) {
chomp($address_list[$i]);
if ($i > 0) {
@ -2549,11 +2605,14 @@ while (1) {
# Clear the XML
$Xml = "";
# Get the eHorus key.
my $eh_key = get_ehkey();
# Custom fields
my @customfieldskeys = keys(%Customfields);
if ($#customfieldskeys > -1) {
if ($#customfieldskeys > -1 || $eh_key ne '') {
$Xml .= "<custom_fields>\n";
foreach my $customfieldkey (@customfieldskeys) {
if($customfieldkey =~ m/^(custom_field\d+_)name/) {
if(defined($Customfields{$1."value"})) {
@ -2564,6 +2623,15 @@ while (1) {
}
}
}
# Add the eHorus key as a custom field.
if ($eh_key ne '') {
$Xml .= " <field>\n";
$Xml .= " <name>eHorusID</name>\n";
$Xml .= " <value><![CDATA[". $eh_key ."]]></value>\n";
$Xml .= " </field>\n";
}
$Xml .= "</custom_fields>\n";
}
@ -2596,7 +2664,9 @@ while (1) {
# Compose the XML
my $xml_header = "<?xml version='1.0' encoding='" . $Conf{'encoding'} . "'?>\n" .
"<agent_data description='" . $Conf{'description'} ."' group='" . $Conf{'group'} .
"<agent_data description='" . $Conf{'description'} . "' group='" . $Conf{'group'} .
(defined($Conf{'group_password'}) ? ("' group_password='" . $Conf{'group_password'}) : '') .
(defined($Conf{'group_id'}) ? ("' group_id='" . $Conf{'group_id'}) : '') .
"' os_name='$OS' os_version='$OS_VERSION' interval='" . $Conf{'interval'} .
"' version='" . AGENT_VERSION . '(Build ' . AGENT_BUILD . ')' . ($Conf{'autotime'} eq '1' ? '' : "' timestamp='" . strftime ('%Y/%m/%d %H:%M:%S', localtime ())) .
"' agent_name='" . $Conf{'agent_name'} . "' agent_alias='". $Conf{'agent_alias'} .
@ -2651,6 +2721,7 @@ while (1) {
$xml_header .= "' position_description='" .$Conf{'position_description'};
}
}
$xml_header .= "'>\n";
$Xml = $xml_header . $Xml . "</agent_data>";

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 6.1dev
%define release 160922
%define version 7.0dev
%define release 170216
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: fileutils textutils unzip
Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk
Requires: perl perl(Sys::Syslog)
Requires: perl perl(Sys::Syslog) perl(IO::Socket::SSL)
# Required by plugins
#Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 6.1dev
%define release 160922
%define version 7.0dev
%define release 170216
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -27,6 +27,10 @@ DAEMON_TENTACLE=/usr/bin/tentacle_server
LOGFILE=/var/log/pandora/pandora_agent.log
PANDORA_USER=root
if [ -x /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
# This function replace pidof, not working in the same way in different linux distros
pidof_pandora () {

View File

@ -0,0 +1,9 @@
[Unit]
Description=Pandora FMS agent daemon
After=network-online.target
[Service]
ExecStart=/usr/bin/pandora_agent /etc/pandora
[Install]
WantedBy=multi-user.target

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="6.1dev"
PI_BUILD="160922"
PI_VERSION="7.0dev"
PI_BUILD="170216"
OS_NAME=`uname -s`
FORCE=0

View File

@ -19,9 +19,9 @@
# GNU General Public License for more details.
#
###############################################################################
use strict;
use File::Basename;
use Scalar::Util qw(looks_like_number);
# Output format (module or log_module).
my $Output = 'module';
@ -30,7 +30,7 @@ my $Output = 'module';
my $Verbose = 0;
# Index file storage directory, with a trailing '/'
my $Idx_dir='/tmp/';
my $Idx_dir=($^O =~ /win/i)?'C:\\':'/tmp/';
# Log file
my $Log_file = '';
@ -59,6 +59,44 @@ my $summary_flag = 0;
# Number of coincidences found
my $coincidences = 0;
########################################################################################
# Erase blank spaces before and after the string
########################################################################################
sub trim($){
my $string = shift;
if (empty ($string)){
return "";
}
$string =~ s/\r//g;
chomp ($string);
$string =~ s/^\s+//g;
$string =~ s/\s+$//g;
return $string;
}
########################################################################################
# Empty
########################################################################################
sub empty($){
my $str = shift;
if (! (defined ($str)) ){
return 1;
}
if(looks_like_number($str)){
return 0;
}
if ($str =~ /^\ *[\n\r]{0,2}\ *$/) {
return 1;
}
return 0;
}
###############################################################################
# SUB error_msg
# Print an error message and exit.
@ -188,7 +226,10 @@ sub parse_log (;$$) {
seek(LOGFILE, $Idx_pos, 0);
# Parse log file
my @data;
my %data;
# Matched line id
my $matched_line = 0;
if ( (defined($up_lines)) || (defined($bot_lines)) ){
# Detailed workmode
@ -210,8 +251,9 @@ sub parse_log (;$$) {
$flag = 1;
# Push upper lines
for (my $i = ($curr_line-$up_lines); $i<=$curr_line; $i++){
if ($i < 0) {next;}
if (defined ($lines[$i])) {
push (@data, $lines[$i]);
push (@{$data{$matched_line}}, $lines[$i]);
}
}
@ -220,16 +262,17 @@ sub parse_log (;$$) {
# Push bottom lines
for (my $i = ($curr_line+$flag); $i<=($curr_line+$bot_lines); $i++){
if (defined ($lines[$i])) {
push (@data, $lines[$i]);
push (@{$data{$matched_line}}, $lines[$i]);
}
}
}
$matched_line++;
}
}
else { # Standar workmode
while ($line = <LOGFILE>) {
if ($line =~ m/$Reg_exp/i) {
push @data, $line;
push (@{$data{$matched_line++}}, $line);
}
}
}
@ -240,7 +283,7 @@ sub parse_log (;$$) {
# Save the index file
save_idx();
return @data;
return \%data;
}
###############################################################################
@ -262,11 +305,12 @@ sub print_summary() {
# SUB parse_log
# Print log data to stdout.
###############################################################################
sub print_log (@) {
my @data = @_;
sub print_log ($) {
my $data = shift;
# No data
if ($#data < 0) {
my @kdata = keys (%{$data});
if ($#kdata < 0) {
print_summary() if ($summary_flag == 1);
return;
}
@ -276,8 +320,8 @@ sub print_log (@) {
my $output = "<log_module>\n";
$output .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
$output .= "<data><![CDATA[";
foreach my $line (@data) {
$output .= $line;
foreach my $line (@kdata) {
$output .= $data->{$line};
}
$output .= "]]></data>";
$output .= "</log_module>\n";
@ -292,8 +336,12 @@ sub print_log (@) {
$output .= "<name><![CDATA[" . $Module_name . "]]></name>\n";
$output .= "<type><![CDATA[async_string]]></type>\n";
$output .= "<datalist>\n";
foreach my $line (@data) {
$output .= "<data><value><![CDATA[$line]]></value></data>\n";
foreach my $line (@kdata) {
$output .= "<data><value><![CDATA[";
foreach my $content (@{$data->{$line}}) {
$output .= $content;
}
$output .= "]]></value></data>\n";
}
$output .= "</datalist>\n";
$output .= "</module>\n";
@ -314,12 +362,12 @@ if ($#ARGV < 2) {
exit 1;
}
$Log_file = $ARGV[0];
$Module_name = $ARGV[1];
$Reg_exp = $ARGV[2];
my $up_lines = $ARGV[3];
my $bot_lines = $ARGV[4];
my $sum_flag = $ARGV[5];
$Log_file = trim($ARGV[0]);
$Module_name = trim($ARGV[1]);
$Reg_exp = trim($ARGV[2]);
my $up_lines = trim($ARGV[3]);
my $bot_lines = trim($ARGV[4]);
my $sum_flag = trim($ARGV[5]);
if ( ( defined($up_lines) && ($up_lines eq "--summary"))
|| ( defined($bot_lines) && ($bot_lines eq "--summary"))
@ -348,9 +396,9 @@ if (! -e $Idx_file) {
load_idx();
# Parse log file
my @data = parse_log($up_lines,$bot_lines);
my $data = parse_log($up_lines,$bot_lines);
# Print output to stdout
print_log (@data);
print_log ($data);
exit 0;

View File

@ -0,0 +1,98 @@
#!/usr/bin/perl
###############################################################################
#
# Copyright (c) 2016 Antonio Sánchez <antonio.sanchez@artica.es>
# Copyright (c) 2016 Artica Soluciones Tecnologicas S.L.
#
# By default, gather data from all data file system types.
# You can add many filesystems you want to include in the checks by just passing
# their names as argument on the script execution, you can either use filesystem
# or mount point. It admits regular expressions and it is case sensitive.
# You can also ignore certain checks by just using '-' and their name on execution.
#
# Sample usage: ./pandora_df_used -/DB /run$ /dev$
#
# Sample usage: ./pandora_df_used tmpfs /dev/sda1
#
# Execute the script with '-h' parameter to display help.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
###############################################################################
use strict;
# Print help screen
if (@ARGV[0] eq "-h")
{
print "Script to retrieve filesystem % used space and mount point.\n";
print "Usage: ./pandora_df_used [optional parameters]\n";
print "\nOptional parameters can include additional filesystems/mount points, or exclude default checks.\n";
print "\nSample usage:\n";
print " ./pandora_df_used -/DB /run\$ /dev/sda1\n";
print "\nThis would display all info from default data filesystem types, ignore '/DB' and include '/run' and '/dev/sda1'.\n";
print "Arguments admit regular expressions and are case sensitive.\n";
}
else
{
# Parse command line arguments
my %filesystems;
my %excluded_filesystems;
my $onlyexclude = 1;
# Store all "ext" fstypes in @lines array
my @lines = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1":"\$2":"\$(NF-1)":"\$NF}' | grep -i "adfs\\|affs\\|autofs\\|btrfs\\|cifs\\|coda\\|coherent\\|efs\\|ext\\|hfs\\|hfsplus\\|hpfs\\|jfs\\|minix\\|msdos\\|ncpfs\\|nfs\\|nfs4\\|ntfs\\|proc\\|qnx4\\|reiserfs\\|smbfs\\|sysv\\|ubifs\\|udf\\|ufs\\|umsdos\\|usbfs\\|vfat\\|xenix\\|xfs\\|xiafs"`;
chomp (@lines);
# To skip indicated filesystems
foreach my $fs (@ARGV)
{
if (substr($fs,0,1) eq '-')
{
$excluded_filesystems{substr($fs,1,)} = '-1%';
}
else
{
my @linesmanual = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1":"\$2":"\$(NF-1)":"\$NF}' | grep -i $fs`;
chomp (@linesmanual);
$filesystems{$fs} = '-1%';
$onlyexclude = 0;
push (@lines, @linesmanual);
}
}
my $free;
foreach (@lines)
{
my ($filesystem, $fstype, $used_space, $mount_point) = split /:/,$_;
if (defined ($filesystems{$mount_point}) || (!defined ($excluded_filesystems{$mount_point})))
{
$free = 100 - $used_space;
$used_space = 100 - $free;
print "<module>\n";
print "<name><![CDATA[DiskUsed_" . $mount_point . "]]></name>\n";
print "<type><![CDATA[generic_data]]></type>\n";
print "<data><![CDATA[" . $used_space . "]]></data>\n";
print "<min_critical><![CDATA[95]]></min_critical>\n";
print "<unit><![CDATA[%]]></unit>\n";
print "<min_warning><![CDATA[90]]></min_warning>\n";
print "<description><![CDATA[% used space. Filesystem mounted: " . $filesystem . "]]></description>\n";
print "<module_group><![CDATA[System]]></module_group>\n";
print "</module>\n";
}
}
}

View File

@ -7,10 +7,22 @@ use POSIX;
my $TOTAL=`vmstat -s | grep "total memory" | awk '{ print $1 } '`;
my $FREE=`vmstat -s | grep "free memory" | awk '{ print $1 } '`;
my $FREEP=($FREE/$TOTAL)*100;
my $FREEP;
eval {
$FREEP=($FREE/$TOTAL)*100;
};
if ($@) {
$FREEP = 0;
}
my $STOTAL=`vmstat -s | grep "total swap" | awk '{ print $1 } '`;
my $SUSED=`vmstat -s | grep "free swap" | awk '{ print $1 } '`;
my $SFREE=($SUSED/$STOTAL)*100;
my $SFREE;
eval {
$SFREE=($SUSED/$STOTAL)*100;
};
if ($@) {
$SFREE = 0;
}
$SFREE = floor($SFREE);
$FREEP = floor($FREEP);
@ -21,7 +33,7 @@ my $freemem=`cat /proc/meminfo | grep 'MemFree' | awk '{ print \$2 } '`;
my $cached=`cat /proc/meminfo | grep '^Cached:' | awk '{ print \$2 } '`;
my $cachedswap=`cat /proc/meminfo | grep '^SwapCached:' | awk '{ print \$2 }'`;
my $total_meminfo=`cat /proc/meminfo | grep 'MemTotal:' | awk '{ print \$2 }'`;
my $available=$freemem+$cached+$cachedwap;
my $available=$freemem+$cached+$cachedswap;
my $available_percent = floor(($available / $total_meminfo)*100);

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2014 Artica Soluciones Tecnologicas
# Version 6.1dev
# Version 7.0dev
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -25,25 +25,24 @@ For Each objItem in colItems
If argc = 0 Or argv.Exists(objItem.Name) Then
' Include only harddrivers (type 3)
If (objItem.FreeSpace <> "") AND (objItem.DriveType =3) Then
Percent = round ((objItem.FreeSpace / objItem.Size) * 100, 2)
Percent = round ((objItem.FreeSpace / objItem.Size) * 100, 2)
Wscript.StdOut.WriteLine "<module>"
Wscript.StdOut.WriteLine " <name><![CDATA[DiskFree%_" & objItem.Name & "]]></name>"
Wscript.StdOut.WriteLine " <description><![CDATA[Drive " & objItem.Name & " % free space ]]></description>"
if (Percent > 99.99) then
Wscript.StdOut.WriteLine " <description><![CDATA[Drive " & objItem.Name & " free space: " & Int(objItem.FreeSpace /1048576) & " MB]]></description>"
If (Percent > 99.99) then
Wscript.StdOut.WriteLine " <data><![CDATA[" & 100 & "]]></data>"
elseif (Percent < 0.01) then
Elseif (Percent < 0.01) then
Wscript.StdOut.WriteLine " <data><![CDATA[" & 0 & "]]></data>"
else
Else
Wscript.StdOut.WriteLine " <data><![CDATA[" & Percent & "]]></data>"
Wscript.StdOut.WriteLine "<unit>%</unit>"
Wscript.StdOut.WriteLine "<min_warning>5</min_warning>"
Wscript.StdOut.WriteLine "<max_warning>10</max_warning>"
Wscript.StdOut.WriteLine "<min_critical>0</min_critical>"
Wscript.StdOut.WriteLine "<max_critical>5</max_critical>"
Wscript.StdOut.WriteLine "</module>"
Wscript.StdOut.flush
End If
End If
Wscript.StdOut.WriteLine " <unit>%</unit>"
Wscript.StdOut.WriteLine " <min_warning>5</min_warning>"
Wscript.StdOut.WriteLine " <max_warning>10</max_warning>"
Wscript.StdOut.WriteLine " <min_critical>0</min_critical>"
Wscript.StdOut.WriteLine " <max_critical>5</max_critical>"
Wscript.StdOut.WriteLine "</module>"
Wscript.StdOut.flush
End If
End If
Next

View File

@ -0,0 +1,48 @@
' df_all.vbs
' Returns free space (%) for all drives
' Pandora FMS Plugin, (c) 2014 Sancho Lerena
' ------------------------------------------
Option Explicit
On Error Resume Next
' Variables
Dim objWMIService, objItem, colItems, argc, argv, i, Percent, Percentused
' Parse command line parameters
argc = Wscript.Arguments.Count
Set argv = CreateObject("Scripting.Dictionary")
For i = 0 To argc - 1
argv.Add Wscript.Arguments(i), i
Next
' Get drive information
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk")
For Each objItem in colItems
If argc = 0 Or argv.Exists(objItem.Name) Then
' Include only harddrivers (type 3)
If (objItem.FreeSpace <> "") AND (objItem.DriveType =3) Then
Percent = round ((objItem.FreeSpace / objItem.Size) * 100, 2)
Percentused = 100 - (Percent)
Wscript.StdOut.WriteLine "<module>"
Wscript.StdOut.WriteLine " <name><![CDATA[DiskUsed%_" & objItem.Name & "]]></name>"
Wscript.StdOut.WriteLine " <description><![CDATA[Drive " & objItem.Name & " % used space ]]></description>"
if (Percentused > 99.99) then
Wscript.StdOut.WriteLine " <data><![CDATA[" & 100 & "]]></data>"
elseif (Percentused < 0.01) then
Wscript.StdOut.WriteLine " <data><![CDATA[" & 0 & "]]></data>"
else
Wscript.StdOut.WriteLine " <data><![CDATA[" & Percentused & "]]></data>"
End If
Wscript.StdOut.WriteLine " <unit>%</unit>"
Wscript.StdOut.WriteLine " <min_warning>90</min_warning>"
Wscript.StdOut.WriteLine " <min_critical>95</min_critical>"
Wscript.StdOut.WriteLine "</module>"
Wscript.StdOut.flush
End If
End If
Next

Binary file not shown.

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v6.1dev}
{Pandora FMS Windows Agent v7.0dev}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -75,7 +75,7 @@ InstallPassword
{}
InstallVersion
{6.1.0.0}
{7.0.0.0}
Language,ca
{No}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{160922}
{170216}
ViewReadme
{Yes}

View File

@ -213,6 +213,8 @@ Pandora_Module::parseModuleTypeFromString (string type) {
return TYPE_ASYNC_STRING;
} else if (type == module_log_str) {
return TYPE_LOG;
} else if (type == module_generic_data_inc_abs_str) {
return TYPE_GENERIC_DATA_INC_ABS;
} else {
return TYPE_0;
}

View File

@ -50,7 +50,9 @@ namespace Pandora_Modules {
TYPE_ASYNC_DATA, /**< Asynchronous generic_data */
TYPE_ASYNC_PROC, /**< Asynchronous generic_proc */
TYPE_ASYNC_STRING, /**< Asynchronous generic_data_string */
TYPE_LOG /**< Log data */
TYPE_LOG, /**< Log data */
TYPE_GENERIC_DATA_INC_ABS /**< The value is an integer with
* incremental diferences (timestamps are ignored) */
} Module_Type;
const string module_generic_data_str = "generic_data";
@ -61,6 +63,7 @@ namespace Pandora_Modules {
const string module_async_proc_str = "async_proc";
const string module_async_string_str = "async_string";
const string module_log_str = "log";
const string module_generic_data_inc_abs_str = "generic_data_inc_abs";
/**
* Defines the kind of the module.

View File

@ -80,6 +80,9 @@ Pandora_Module_Exec::Pandora_Module_Exec (string name, string exec, string nativ
} else {
this->output_encoding = "";
}
/*allways change input encoding from UTF-8 to ANSI*/
changeInputEncoding();
}
void
@ -147,9 +150,6 @@ Pandora_Module_Exec::run () {
to find the GNU W32 tools */
working_dir = getPandoraInstallDir () + "util\\";
/*allways change input encoding from UTF-8 to ANSI*/
changeInputEncoding();
/* Create the child process. */
if (! CreateProcess (NULL, (CHAR *) this->module_exec.c_str (), NULL,
NULL, TRUE, CREATE_SUSPENDED | CREATE_NO_WINDOW, NULL,

View File

@ -1288,6 +1288,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
switch (type) {
case TYPE_GENERIC_DATA:
case TYPE_GENERIC_DATA_INC:
case TYPE_GENERIC_DATA_INC_ABS:
case TYPE_GENERIC_PROC:
case TYPE_ASYNC_DATA:
case TYPE_ASYNC_PROC:

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("6.1dev(Build 160922)")
#define PANDORA_VERSION ("7.0dev(Build 170216)")
string pandora_path;
string pandora_dir;

View File

@ -436,6 +436,7 @@ Pandora_Windows_Service::getXmlHeader () {
char timestamp[20];
string agent_name, os_name, os_version, encoding, value, xml, address, parent_agent_name, agent_name_cmd, agent_alias;
string custom_id, url_address, latitude, longitude, altitude, position_description, gis_exec, gis_result, agent_mode;
string group_password, group_id, ehorus_conf;
time_t ctime;
struct tm *ctime_tm = NULL;
int pos;
@ -508,6 +509,20 @@ Pandora_Windows_Service::getXmlHeader () {
xml += "\" url_address=\"";
xml += url_address;
}
// Get group password
group_password = conf->getValue ("group_password");
if (group_password != "") {
xml += "\" group_password=\"";
xml += group_password;
}
// Get Group ID
group_id = conf->getValue ("group_id");
if (group_id != "") {
xml += "\" group_id=\"";
xml += group_id;
}
// Get Coordinates
gis_exec = conf->getValue ("gis_exec");
@ -1630,6 +1645,7 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
string xml_filename, random_integer;
string tmp_filename, tmp_filepath;
string encoding;
string ehorus_conf, eh_key;
static HANDLE mutex = 0;
ULARGE_INTEGER free_bytes;
double min_free_bytes = 0;
@ -1649,6 +1665,12 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
data_xml = getXmlHeader ();
/* Get the eHorus key. */
ehorus_conf = conf->getValue ("ehorus_conf");
if (ehorus_conf != "") {
eh_key = getEHKey(ehorus_conf);
}
/* Write custom fields */
int c = 1;
@ -1658,8 +1680,8 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
sprintf(token_value_token, "custom_field%d_value", c);
string token_name = conf->getValue (token_name_token);
string token_value = conf->getValue (token_value_token);
if(token_name != "" && token_value != "") {
if((token_name != "" && token_value != "") || eh_key != "") {
data_xml += "<custom_fields>\n";
while(token_name != "" && token_value != "") {
data_xml += " <field>\n";
@ -1673,6 +1695,15 @@ Pandora_Windows_Service::sendXml (Pandora_Module_List *modules) {
token_name = conf->getValue (token_name_token);
token_value = conf->getValue (token_value_token);
}
/* Add the eHorus key as a custom field. */
if (eh_key != "") {
data_xml += " <field>\n";
data_xml += " <name>eHorusID</name>\n";
data_xml += " <value><![CDATA["+ eh_key +"]]></value>\n";
data_xml += " </field>\n";
}
data_xml += "</custom_fields>\n";
}
@ -2026,6 +2057,37 @@ Pandora_Windows_Service::getConf () {
return this->conf;
}
string
Pandora_Windows_Service::getEHKey (string ehorus_conf) {
string buffer, eh_key;
std::ifstream ifs(ehorus_conf.c_str());
int pos;
if (! ifs.is_open ()) {
pandoraDebug ("Error opening eHorus configuration file %s", ehorus_conf.c_str ());
return eh_key;
}
/* Look for the eHorus key. */
while (ifs.good ()) {
getline (ifs, buffer);
/* Skip comments. */
if (buffer.empty() || buffer.at(0) == '#') {
continue;
}
pos = buffer.find("eh_key");
if (pos != string::npos){
eh_key = buffer.substr(pos + 7); /* pos + strlen("eh_key ") */
eh_key = trim(eh_key);
return eh_key;
}
}
return eh_key;
}
long
Pandora_Windows_Service::getInterval () {
return this->interval;

View File

@ -115,6 +115,7 @@ namespace Pandora {
int sendXml (Pandora_Module_List *modules);
void sendBufferedXml (string path);
Pandora_Agent_Conf *getConf ();
string getEHKey (string ehorus_conf);
long getInterval ();
long getIntensiveInterval ();
string generateAgentName ();

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 6.1dev-160922
Version: 7.0dev-170216
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -45,6 +45,7 @@ RUN yum install -y \
php-common \
php-zip \
nmap \
net-snmp-utils \
xprobe2
#Clone the repo

View File

@ -55,7 +55,8 @@ function mainAgentsAlerts() {
$updated_info = __('Last update'). " : ". ui_print_timestamp (db_get_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true);
}
else {
$updated_info = __("Updated at realtime");
// $updated_info = __("Updated at realtime");
$updated_info = "";
}
$updated_time = $updated_info;

View File

@ -56,7 +56,8 @@ function mainAgentsModules() {
$updated_info = __('Last update'). " : ". ui_print_timestamp (db_get_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true);
}
else {
$updated_info = __("Updated at realtime");
// $updated_info = __("Updated at realtime");
$updated_info = "";
}
$updated_time = $updated_info;
@ -68,20 +69,34 @@ function mainAgentsModules() {
$offset = (int)get_parameter('offset', 0);
$hor_offset = (int)get_parameter('hor_offset', 0);
$block = $config['block_size'];
$agents_id = (array)get_parameter('id_agents2', -1);
$selection_a_m = (int)get_parameter('selection_agent_module');
$modules_selected = (array)get_parameter('module', 0);
$update_item = (string)get_parameter('edit_item','');
$save_serialize = (int)get_parameter('save_serialize', 0);
$groups = users_get_groups ();
$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: 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: auto;');
$filter_groups .= '</form>';
if($save_serialize && $update_item == ''){
$unserialize_modules_selected = unserialize_in_temp($config['id_user']."_agent_module", true, 1);
$unserialize_agents_id = unserialize_in_temp($config['id_user']."_agents", true, 1);
if($unserialize_modules_selected){
$modules_selected = $unserialize_modules_selected;
}
if($unserialize_agents_id){
$agents_id = $unserialize_agents_id;
}
}
else{
unserialize_in_temp($config['id_user']."_agent_module", true, 1);
unserialize_in_temp($config['id_user']."_agents", true, 1);
}
if($modules_selected[0]){
serialize_in_temp($modules_selected, $config['id_user']."_agent_module", 1);
}
if($agents_id[0] != -1 ){
serialize_in_temp($agents_id, $config['id_user']."_agents", 1);
}
$comborefr = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
$comborefr .= '<b>'.__('Refresh').'</b>';
$comborefr .= html_print_select (
@ -106,7 +121,50 @@ function mainAgentsModules() {
. "</a>";
$config['refr'] = $refr;
}
$groups = users_get_groups ();
//groups
$filter_groups_label = '<b>'.__('Group').'</b>';
$filter_groups = html_print_select_groups(false, "AR", true, 'group_id', $group_id, '', '', '', true, false, true, '', false , 'width: auto;');
//groups module
$filter_module_groups_label = '<b>'.__('Module group').'</b>';
$filter_module_groups = html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
'modulegroup', $modulegroup, '',__('All'), 0, true, false, true, false, 'width: auto;');
$agents_select = array();
if (is_array($id_agents) || is_object($id_agents)){
foreach ($id_agents as $id) {
foreach ($agents as $key => $a) {
if ($key == (int)$id) {
$agents_select[$key] = $key;
}
}
}
}
//agent
$agents = agents_get_group_agents($group_id);
if ((empty($agents)) || $agents == -1) $agents = array();
$filter_agents_label = '<b>'.__('Agents').'</b>';
$filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, "min-width: 180px");
//type show
$selection = array(0 => __('Show common modules'),
1=> __('Show all modules'));
$filter_type_show_label = '<b>'.__('Show common modules').'</b>';
$filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', "", 0, true, false, true, '', false, "min-width: 180px");
//modules
$all_modules = db_get_all_rows_sql("SELECT DISTINCT nombre, id_agente_modulo FROM tagente_modulo WHERE id_agente IN (" . implode(',', array_keys($agents)) . ")");
$filter_modules_label = '<b>'.__('Module').'</b>';
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', __('None'), 0, true, true, true, '', false, "min-width: 180px");
//update
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
$onheader = array('updated_time' => $updated_time, 'fullscreen' => $fullscreen,
'combo_module_groups' => $filter_module_groups,
'combo_groups' => $filter_groups);
@ -120,38 +178,77 @@ function mainAgentsModules() {
// 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 '<table 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>";
if ($config['pure'] == 1){
echo "<td>" . $comborefr . "</td>";
echo "<td>" . $fullscreen['text'] . "</td>";
}
else{
echo "<td> <span style='float: right;'>" . $fullscreen['text'] . "</span> </td>";
}
echo "</tr>";
echo "</table>";
$agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents);
$filter_module_group = array('disabled' => 0);
if ($modulegroup > 0) {
$filter_module_group['id_module_group'] = $modulegroup;
if($config['pure'] != 1){
echo '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo "<tr>";
echo "<td>" . $filter_groups_label . "</td>";
echo "<td>" . $filter_groups . "</td>";
echo "<td></td>";
echo "<td></td>";
echo "<td>" . $filter_module_groups_label . "</td>";
echo "<td>" . $filter_module_groups . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>" . $filter_agents_label . "</td>";
echo "<td>" . $filter_agents . "</td>";
echo "<td>" . $filter_type_show_label . "</td>";
echo "<td>" . $filter_type_show . "</td>";
echo "<td>" . $filter_modules_label . "</td>";
echo "<td>" . $filter_modules . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>" . $filter_update . "</sapn></td>";
echo "</tr>";
echo "</table>";
echo '</form>';
}
$count = 0;
foreach ($agents as $agent) {
$module = agents_get_modules($agent, false,
$filter_module_group, true, false);
if ($module == false) {
unset($agents[$count]);
if($agents_id[0] != -1){
$agents = $agents_id;
$all_modules = array();
$total_pagination = count($agents);
foreach ($modules_selected as $key => $value) {
$all_modules[$value] = io_safe_output(modules_get_agentmodule_name($value));
}
$count++;
}
$total_pagination = count($agents);
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false);
else {
$agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents);
$filter_module_group = array('disabled' => 0);
if ($modulegroup > 0) {
$filter_module_group['id_module_group'] = $modulegroup;
}
$count = 0;
foreach ($agents as $agent) {
$module = agents_get_modules($agent, false,
$filter_module_group, true, false);
if ($module == false) {
unset($agents[$count]);
}
$count++;
}
$total_pagination = count($agents);
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false);
}
$modules_by_name = array();
$name = '';
$cont = 0;
@ -172,9 +269,15 @@ function mainAgentsModules() {
$block = count($modules_by_name);
}
$filter_groups = array ('offset' => (int) $offset,
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents);
if($update_item == ''){
$filter_groups = array ('offset' => (int) $offset,
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents);
}
else{
$filter_groups = array ('offset' => 0,
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents);
}
if ($group_id > 0) {
$filter_groups['id_grupo'] = $group_id;
}
@ -203,10 +306,11 @@ function mainAgentsModules() {
"sec=extensions&" .
"sec2=extensions/agents_modules&" .
"refr=0&" .
"save_serialize=1&" .
"selection_a_m=" . $selection_a_m . "&" .
"hor_offset=" . $new_hor_offset . "&" .
"offset=" . $offset . "&" .
"group_id=" . $group_id . "&" .
"modulegroup=" . $modulegroup . "'>" .
"offset=" . $offset .
"'>" .
html_print_image("images/arrow_left.png", true,
array('title' => __('Previous modules'))) .
"</a>" .
@ -240,10 +344,11 @@ function mainAgentsModules() {
"extension_in_menu=estado&" .
"sec=extensions&".
"sec2=extensions/agents_modules&".
"save_serialize=1&" .
"selection_a_m=" . $selection_a_m . "&" .
"hor_offset=" . $new_hor_offset . "&".
"offset=" . $offset . "&" .
"group_id=" . $group_id . "&" .
"modulegroup=" . $modulegroup . "'>" .
"offset=" . $offset .
"'>" .
html_print_image(
"images/arrow.png", true,
array('title' => __('More modules'))) .
@ -258,7 +363,8 @@ function mainAgentsModules() {
$filter_agents['id_grupo'] = $group_id;
}
// Prepare pagination
ui_pagination ($total_pagination);
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&' . "hor_offset=" . $hor_offset ."&selection_a_m=" . $selection_a_m;
ui_pagination ($total_pagination, $url);
foreach ($agents as $agent) {
// Get stats for this group
@ -410,3 +516,108 @@ extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agent
extensions_add_main_function('mainAgentsModules');
?>
<script type="text/javascript">
$(document).ready (function () {
$("#group_id").change (function () {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_agents_group_json" : 1,
"id_group" : this.value,
"privilege" : "AW",
"keys_prefix" : "_"
},
function (data, status) {
$("#id_agents2").html('');
$("#module").html('');
jQuery.each (data, function (id, value) {
// Remove keys_prefix from the index
id = id.substring(1);
option = $("<option></option>")
.attr ("value", value["id_agente"])
.html (value["nombre"]);
$("#id_agents").append (option);
$("#id_agents2").append (option);
});
},
"json"
);
});
$("#modulegroup").change (function () {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_modules_group_json" : 1,
"id_module_group" : this.value,
"id_agents" : $("#id_agents2").val(),
"selection" : $("#selection_agent_module").val()
},
function (data, status) {
$("#module").html('');
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
});
$("#id_agents2").change (function(){
selection_agent_module();
});
$("#selection_agent_module").change(function() {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_modules_group_json" : 1,
"id_module_group" : $("#modulegroup").val(),
"id_agents" : $("#id_agents2").val(),
"selection" : $("#selection_agent_module").val()
},
function (data, status) {
$("#module").html('');
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
});
selection_agent_module();
});
function selection_agent_module() {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_modules_group_json" : 1,
"id_module_group" : $("#modulegroup").val(),
"id_agents" : $("#id_agents2").val(),
"selection" : $("#selection_agent_module").val()
},
function (data, status) {
$("#module").html('');
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
}
</script>

View File

@ -181,7 +181,7 @@ function mainModuleGroups() {
$table = null;
$table->headstyle[] = "width: 20%";
foreach ($modelGroups as $i => $n) {
$table->headstyle[] = "width: 7%";
$table->headstyle[] = "min-width: 60px;max-width: 5%;text-align:center;";
$modelGroups[$i] = ui_print_truncate_text($n, GENERIC_SIZE_TEXT, true, true, true, '&hellip;', 'color:#FFF');
}
@ -278,9 +278,9 @@ function mainModuleGroups() {
array_push($row,
'<div
style="background: ' . $color . ';
height: 25px;
height: 20px;min-width: 60px;max-width:5%;overflow:hidden;
margin-left: auto; margin-right: auto;
text-align: center; padding-top: 0px; font-size: 18px;">
text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;">
' . $alinkStart . $count . $alinkEnd . '</div>');
}
array_push($tableData,$row);

View File

@ -256,7 +256,7 @@ function main_net_tools () {
function godmode_net_tools() {
global $config;
check_config ();
check_login();
if (! check_acl ($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation",
@ -292,7 +292,8 @@ function godmode_net_tools() {
else {
if (isset($config['network_tools_config'])) {
$network_tools_config = json_decode($config['network_tools_config'], true);
$network_tools_config_output = io_safe_output($config['network_tools_config']);
$network_tools_config = json_decode($network_tools_config_output, true);
$traceroute_path = $network_tools_config['traceroute_path'];
$ping_path = $network_tools_config['ping_path'];
$nmap_path = $network_tools_config['nmap_path'];

View File

@ -325,6 +325,10 @@ function pluginreg_extension_main () {
'unit' => io_safe_input ($unit),
'max_timeout' => isset($ini_array[$label]["max_timeout"]) ? $ini_array[$label]["max_timeout"] : '',
'history_data' => isset($ini_array[$label]["history_data"]) ? $ini_array[$label]["history_data"] : '',
'dynamic_interval' => isset($ini_array[$label]["dynamic_interval"]) ? $ini_array[$label]["dynamic_interval"] : '',
'dynamic_min' => isset($ini_array[$label]["dynamic_min"]) ? $ini_array[$label]["dynamic_min"] : '',
'dynamic_max' => isset($ini_array[$label]["dynamic_max"]) ? $ini_array[$label]["dynamic_max"] : '',
'dynamic_two_tailed' => isset($ini_array[$label]["dynamic_two_tailed"]) ? $ini_array[$label]["dynamic_two_tailed"] : '',
'min_warning' => isset($ini_array[$label]["min_warning"]) ? $ini_array[$label]["min_warning"] : '',
'max_warning' => isset($ini_array[$label]["max_warning"]) ? $ini_array[$label]["max_warning"] : '',
'str_warning' => isset($ini_array[$label]["str_warning"]) ? $ini_array[$label]["str_warning"] : '',

View File

@ -68,8 +68,10 @@ function output_xml_resource($hook_enterprise) {
output_xml_visual_console($id);
break;
default:
if ($hook_enterprise === true)
return enterprise_output_xml_resource($type, $id);
if ($hook_enterprise === true) {
$include_agents = get_parameter('include_agents', 0);
return enterprise_output_xml_resource($type, $id, $include_agents);
}
break;
}
}
@ -332,7 +334,7 @@ function resource_exportation_extension_main() {
}
$hook_enterprise = enterprise_include ('extensions/resource_exportation/functions.php');
ui_print_page_header (__('Resource exportation'), "images/extensions.png", false, "", true, "" );
echo "<div class=notify>";
@ -364,8 +366,16 @@ function resource_exportation_extension_main() {
function export_to_ptr(type) {
id = $("select#" + type + " option:selected").val();
url = location.href.split('index');
url = url[0] + 'extensions/resource_exportation.php?get_ptr=1&type=' + type
+ '&id=' + id;
if (type == "policy") {
var include_agents = $("#checkbox-export_agents").prop("checked")
url = url[0] + 'extensions/resource_exportation.php?get_ptr=1&type=' + type
+ '&id=' + id + '&include_agents=' + include_agents;
}
else {
url = url[0] + 'extensions/resource_exportation.php?get_ptr=1&type=' + type
+ '&id=' + id;
}
location.href=url;
}

View File

@ -608,6 +608,10 @@ function process_upload_xml_component($xml) {
$max_timeout = (int)$componentElement->max_timeout;
$max_retries = (int)$componentElement->max_retries;
$historical_data = (int)$componentElement->historical_data;
$dynamic_interval = (int)$componentElement->dynamic_interval;
$dynamic_min = (int)$componentElement->dynamic_min;
$dynamic_max = (int)$componentElement->dynamic_max;
$dynamic_two_tailed = (int)$componentElement->dynamic_two_tailed;
$min_war = (float)$componentElement->min_war;
$max_war = (float)$componentElement->max_war;
$str_war = (string)$componentElement->str_war;
@ -680,6 +684,10 @@ function process_upload_xml_component($xml) {
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,
'history_data' => $historical_data,
'dynamic_interval' => $dynamic_interval,
'dynamic_min' => $dynamic_min,
'dynamic_max' => $dynamic_max,
'dynamic_two_tailed' => $dynamic_two_tailed,
'min_warning' => $min_war,
'max_warning' => $max_war,
'str_warning' => $str_war,
@ -716,6 +724,10 @@ function process_upload_xml_component($xml) {
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,
'history_data' => $historical_data,
'dynamic_interval' => $dynamic_interval,
'dynamic_min' => $dynamic_min,
'dynamic_max' => $dynamic_max,
'dynamic_two_tailed' => $dynamic_two_tailed,
'min_warning' => $min_war,
'max_warning' => $max_war,
'str_warning' => $str_war,
@ -754,6 +766,10 @@ function process_upload_xml_component($xml) {
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,
'history_data' => $historical_data,
'dynamic_interval' => $dynamic_interval,
'dynamic_min' => $dynamic_min,
'dynamic_max' => $dynamic_max,
'dynamic_two_tailed' => $dynamic_two_tailed,
'min_warning' => $min_war,
'max_warning' => $max_war,
'str_warning' => $str_war,

4
pandora_console/extras/mr/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignorar todo en este directorio
*
# Excepto este archivo
!.gitignore

View File

@ -1,19 +1,107 @@
-- ---------------------------------------------------------------------
-- Table `titem`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `titem` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`id_map` int(10) unsigned NOT NULL default 0,
`x` INTEGER NOT NULL default 0,
`y` INTEGER NOT NULL default 0,
`z` INTEGER NOT NULL default 0,
`deleted` INTEGER(1) unsigned NOT NULL default 0,
`type` INTEGER UNSIGNED NOT NULL default 0,
`refresh` INTEGER UNSIGNED NOT NULL default 0,
`source` INTEGER UNSIGNED NOT NULL default 0,
`source_data` varchar(250) default '',
`options` TEXT,
`style` TEXT,
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tmap`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tmap` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`id_group` int(10) unsigned NOT NULL default 0,
`id_user` varchar(250) NOT NULL default '',
`type` int(10) unsigned NOT NULL default 0,
`subtype` int(10) unsigned NOT NULL default 0,
`name` varchar(250) default '',
`description` TEXT,
`height` INTEGER UNSIGNED NOT NULL default 0,
`width` INTEGER UNSIGNED NOT NULL default 0,
`center_x` INTEGER NOT NULL default 0,
`center_y` INTEGER NOT NULL default 0,
`background` varchar(250) default '',
`background_options` INTEGER UNSIGNED NOT NULL default 0,
`source_period` INTEGER UNSIGNED NOT NULL default 0,
`source` INTEGER UNSIGNED NOT NULL default 0,
`source_data` varchar(250) default '',
`generation_method` INTEGER UNSIGNED NOT NULL default 0,
`generated` INTEGER UNSIGNED NOT NULL default 0,
`filter` TEXT,
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `trel_item`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `trel_item` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`id_parent` int(10) unsigned NOT NULL default 0,
`id_child` int(10) unsigned NOT NULL default 0,
`id_map` int(10) unsigned NOT NULL default 0,
`id_parent_source_data` int(10) unsigned NOT NULL default 0,
`id_child_source_data` int(10) unsigned NOT NULL default 0,
`parent_type` int(10) unsigned NOT NULL default 0,
`child_type` int(10) unsigned NOT NULL default 0,
`id_item` int(10) unsigned NOT NULL default 0,
`deleted` int(1) unsigned NOT NULL default 0,
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `talert_templates`
-- ---------------------------------------------------------------------
ALTER TABLE talert_templates ADD COLUMN `min_alerts_reset_counter` tinyint(1) DEFAULT 0;
ALTER TABLE talert_templates ADD COLUMN `field11` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field12` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field13` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field14` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field15` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field11_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_snmp`
-- ---------------------------------------------------------------------
ALTER TABLE talert_snmp ADD COLUMN `al_field11` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_snmp_action`
-- ---------------------------------------------------------------------
ALTER TABLE talert_snmp_action ADD COLUMN `al_field11` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT "";
-- ----------------------------------------------------------------------
-- Table `tserver`
-- ----------------------------------------------------------------------
ALTER TABLE tserver ADD COLUMN `server_keepalive` int(11) DEFAULT 0;
-- ----------------------------------------------------------------------
-- Table `tagente_estado`
-- ----------------------------------------------------------------------
ALTER TABLE tagente_estado MODIFY `status_changes` tinyint(4) unsigned default 0;
ALTER TABLE tagente_estado CHANGE `last_known_status` `known_status` tinyint(4) default 0;
ALTER TABLE tagente_estado ADD COLUMN `last_known_status` tinyint(4) default 0;
@ -29,18 +117,47 @@ UPDATE talert_actions SET `field4` = 'integria',
`field9` = 'admin',
`field10` = '_alert_description_'
WHERE `id` = 4 AND `id_alert_command` = 11;
ALTER TABLE talert_actions ADD COLUMN `field11` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field12` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field13` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field14` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field15` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field11_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_commands`
-- ---------------------------------------------------------------------
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria&#x20;IMS&#x20;API&#x20;path\",\"Integria&#x20;IMS&#x20;API&#x20;pass\",\"Integria&#x20;IMS&#x20;user\",\"Integria&#x20;IMS&#x20;user&#x20;pass\",\"Ticket&#x20;title\",\"Ticket&#x20;group&#x20;ID\",\"Ticket&#x20;priority\",\"Email&#x20;copy\",\"Ticket&#x20;owner\",\"Ticket&#x20;description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very&#x20;Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria&#x20;IMS&#x20;Ticket';
-- ---------------------------------------------------------------------
-- Table `tmap`
-- ---------------------------------------------------------------------
ALTER TABLE tmap MODIFY `id_user` varchar(128);
-- ---------------------------------------------------------------------
-- Table `titem`
-- ---------------------------------------------------------------------
ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
-- ---------------------------------------------------------------------
-- Table `trel_item`
-- ---------------------------------------------------------------------
ALTER TABLE trel_item ADD `id_parent_source_data` int(11) NOT NULL DEFAULT 0;
ALTER TABLE trel_item ADD `id_child_source_data` int(11) NOT NULL DEFAULT 0;
ALTER TABLE trel_item ADD `id_map` int(11) NOT NULL DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tconfig`
-- ---------------------------------------------------------------------
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 0);
UPDATE tconfig SET value = 'https://firefly.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
-- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents`
@ -69,9 +186,69 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
ALTER TABLE tusuario ADD (`id_filter` int(10) unsigned NULL default NULL);
ALTER TABLE tusuario ADD CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL;
-- ---------------------------------------------------------------------
-- Table `tagente_datos`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_datos MODIFY `datos` double(22,5);
-- ---------------------------------------------------------------------
-- Table `tagente_datos_inc`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_datos_inc MODIFY `datos` double(22,5);
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_interval` int(4) unsigned default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_max` int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tagente`
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
ALTER TABLE tagente ADD `transactional_agent` tinyint(1) NOT NULL default 0;
ALTER TABLE tagente ADD `remote` tinyint(1) NOT NULL default 0;
ALTER TABLE tagente ADD `cascade_protection_module` int(10) unsigned default '0';
ALTER TABLE tagente ADD COLUMN (alias varchar(600) not null default '');
UPDATE tagente SET tagente.alias = tagente.nombre;
UPDATE tagente SET tagente.alias = tagente.nombre;
-- ---------------------------------------------------------------------
-- Table `tlayout`
-- ---------------------------------------------------------------------
ALTER TABLE tlayout ADD `background_color` varchar(50) NOT NULL default '#FFF';
-- ---------------------------------------------------------------------
-- Table `tlayout_data`
-- ---------------------------------------------------------------------
ALTER TABLE tlayout_data ADD `type_graph` varchar(50) NOT NULL default 'area';
ALTER TABLE tlayout_data ADD `label_position` varchar(50) NOT NULL default 'down';
-- ---------------------------------------------------------------------
-- Table `tagent_custom_fields`
-- ---------------------------------------------------------------------
INSERT INTO `tagent_custom_fields` (`name`) VALUES ('eHorusID');
-- ---------------------------------------------------------------------
-- Table `tagente_modulo` Fixed problems with blank space
-- in cron interval and problems with process data from pandora server
-- ---------------------------------------------------------------------
UPDATE tagente_modulo SET cron_interval = '' WHERE cron_interval LIKE '% %';
-- ---------------------------------------------------------------------
-- Table `tgraph`
-- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN `percentil` int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN `router_ip` TEXT NOT NULL DEFAULT "";

View File

@ -3,6 +3,34 @@
-- ---------------------------------------------------------------------
ALTER TABLE talert_templates ADD COLUMN min_alerts_reset_counter NUMBER(5, 0) DEFAULT 0;
ALTER TABLE talert_templates ADD COLUMN field11 CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field12 CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field13 CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field14 CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field15 CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field11_recovery CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field12_recovery CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field13_recovery CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field14_recovery CLOB DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field15_recovery CLOB DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_snmp`
-- ---------------------------------------------------------------------
ALTER TABLE talert_snmp ADD COLUMN al_field11 CLOB DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field12 CLOB DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field13 CLOB DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field14 CLOB DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field15 CLOB DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_snmp_action`
-- ---------------------------------------------------------------------
ALTER TABLE talert_snmp_action ADD COLUMN al_field11 CLOB DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field12 CLOB DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field13 CLOB DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field14 CLOB DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field15 CLOB DEFAULT "";
-- ----------------------------------------------------------------------
-- Table `tserver`
@ -28,6 +56,16 @@ UPDATE talert_actions SET field4 = 'integria',
field9 = 'admin',
field10 = '_alert_description_'
WHERE id = 4 AND id_alert_command = 11;
ALTER TABLE talert_actions ADD COLUMN field11 CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field12 CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field13 CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field14 CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field15 CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field11_recovery CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field12_recovery CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field13_recovery CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field14_recovery CLOB DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field15_recovery CLOB DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_commands`
@ -41,6 +79,8 @@ UPDATE talert_commands SET fields_descriptions = '[\"Integria&#x20;IMS&#x20;API&
INSERT INTO tconfig (token, value) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO tconfig (token, value) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO tconfig (token, value) VALUES ('days_autodisable_deletion', '30');
INSERT INTO tconfig (token, value) VALUES ('MR', 0);
UPDATE tconfig SET value = 'https://firefly.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
-- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents`
@ -68,9 +108,56 @@ ALTER TABLE tevent_filter ADD COLUMN date_to date DEFAULT NULL;
ALTER TABLE tusuario ADD (id_filter int(10) unsigned NULL default NULL);
ALTER TABLE tusuario ADD CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_modulo ADD COLUMN dynamic_interval int(4) unsigned default '0';
ALTER TABLE tagente_modulo ADD COLUMN dynamic_max bigint(20) default '0';
ALTER TABLE tagente_modulo ADD COLUMN dynamic_min bigint(20) default '0';
ALTER TABLE tagente_modulo ADD COLUMN dynamic_next bigint(20) NOT NULL default '0';
ALTER TABLE tagente_modulo ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default '0';
ALTER TABLE tagente_modulo ADD COLUMN parent_module_id NUMBER(10, 0);
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
ALTER TABLE tnetwork_component ADD COLUMN dynamic_interval int(4) unsigned default '0';
ALTER TABLE tnetwork_component ADD COLUMN dynamic_max int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN dynamic_min int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN dynamic_next bigint(20) NOT NULL default '0';
ALTER TABLE tnetwork_component ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tagente`
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
ALTER TABLE tagente ADD transactional_agent tinyint(1) NOT NULL default 0;
ALTER TABLE tagente ADD remoteto tinyint(1) NOT NULL default 0;
ALTER TABLE tagente ADD cascade_protection_module int(10) unsigned default '0';
ALTER TABLE tagente ADD COLUMN (alias VARCHAR2(600) not null DEFAULT '');
UPDATE `tagente` SET tagente.alias = tagente.nombre;
UPDATE `tagente` SET tagente.alias = tagente.nombre;
-- ---------------------------------------------------------------------
-- Table `tlayout`
-- ---------------------------------------------------------------------
ALTER TABLE tlayout ADD COLUMN background_color varchar(50) NOT NULL default '#FFF';
-- ---------------------------------------------------------------------
-- Table `tlayout_data`
-- ---------------------------------------------------------------------
ALTER TABLE tlayout_data ADD COLUMN type_graph varchar(50) NOT NULL default 'area';
ALTER TABLE tlayout_data ADD COLUMN label_position varchar(50) NOT NULL default 'down';
-- ---------------------------------------------------------------------
-- Table `tagent_custom_fields`
-- ---------------------------------------------------------------------
INSERT INTO tagent_custom_fields (name) VALUES ('eHorusID');
-- ---------------------------------------------------------------------
-- Table `tgraph`
-- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN percentil int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN router_ip CLOB DEFAULT "";

View File

@ -4,3 +4,90 @@
ALTER TABLE tagente_estado RENAME COLUMN last_known_status TO known_status;
ALTER TABLE tagente_estado ADD COLUMN last_known_status NUMBER(10, 0) DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_modulo ADD COLUMN dynamic_interval int(4) unsigned default 0;
ALTER TABLE tagente_modulo ADD COLUMN dynamic_max bigint(20) default 0;
ALTER TABLE tagente_modulo ADD COLUMN dynamic_min bigint(20) default 0;
ALTER TABLE tagente_modulo ADD COLUMN dynamic_next bigint(20) NOT NULL default 0;
ALTER TABLE tagente_modulo ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default 0;
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
ALTER TABLE tnetwork_component ADD COLUMN dynamic_interval int(4) unsigned default 0;
ALTER TABLE tnetwork_component ADD COLUMN dynamic_max int(4) default 0;
ALTER TABLE tnetwork_component ADD COLUMN dynamic_min int(4) default 0;
ALTER TABLE tnetwork_component ADD COLUMN dynamic_next bigint(20) NOT NULL default 0;
ALTER TABLE tnetwork_component ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default 0;
-- ---------------------------------------------------------------------
-- Table `tagente`
-- ---------------------------------------------------------------------
ALTER TABLE tagente ADD transactional_agent tinyint(1) NOT NULL default 0;
ALTER TABLE tagente ADD remote tinyint(1) NOT NULL default 0;
ALTER TABLE tagente ADD cascade_protection_module int(10) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tlayout`
-- ---------------------------------------------------------------------
ALTER TABLE tlayout ADD COLUMN background_color varchar(50) NOT NULL default '#FFF';
-- ---------------------------------------------------------------------
-- Table `tlayout_data`
-- ---------------------------------------------------------------------
ALTER TABLE tlayout_data ADD COLUMN type_graph varchar(50) NOT NULL default 'area';
ALTER TABLE tlayout_data ADD COLUMN label_position varchar(50) NOT NULL default 'down';
-- ---------------------------------------------------------------------
-- Table `talert_templates`
-- ---------------------------------------------------------------------
ALTER TABLE talert_templates ADD COLUMN field11 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field12 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field13 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field14 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field15 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field11_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field12_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field13_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field14_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN field15_recovery TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_snmp`
-- ---------------------------------------------------------------------
ALTER TABLE talert_snmp ADD COLUMN al_field11 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field12 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field13 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field14 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp ADD COLUMN al_field15 TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_snmp_action`
-- ---------------------------------------------------------------------
ALTER TABLE talert_snmp_action ADD COLUMN al_field11 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field12 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field13 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field14 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN al_field15 TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `talert_actions`
-- ---------------------------------------------------------------------
ALTER TABLE talert_actions ADD COLUMN field11 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field12 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field13 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field14 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field15 TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field11_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field12_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field13_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field14_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field15_recovery TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN router_ip TEXT NOT NULL DEFAULT "";

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,39 +1,207 @@
<?php
/* Hello there! :)
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
*/
if(check_login()){
if(!enterprise_installed()){
$open=true;
}
$tipo = $_GET['message'];
echo "<div class='info_box' style='padding-top:20px;padding-bottom:20px;'><span style='padding:20px;'>";
echo "
<div class='modalheader'>
<span class='modalheadertext'>";
if($tipo=='noaccess'){
echo "You don't have access to this page";
}
elseif(!enterprise_installed()){
echo "Community version";
}
else{
echo "Enterprise version";
}
echo "</span>
<img class='modalclosex cerrar' src='".$config['homeurl']."images/icono_cerrar.png'>
</div>
<div class='modalcontent'>
<img class='modalcontentimg' src='".$config['homeurl']."images/";
switch ($tipo) {
case "module":
echo __("The community version have not the ability to define your own library of local modules, or distribute it to remote agents. You need to do that changes individually on each agent, but it's possible by using external tools and space time and effort. Nor can distribute local plugins, and nor does it have access to the library of plugins enterprise to monitor applications such as Informix, Oracle, DB2, SQL Server, Exchange, WebSphere, Oracle Exadata, F5, JBoss, HyperV, VMWare, RHEV, to name a few. With the Enterprise version will have all this, and the ability to distribute and manage their own local modules to your systems, individually or through policies.");
case "infomodal":
echo "icono_info.png";
break;
case "massive":
echo __("You want to manage your monitoring homogeneously? Do you have many systems and is difficult to manage in a comprehensive manner? Would you like to deploy monitoring, alerts and even local plugins with a single click? Pandora FMS Enterprise Policies are exactly what you need, you'll save time, effort and dislikes. More information (link to pandorafms.com)");
case "helpmodal":
echo "icono_info.png";
break;
case "modulemodal":
echo "icono_popup.png";
break;
case "massivemodal":
echo "icono_popup.png";
break;
case "events":
echo __("Pandora FMS Enterprise has event correlation. Through correlation you can generate alerts and / or new events based on logical rules on your realtime events. This allows you to automate the troubleshooting. If you know the value of working with events, the correlation will take you to a new level.");
case "eventsmodal":
echo "icono_popup.png";
break;
case "reporting":
echo __("The reports of the Enterprise version are more powerful: it has wizards, you can schedule sending via email in PDF, and it has a template system to create reports quickly for each of your customers. It will even allow your customers generate their own reports from templates created by you. If reports are key to your business, Pandora FMS Enterprise version can be very useful for you.");
case "reportingmodal":
echo "icono_popup.png";
break;
case "visualmodal":
echo "icono_popup.png";
break;
case "updatemodal":
echo "icono_info.png";
break;
case "agentsmodal":
echo "icono_info.png";
break;
case "monitorcheckmodal":
echo "icono_info.png";
break;
case "remotemodulesmodal":
echo "icono_info.png";
break;
case "monitoreventsmodal":
echo "icono_info.png";
break;
case "alertagentmodal":
echo "icono_info.png";
break;
case "noaccess":
echo "access_denied.png";
break;
default:
break;
}
echo "</span></div>";
echo "'>
<div class='modalcontenttext'>";
echo "<button id='cerrar' onclick='ocultar();'>OK</button>";
switch ($tipo) {
case "helpmodal":
echo __("This is the online help for Pandora FMS console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use Pandora FMS. Official documentation of Pandora FMS is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.<br><br>
<a href='https://pandorafms.org/en/docs/monitoring-documentation/' target='_blanck'>Download the official documentation</a>");
break;
case "noaccess":
echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br/> <br/>
Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
break;
case "infomodal":
if($open){
echo
'<p>' .
__('The Update Manager client is included on Pandora FMS. It helps system administrators update their Pandora FMS automatically, since the Update Manager retrieves new modules, new plugins and new features (even full migrations tools for future versions) automatically.') .
'</p>' .
'<p>' .
__('<b>OpenSource version updates are automated packages generated each week. These updates come WITHOUT ANY warranty or support. If your system is corrupted or a feature stops working properly, you will need to recover a backup by yourself.</b>') .
'</p>' .
'<p>' .
__('The Enterprise version comes with a different update system, with fully tested, professionally-supported packages, and our support team is there to help you in case of problems or queries. Update Manager is another feature present in the Enterprise version and not included in the OpenSource version. There are lots of advanced business-oriented features contained in Pandora FMS Enterprise Edition. For more information visit <a href="http://pandorafms.com">pandorafms.com</a>') .
'</p>'
;
}else{
echo
'<p>' .
__('The new <a href="http://updatemanager.sourceforge.net">Update Manager</a> client is shipped with Pandora FMS It helps system administrators to update their Pandora FMS automatically, since the Update Manager does the task of getting new modules, new plugins and new features (even full migrations tools for future versions) automatically.') .
'</p>' .
'<p>' .
__('Update Manager is one of the most advanced features of Pandora FMS Enterprise version, for more information visit <a href="http://pandorafms.com">http://pandorafms.com</a>.') .
'</p>' .
'<p>' .
__('Update Manager sends anonymous information about Pandora FMS usage (number of agents and modules running). To disable it, please remove the remote server address from the Update Manager plugin setup.') .
'</p>'
;
}
break;
case "modulemodal":
echo __("The community version doesn't have the ability to define your own library of local modules, or distribute it to remote agents. You need to make those changes individually on each agent which is possible by using external tools and time and effort. Nor can it distribute local plugins, or have access to the library of enterprise plugins to monitor applications such as VMWare, RHEV or Informix between others. The Enterprise version will have all this, plus the ability to distribute and manage your own local modules on your systems, individually or through policies.
<br><br><img style='width:105px' src='".$config['homeurl']."images/logo_oracle.png'><img style='width:105px' src='".$config['homeurl']."images/logo_citrix.png'><img style='width:105px' src='".$config['homeurl']."images/logo_sap.png'><img style='width:105px' src='".$config['homeurl']."images/logo_exchange.png'><br><br><span style='font-style:italic;'>* Todos los logotipos pertenecen a marcas registradas</span>");
break;
case "massivemodal":
echo __("Do you want to consolidate all your system monitoring? Do you have many systems, making it difficult to manage them in a comprehensive manner? Would you like to deploy monitoring, alerts and even local plugins with a single click? Pandora FMS Enterprise Policies are exactly what you need; you'll save time, effort and annoyances. More information <a href='pandorafms.com'>pandorafms.com</a>");
break;
case "eventsmodal":
echo __("Pandora FMS Enterprise also features event correlation. Through correlation you can generate realtime alerts and / or new events based on logical rules. This allows you to automate troubleshooting. If you know the value of working with events, event correlation will take you to a new level.");
break;
case "reportingmodal":
echo __("Report generating on the Enterprise version is also more powerful: it has wizards, you can schedule emails in PDF to be sent according to the schedule you decide, and it has a template system to create personalized reports quickly for each of your customers. It will even allow your customers to generate their own reports from templates created by you. If reports are key to your business, Pandora FMS Enterprise version is for you.");
break;
case "visualmodal":
echo __("These options are only effective on the Enterprise version.");
break;
case "updatemodal":
echo __("WARNING: You are just one click away from an automated update. This may result in a damaged system, including loss of data and operativity. Check you have a recent backup. OpenSource updates are automatically created packages, and there is no WARRANTY or SUPPORT. If you need professional support and warranty, please upgrade to Enterprise Version.");
break;
case "agentsmodal":
echo __("This system is heavily loaded. OpenSource version could get a lot more agents but fine tuning requires knowledge and time. Checkout the Enterprise Version for a professional supported system.");
break;
case "monitorcheckmodal":
echo __("This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 40 modules per agent. This configuration has B/A modules per agent. Checkout the Enterprise Version for a professional supported system.");
break;
case "remotemodulesmodal":
echo __("Too much remote modules has been detected on this system. OpenSource version could manage thousands of modules, but performance is limited on high amount of SNMP or ICMP request. Checkout the Enterprise Version for a professional supported system with improved capacity on network monitoring, including distributed servers.");
break;
case "monitoreventsmodal":
echo __("This system has too much events in the database. Checkout database purge options. Checkout the Enterprise Version for a professional supported system.");
break;
case "alertagentmodal":
echo __("You have defined a high number of alerts, this may cause you performance problems in the future. In the Enterprise version, you can use event correlation alerts to simplify the alerting system and have easier administration and increased performance.");
break;
default:
break;
}
echo "
</div>
<div style='float:right;width:100%;height:30px;'>
</div>
<div class='modalokbutton cerrar'>
<span class='modalokbuttontext'>OK</span>
</div>";
if($open){
echo "<div class='modalgobutton gopandora'>
<span class='modalokbuttontext'>About Enterprise</span>
</div>";
}
}
?>
<script>
function ocultar(){
$("#alert_messages" ).dialog('close');
$(".cerrar").click(function(){
$("#alert_messages").hide();
$( "#opacidad" ).remove();
});
}
$(".gopandora").click(function(){
window.open('https://pandorafms.com/es/software-de-monitorizacion-pandorafms/','_blank');
});
</script>

View File

@ -0,0 +1,36 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
check_login ();
ui_require_css_file ('firts_task');
?>
<?php ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no transactions defined yet.') ) ); ?>
<div class="new_task">
<div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_topology.png', true, array("title" => __('Transactions')));?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Transactions'); ?></h3>
<p id="description_task"> <?php echo __("The new transactional server allows you to execute tasks dependent on the others following a user-defined design. This means that it is possible to coordinate several executions to check a target at a given time.
Transaction graphs represent the different processes within our infrastructure that we use to deliver our service."); ?></p>
<form action="index.php?sec=network&sec2=enterprise/operation/agentes/manage_transmap_creation&create_transaction=1" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Transactions'); ?>" />
</form>
</div>
</div>

View File

@ -26,8 +26,14 @@ if (! file_exists ($config["homedir"] . $license_file)) {
$license_file = 'general/license/pandora_info_en.html';
}
if (!$config["MR"]) {
$config["MR"] = 0;
}
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">';
echo sprintf(__('Pandora FMS %s - Build %s', $pandora_version, $build_version));
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_version, $config["MR"]));
echo '</a><br />';
echo '<a class="white footer">'. __('Page generated at') . ' '. ui_print_timestamp ($time, true, array ("prominent" => "timestamp")); //Always use timestamp here
echo '</a>';

View File

@ -32,6 +32,7 @@ config_check();
if (!defined ('PANDORA_ENTERPRISE')) {
$logo_title = 'Pandora FMS Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
}
else {
if (file_exists(ENTERPRISE_DIR . '/' . $custom_logo)) {
@ -64,7 +65,7 @@ config_check();
$table->style[8] =
$table->style[9] =
$table->style['qr'] =
'width: 22px; text-align:center; height: 22px; padding-right: 9px;';
'width: 22px; text-align:center; height: 22px; padding-right: 9px;padding-left: 9px;';
$table->style[7] = 'width: 20px; padding-right: 9px;';
$table->style['searchbar'] = 'width: 180px; min-width: 180px;';
$table->style[11] = 'padding-left: 10px; padding-right: 5px;width: 16px;';
@ -125,16 +126,18 @@ config_check();
$servers_link_open = '<a class="white" href="index.php?sec=gservers&amp;sec2=godmode/servers/modificar_server&amp;refr=60">';
$servers_link_close = '</a>';
$show_qr_code_header = 'display: none;';
if (isset($config['show_qr_code_header']))
if ($config['show_qr_code_header'])
$show_qr_code_header = '';
if ($config['show_qr_code_header'] == 0){
$show_qr_code_header = 'display: none;';
}
else {
$show_qr_code_header = 'display: inline;';
}
$table->data[0]['qr'] =
'<div style="' . $show_qr_code_header . '" id="qr_code_container" style="">' .
'<a href="javascript: show_dialog_qrcode();">' .
html_print_image(
"images/qrcode_icon.jpg",
"images/qrcode_icon.png",
true,
array("alt" => __('QR Code of the page'),
'title' => __('QR Code of the page'))) .
@ -188,7 +191,7 @@ config_check();
$_GET['refr'] = null;
}
if (array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) {
if ($config['autorefresh_white_list'] !== null && array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) {
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
if ($_GET['refr']) {
@ -230,12 +233,18 @@ config_check();
//======================================================
$check_minor_release_available = false;
$pandora_management = check_acl($config['id_user'], 0, "PM");
$check_minor_release_available = db_check_minor_relase_available ();
if ($check_minor_release_available) {
set_pandora_error_for_header('There are one or more minor releases waiting for update, there are required administrator permissions', 'minor release/s available');
}
echo '<div id="alert_messages" style="display: none"></div>';
if ($config["alert_cnt"] > 0) {
echo '<div id="alert_messages" style="display: none"></div>';
$maintenance_link = 'javascript:';
$maintenance_title = __("System alerts detected - Please fix as soon as possible");
$maintenance_class = $maintenance_id = 'show_systemalert_dialog white';
@ -270,7 +279,11 @@ config_check();
$table->data[0][3] = $maintenance_img;
// Main help icon
$table->data[0][4] = ui_print_help_icon ("main_help", true, '', 'images/header_help.png');
$table->data[0][4] = '<a href="#" class="modalpopup" id="helpmodal">'.html_print_image("images/header_help.png",
true, array(
"title" => __('Main help'),
"id" => "helpmodal",
"class" => "modalpopup")).'</a>';
// Logout
$table->data[0][5] = '<a class="white" href="' . ui_get_full_url('index.php?bye=bye') . '">';
@ -369,11 +382,19 @@ config_check();
$("#agent_access").css("display","");
});
function blinkmail(){
$("#yougotmail").delay(100).fadeTo(300,0.2).delay(100).fadeTo(300,1, blinkmail);
}
function blinkalert(){
$("#yougotalert").delay(100).fadeTo(300,0.2).delay(100).fadeTo(300,1, blinkalert);
}
function blinkpubli(){
$(".publienterprise").delay(100).fadeTo(300,0.2).delay(100).fadeTo(300,1, blinkpubli);
}
<?php
if ($msg_cnt > 0) {
?>
$("#yougotmail").pulsate ();
blinkmail();
<?php
}
?>
@ -382,11 +403,11 @@ config_check();
<?php
if ($config["alert_cnt"] > 0) {
?>
$("#yougotalert").pulsate ();
blinkalert();
<?php
}
?>
$("#publienterprise").pulsate ();
blinkpubli();
<?php
if ($_GET["refr"]) {

View File

@ -89,13 +89,28 @@ echo '<div id="login_in">';
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);
}
if (!isset ($config["custom_logo_login"])){
html_print_image ("images/custom_logo_login/login_logo.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
else{
html_print_image ("images/custom_logo_login/".$config['custom_logo_login'], 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);
if (!isset ($config["custom_logo_login"])){
html_print_image ("enterprise/images/custom_logo_login/login_logo.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
else{
html_print_image ("enterprise/images/custom_logo_login/".$config['custom_logo_login'], 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);
if (!isset ($config["custom_logo_login"]) || $config["custom_logo_login"] == 0){
html_print_image ("images/custom_logo_login/login_logo.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
else{
html_print_image ("images/custom_logo_login/".$config['custom_logo_login'], false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";
}
echo '</a>';

View File

@ -24,6 +24,7 @@ if (is_ajax()) {
$save_identification = get_parameter ('save_required_wizard', 0);
$change_language = get_parameter ('change_language', 0);
$cancel_wizard = get_parameter ('cancel_wizard', 0);
// Updates the values get on the identification wizard
if ($save_identification) {
@ -52,6 +53,10 @@ if (is_ajax()) {
config_update_value ('language', $change_language);
}
if ($cancel_wizard !== 0) {
config_update_value ('initial_wizard', 1);
}
return;
}
@ -118,6 +123,9 @@ echo '<div id="login_id_dialog" title="' .
echo '<div style="float: right; width: 20%;">';
html_print_submit_button(__("Register"), 'id_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>';
echo '<div style="float: right; width: 20%;">';
html_print_button(__("Cancel"), 'cancel', false, '', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>';
echo '<div id="all-required" style="float: right; margin-right: 30px; display: none; color: red;">';
echo __("All fields required");
echo '</div>';
@ -215,6 +223,16 @@ $(document).ready (function () {
$(".ui-widget-overlay").css("opacity", 0.6);
$(".ui-draggable").css("cursor", "inherit");
$("#button-cancel").click (function () {
jQuery.post ("ajax.php",
{"page": "general/login_required",
"cancel_wizard": 1},
function (data) {}
);
$("#login_id_dialog" ).dialog('close');
});
});
/* ]]> */

View File

@ -75,6 +75,18 @@ var id_user = "<?php echo $config['id_user']; ?>";
var cookie_name = id_user + '-pandora_menu_state';
var cookie_name_encoded = btoa(cookie_name);
var click_display = "<?php echo $config["click_display"]; ?>";
var classic_menu = parseInt("<?php echo $config["classic_menu"]; ?>");
if ((isNaN(classic_menu)) || (classic_menu == 0)) {
classic_menu = false;
}
else {
classic_menu = true;
}
if (classic_menu) {
autohidden_menu = 1;
}
var menuState = $.cookie(cookie_name_encoded);
if (!menuState) {
@ -226,29 +238,31 @@ $(document).ready( function() {
*/
handsInMenu = 0;
openTimeMenu = 0;
if(!click_display){
$('#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() {
if (classic_menu) {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('#menu').css('width', '145px');
$('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
$('#menu').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();
$('#menu').css('width', '145px');
$('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}
}, 2500);
});
}else{
$(document).ready(function() {
$('#menu').on("click", function() {
}
else {
if(!click_display){
$('#menu').mouseenter(function() {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
@ -267,29 +281,34 @@ $(document).ready( function() {
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
}
}, 5500);
}, 2500);
});
});
}else{
$(document).ready(function() {
$('#menu').on("click", function() {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('#menu').css('width', '145px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('li.menu_icon').find('li').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");
$('li.menu_icon').find('li').removeClass( " no_hidden_menu" );
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
}
}, 5500);
});
});
}
}
/*$('#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();
@ -416,9 +435,80 @@ $(document).ready( function() {
});
$(document).ready(function() {
//Daniel maya 02/06/2016 Display menu with click --INI
if(!click_display){
$('#container').click(function() {
if (!classic_menu) {
//Daniel maya 02/06/2016 Display menu with click --INI
if(!click_display){
$('#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();
});
}else{
$('#main').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();
});
}
//Daniel maya 02/06/2016 Display menu with click --END
}
else {
if(!click_display){
$('#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', '145px');
$('ul.submenu').css('left', '144px');
});
}else{
$('#main').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', '145px');
$('ul.submenu').css('left', '144px');
});
}
}
if (classic_menu) {
$('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();
$('ul.submenu').css('left', '144px');
});
$('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();
$('ul.submenu').css('left', '144px');
});
}
else {
$('div.menu>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
@ -428,9 +518,9 @@ $(document).ready( function() {
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
}else{
$('#main').click(function() {
});
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
@ -442,30 +532,6 @@ $(document).ready( function() {
$('div#title_menu').hide();
});
}
//Daniel maya 02/06/2016 Display menu with click --END
$('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();
});
});

View File

@ -1,42 +1,149 @@
<?php
<html>
<head>
<style>
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
if (file_exists("images/grafico_llave.png")) {
ui_print_page_header (__('You don\'t have access to this page'), "", false, "", true);
#alert_messages_na{
-moz-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
z-index:2;
position:fixed;
width:650px;
background:white;
}
else {
echo "<br><br><center><h3>".__('You don\'t have access to this page')."</h3></center>";
}
?>
<div id="noaccess" style="width: 500px; height:180px;">
<div id="noaccess-title" style=" height: 20px; width: 98%;"><?php echo __('Access to this page is restricted');?></div>
<div>
<div id="noaccess-image" style="width: 15%;">
<?php
if (file_exists("images/grafico_llave.png")) {
echo html_print_image('images/grafico_llave.png', true, array("alt" => __('No access')));
}
?>
</div>
<div id="noaccess-text" style="width: 70%;">
<?php echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br/> <br/>
Please know that all attempts to access this page are recorded in security logs of Pandora System Database');?>
</div>
.modalheade{
text-align:center;
width:100%;
height:37px;
left:0px;
background-color:#82b92e;
}
.modalheadertex{
color:white;
position:relative;
font-family:Nunito;
font-size:13pt;
top:8px;
}
.modalclose{
cursor:pointer;
display:inline;
float:right;
margin-right:10px;
margin-top:10px;
}
.modalconten{
color:black;
background:white;
}
.modalcontentim{
float:left;
margin-left:30px;
margin-top:30px;
margin-bottom:30px;
}
.modalcontenttex{
float:left;
text-align:justify;
color:black;
font-size: 9.5pt;
line-height:13pt;
margin-top:30px;
width:430px;
margin-left:30px;
}
.modalokbutto{
cursor:pointer;
text-align:center;
margin-right:45px;
float:right;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin-bottom:30px;
border-radius: 3px;width:90px;height:30px;background-color:white;border: 1px solid #82b92e;
}
.modalokbuttontex{
color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
}
.modalgobutto{
cursor:pointer;text-align:center;margin-right:15px;margin-bottom:30px;float:right;-moz-border-radius: 3px;
-webkit-border-radius: 3px;border-radius: 3px;width:240px;height:30px;background-color:white;border: 1px solid #82b92e;
}
.modalgobuttontex{
color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
}
#opacida{
position:absolute;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width:100%;height:100%;
}
.textodialog{
margin-left: 0px;
color:#333;
padding:20px;
font-size:9pt;
}
.cargatextodialog{
max-width:58.5%;
width:58.5%;
min-width:58.5%;
float:left;
margin-left: 0px;
font-size:18pt;
padding:20px;
text-align:center;
}
.cargatextodialog p, .cargatextodialog b, .cargatextodialog a{
font-size:18pt;
}
</style>
</head>
<body>
<div id="alert_messages_na">
<div class='modalheade'>
<span class='modalheadertex'>
You don't have access to this page
</span>
<img class='modalclose cerrar' src='<?php echo $config['homeurl'];?>images/icono_cerrar.png'>
</div>
<div class='modalconten'>
<img class='modalcontentim' src='<?php echo $config['homeurl'];?>images/access_denied.png'>
<div class='modalcontenttex'>
Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br/> <br/>
Please know that all attempts to access this page are recorded in security logs of Pandora System Database
</div>
</div>
<!-- Container div. ENDS HERE -->
<div class='modalokbutto cerrar'>
<span class='modalokbuttontex'>OK</span>
</div>
</div>
<div id="opacida" style="position:fixed;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width:100%;height:100%;"></div>
</body>
</html>
<script>
$(".cerrar").click(function(){
window.location=".";
});
</script>

View File

@ -0,0 +1,42 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
if (file_exists("images/grafico_llave.png")) {
ui_print_page_header (__('You don\'t have access to this page'), "", false, "", true);
}
else {
echo "<br><br><center><h3>".__('You don\'t have access to this page')."</h3></center>";
}
?>
<div id="noaccess" style="width: 500px; height:180px;">
<div id="noaccess-title" style=" height: 20px; width: 98%;"><?php echo __('Access to this page is restricted');?></div>
<div>
<div id="noaccess-image" style="width: 15%;">
<?php
if (file_exists("images/grafico_llave.png")) {
echo html_print_image('images/grafico_llave.png', true, array("alt" => __('No access')));
}
?>
</div>
<div id="noaccess-text" style="width: 70%;">
<?php echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br/> <br/>
Please know that all attempts to access this page are recorded in security logs of Pandora System Database');?>
</div>
</div>
</div>
<!-- Container div. ENDS HERE -->

View File

@ -32,12 +32,12 @@ require_once ("../include/functions_html.php");
$id = get_parameter ('id');
if (! isset($_SESSION['id_usuario'])) {
if (! isset($_SESSION[$config['homeurl_static']]['id_usuario'])) {
session_start();
session_write_close();
}
$user_language = get_user_language ($_SESSION['id_usuario']);
$user_language = get_user_language ($_SESSION[$config['homeurl_static']]['id_usuario']);
if (file_exists ('../include/languages/'.$user_language.'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('../include/languages/'.$user_language.'.mo'));

View File

@ -1,409 +0,0 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
// Login check
check_login ();
require_once("include/functions_reporting.php");
require_once("include/functions_events.php");
if (is_ajax()) {
$save_item_shorcut = (bool) get_parameter("save_item_shorcut");
$update_shortcut_state = (bool) get_parameter('update_shortcut_state');
$get_alerts_fired = (bool) get_parameter('get_alerts_fired');
$get_critical_events = (bool) get_parameter('get_critical_events');
$get_opened_incidents = (bool) get_parameter('get_opened_incidents');
if ($save_item_shorcut) {
$result = false;
$data = get_parameter("data", '');
$id_user = get_parameter('id_user', 0);
if ($config['id_user'] != $id_user) return;
$shortcut_data = db_get_value('shortcut_data', 'tusuario', 'id_user', $id_user);
if ($shortcut_data !== false) {
$serialize = $shortcut_data;
$unserialize = json_decode($serialize, true);
$unserialize['item_shorcut'][] = $data;
$shortcut_data = array();
$shortcut_data['shortcut_data'] = json_encode($unserialize);
db_process_sql_update('tusuario', $shortcut_data, array('id_user' => $id_user));
}
echo json_encode($result);
return;
}
// Update if shortcut is visible or hidden
if ($update_shortcut_state) {
$value = (int) get_parameter('value');
$result = db_process_sql_update('tusuario', array('shortcut' => $value), array('id_user' => $config['id_user']));
echo json_encode($result);
return;
}
// Get critical events (realtime update)
if ($get_alerts_fired) {
echo sc_get_alerts_fired();
return;
}
// Get critical events (realtime update)
if ($get_critical_events) {
echo sc_get_critical_events();
return;
}
// Select only opened incidents
if ($get_opened_incidents) {
echo sc_get_opened_incidents();
return;
}
return;
}
function sc_get_alerts_fired () {
global $config;
$data_reporting = reporting_get_group_stats();
return $data_reporting['monitor_alerts_fired'];
}
function sc_get_critical_events () {
global $config;
$own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$own_groups = array_keys(users_get_groups($config['id_user'], "IR"));
else
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
// Get events in the last 8 hours
$shortcut_events_update = events_get_group_events($own_groups, 28800, time());
if ($shortcut_events_update == false)
$shortcut_events_update = array();
$critical_events_update = 0;
foreach ($shortcut_events_update as $event_update) {
if ($event_update['criticity'] == 4 and $event_update['estado'] == 0) {
$critical_events_update++;
}
}
return $critical_events_update;
}
function sc_get_opened_incidents () {
global $config;
$own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) {
$sql = "SELECT count(*) total_incidents
FROM tincidencia
WHERE estado = 0
ORDER BY actualizacion";
$result_incidents_update = db_get_all_rows_sql ($sql);
}
else {
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
$sql = "SELECT count(*) total_incidents
FROM tincidencia
WHERE id_grupo IN (".implode (",",array_keys ($own_groups)).")
AND estado = 0
ORDER BY actualizacion";
if (!empty($own_groups)) {
$result_incidents_update = db_get_all_rows_sql($sql);
}
else {
$result_incidents_update = false;
}
}
if ($result_incidents_update === false)
$shortcut_incidents = 0;
else
$shortcut_incidents = $result_incidents_update[0]['total_incidents'];
return $shortcut_incidents;
}
$shortcut_state = db_get_value_filter('shortcut', 'tusuario', array('id_user' => $config['id_user']));
// If shortcut bar is disabled return to index.php
if ($shortcut_state == 0)
return;
$own_info = get_user_info ($config['id_user']);
$shortcut_html = "<div id='shortcut_container'>";
$shortcut_html .= "<div id='shortcut_button'>";
$shortcut_html .= html_print_image("images/control_play.png", true, array("title" => __("Press here to activate shortcut bar")));
$shortcut_html .= "</div>";
$shortcut_html .= "<div id='shortcut_bar'>";
$num_shortcut_items = 0;
// Alerts item
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0, "AR")) {
$alerts_fired = sc_get_alerts_fired();
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=120&filter=fired&filter_button=Filter'>";
$shortcut_html .= html_print_image("images/op_alerts.png", true, array("title" => __("Alerts fired"), "style" => "margin-bottom: 0px;"));
$shortcut_html .= "&nbsp;";
$shortcut_html .= "<span id='shortcut_alerts_fired' title='" . __('Alerts fired') . "'>" . $alerts_fired . "</span>";
$shortcut_html .= "</a>";
$num_shortcut_items++;
}
// Events item
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0, "IR")) {
$critical_events = sc_get_critical_events();
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&id_group=0&group_rep=1&filter_only_alert=-1'>";
$shortcut_html .= html_print_image("images/op_events.png", true, array("title" => __("Critical events"), "style" => "margin-bottom: 0px;"));
$shortcut_html .= "&nbsp;";
$shortcut_html .= "<span id='shortcut_critical_events' title='" . __('Critical events') . "'>" . $critical_events . "</span>";
$shortcut_html .= "</a>";
$num_shortcut_items++;
}
// Calculate opened incidents (id integria incidents are not enabled)
if ($config['integria_enabled'] == 0) {
$shortcut_incidents = sc_get_opened_incidents();
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=incidencias&sec2=operation/incidents/incident&estado=0'>";
$shortcut_html .= html_print_image("images/incidents.png", true, array("title" => __("Incidents opened"), "style" => "margin-bottom: 0px;"));
$shortcut_html .= "&nbsp;";
$shortcut_html .= "<span id='shortcut_incidents_opened' title='" . __('Incidents opened') . "'>" . $shortcut_incidents . "</span>";
$shortcut_html .= "</a>";
$num_shortcut_items++;
}
if ($num_shortcut_items > 0) {
$shortcut_html .= "<span class='shortcut_item' href='javascript:;'>";
$shortcut_html .= "<span>|</span>";
$shortcut_html .= "</span>";
}
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=reporting&sec2=operation/reporting/custom_reporting'>";
$shortcut_html .= html_print_image("images/op_reporting.png", true, array("title" => __("View reports"), "style" => "margin-bottom: 0px;"));
$shortcut_html .= "</a>";
$num_shortcut_items++;
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=workspace&sec2=operation/messages/message_list'>";
$shortcut_html .= html_print_image("images/email_mc.png", true, array("title" => __("Create new message"), "style" => "margin-bottom: 0px;"));
$shortcut_html .= "</a>";
$num_shortcut_items++;
//Quick access
// $shortcut_data = db_get_value('shortcut_data', 'tusuario', 'id_user', $config['id_user']);
// if (!empty($shortcut_data)) {
// $serialize = $shortcut_data;
// $unserialize = json_decode($serialize, true);
// $items = $unserialize['item_shorcut'];
// }
// else {
// $items = array();
// }
// $shortcut_html .= "<div id='shortcut_icons_box' style='font-size: 9pt; color:#696969; font-weight: bold; display: inline; float: right; padding-right: 20px;'>" .
// __("Shortcut: ");
// $shortcut_html .= "<ul style='display: inline; font-size: 9pt; color:#000;'>";
// foreach ($items as $item) {
// $shortcut_html .= "<li style='display: inline; padding-right: 10px;'>" . io_safe_output($item) . "</li>";
// }
// $shortcut_html .= "</ul>";
$shortcut_html .= "</div>";
$shortcut_html .= "</div>";
echo $shortcut_html;
// Login in Console and shortcut bar is disabled
// This will show and hide the shortcut value in Javascript code
if (isset($_POST['nick']) and $shortcut_state != 2) {
html_print_input_hidden("login_console", 1);
}
else {
html_print_input_hidden("login_console", 0);
}
html_print_input_hidden("shortcut_id_user", $config['id_user']);
?>
<script type='text/javascript'>
$(function() {
if (<?php echo json_encode((int) $shortcut_state); ?> < 2) {
$('#shortcut_bar').hide();
$('#shortcut_button>img')
.css('transform', 'rotate(-90deg)')
.css('-o-transform', 'rotate(-90deg)')
.css('-ms-transform', 'rotate(-90deg)')
.css('-moz-transform', 'rotate(-90deg)')
.css('-webkit-transform', 'rotate(-90deg)');
}
else {
$('#shortcut_button>img')
.css('transform', 'rotate(90deg)')
.css('-o-transform', 'rotate(90deg)')
.css('-ms-transform', 'rotate(90deg)')
.css('-moz-transform', 'rotate(90deg)')
.css('-webkit-transform', 'rotate(90deg)');
}
$('#shortcut_button').click (function () {
if ($('#shortcut_bar').is(":visible")) {
$('#shortcut_bar').slideUp();
$('#shortcut_button>img')
.css('transform', 'rotate(-90deg)')
.css('-o-transform', 'rotate(-90deg)')
.css('-ms-transform', 'rotate(-90deg)')
.css('-moz-transform', 'rotate(-90deg)')
.css('-webkit-transform', 'rotate(-90deg)');
jQuery.post (
"ajax.php",
{
"page" : "general/shortcut_bar",
"update_shortcut_state" : 1,
"value" : 1
},
function (data) {}
);
}
else {
$('#shortcut_bar').slideDown();
$('#shortcut_button>img')
.css('transform', 'rotate(90deg)')
.css('-o-transform', 'rotate(90deg)')
.css('-ms-transform', 'rotate(90deg)')
.css('-moz-transform', 'rotate(90deg)')
.css('-webkit-transform', 'rotate(90deg)');
jQuery.post (
"ajax.php",
{
"page" : "general/shortcut_bar",
"update_shortcut_state" : 1,
"value" : 2
},
function (data) {}
);
}
});
});
var id_user = $('#hidden-shortcut_id_user').val();
function shortcut_check_alerts() {
jQuery.post (
"ajax.php",
{
"page" : "general/shortcut_bar",
"get_alerts_fired": 1
},
function (data) {
$('#shortcut_alerts_fired').html(data);
}
);
}
function shortcut_check_events() {
jQuery.post (
"ajax.php",
{
"page" : "general/shortcut_bar",
"get_critical_events": 1
},
function (data) {
$('#shortcut_critical_events').html(data);
}
);
}
function shortcut_check_incidents() {
jQuery.post (
"ajax.php",
{
"page" : "general/shortcut_bar",
"get_opened_incidents": 1
},
function (data) {
$('#shortcut_incidents_opened').html(data);
}
);
}
$(document).ready (function () {
setInterval("shortcut_check_alerts()", (10 * 1000)); //10 seconds between ajax request
setInterval("shortcut_check_events()", (10 * 1000)); //10 seconds between ajax request
setInterval("shortcut_check_incidents()", (10 * 1000)); //10 seconds between ajax request
//To make a link as item for drag only put "item_drag_shortcut" as class.
//TODO: In the future show better as icons and the handle some icon.
//TODO: Remove the class "item_drag_shortcut" for avoid drag.
//TODO: Method for remove items.
$("#shortcut_icons_box").droppable({
drop: function( event, ui ) {
var item = ui.draggable.clone();
//unescape for avoid change returns
var content_item = unescape($('<div id="content_item"></div>').html(item).html()); //hack
//Add the element
$("<li style='display: inline; padding-right: 10px;'></li>").html(item).appendTo($("#shortcut_icons_box > ul"));
jQuery.post ('ajax.php',
{"page": "general/shortcut_bar",
"save_item_shorcut": 1,
"id_user": "<?php echo $config['id_user'];?>",
"data": content_item
},
function (data) {
}
);
}
});
$(".item_drag_shortcut").draggable({
appendTo: 'body',
helper: "clone",
scroll: false
});
});
</script>

View File

@ -0,0 +1,51 @@
<?php
switch ($_GET['module'])
{
case 1:
$sql = sprintf ('SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria IN (6,7,8,0,1,2,-1) order by descripcion ');
break;
case 2:
$sql = sprintf ('SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria between 3 and 5 ');
break;
case 4:
$sql = sprintf ('SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria between 0 and 2 ');
break;
case 6:
$sql = sprintf ('SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria between 0 and 2 ');
break;
case 7:
$sql = sprintf ('SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria = 9');
break;
case 5:
$sql = sprintf ('SELECT id_tipo, descripcion
FROM ttipo_modulo
WHERE categoria = 0');
break;
case '':
$sql = sprintf ('SELECT id_tipo, descripcion
FROM ttipo_modulo');
break;
}
echo '<select id="datatype" name="datatype">';
echo '<option name="datatype" value="">'.__("All").'</option>';
$a = db_get_all_rows_sql($sql);
foreach ($a as $valor) {
echo '<option name="datatype" value="'.$valor['id_tipo'].'">'.$valor['descripcion'].'</option>';
}
echo '</select>';
?>

View File

@ -245,7 +245,7 @@ foreach ($result as $row) {
}
$data[1] = ui_print_session_action_icon ($row['accion'], true);
$data[1] .= $row["accion"];
$data[2] = ui_print_help_tip($row['fecha'], true) . human_time_comparation($row['utimestamp']);
$data[2] = ui_print_help_tip($row['fecha'], true) . ui_print_timestamp($row['utimestamp'], true);
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
@ -299,7 +299,7 @@ html_print_table ($table);
echo '<div style="width: '.$table->width.'" class="action-buttons">';
echo '<a href="' .
ui_get_full_url(false, false, false, false) . 'index.php?sec=gextensions&sec2=godmode/audit_log_csv&tipo_log='.$tipo_log.'&user_filter='.$user_filter.'&filter_text='.$filter_text.'&filter_hours_old='.$filter_hours_old.'&filter_ip='.$filter_ip.'"'.
'target="_new">' .
'>' .
html_print_button (__('Export to CSV '), 'export_csv', false, '', 'class=sub upd', true, false). '</a>';
echo '</div>';

View File

@ -242,6 +242,15 @@ if(!$new_agent){
$groups = users_get_groups ($config["id_user"], "AR",false);
$agents = agents_get_group_agents (array_keys ($groups));
$modules = db_get_all_rows_sql("SELECT id_agente_modulo as id_module, nombre as name FROM tagente_modulo
WHERE id_agente = " . $id_parent);
$modules_values = array();
$modules_values[0] = __('Any');
foreach ($modules as $m) {
$modules_values[$m['id_module']] = $m['name'];
}
$table->data[3][0] = __('Parent');
$params = array();
$params['return'] = true;
@ -255,6 +264,8 @@ $table->data[3][1] = ui_print_agent_autocomplete_input($params);
$table->data[3][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). "&nbsp;" . ui_print_help_icon("cascade_protection", true);
$table->data[3][1] .= "&nbsp;&nbsp;" . __('Module') . "&nbsp;" . html_print_select ($modules_values, "cascade_protection_module", $cascade_protection_module, "", "", 0, true);
$table->data[4][0] = __('Group');
$table->data[4][1] = html_print_select_groups(false, "AR", false, 'grupo', $grupo, '', '', 0, true);
$table->data[4][1] .= ' <span id="group_preview">';
@ -540,6 +551,57 @@ ui_require_jquery_file('bgiframe');
$(document).ready (function() {
$("select#id_os").pandoraSelectOS ();
var checked = $("#checkbox-cascade_protection").is(":checked");
if (checked) {
$("#cascade_protection_module").removeAttr("disabled");
}
else {
$("#cascade_protection_module").attr("disabled", 'disabled');
}
$("#checkbox-cascade_protection").change(function () {
var checked = $("#checkbox-cascade_protection").is(":checked");
if (checked) {
$("#cascade_protection_module").removeAttr("disabled");
}
else {
$("#cascade_protection_module").val(0);
$("#cascade_protection_module").attr("disabled", 'disabled');
}
});
$("#text-id_parent").on("autocompletechange", function () {
agent_name = $("#text-id_parent").val();
var params = {};
params["get_agent_modules_json_by_name"] = 1;
params["agent_name"] = agent_name;
params["page"] = "include/ajax/module";
jQuery.ajax ({
data: params,
dataType: "json",
type: "POST",
url: "ajax.php",
success: function (data) {
$('#cascade_protection_module').empty();
$('#cascade_protection_module')
.append ($('<option></option>')
.html("Any")
.prop("value", 0)
.prop("selected", 'selected'));
jQuery.each (data, function (i, val) {
$('#cascade_protection_module')
.append ($('<option></option>')
.html(val['name'])
.prop("value", val['id_module'])
.prop("selected", 'selected'));
});
}
});
});
paint_qrcode(
"<?php

View File

@ -81,10 +81,15 @@ if (isset ($_POST["template_id"])) {
'plugin_user' => $row2["plugin_user"],
'plugin_pass' => $row2["plugin_pass"],
'plugin_parameter' => $row2["plugin_parameter"],
'unit' => $row2["unit"],
'max_timeout' => $row2["max_timeout"],
'max_retries' => $row2["max_retries"],
'id_plugin' => $row2['id_plugin'],
'post_process' => $row2['post_process'],
'dynamic_interval' => $row2['dynamic_interval'],
'dynamic_max' => $row2['dynamic_max'],
'dynamic_min' => $row2['dynamic_min'],
'dynamic_two_tailed' => $row2['dynamic_two_tailed'],
'min_warning' => $row2['min_warning'],
'max_warning' => $row2['max_warning'],
'str_warning' => $row2['str_warning'],

View File

@ -31,6 +31,7 @@ $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent);
check_login ();
$ip_target = (string) get_parameter ('ip_target', $ipAgent);
$use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public');
$snmp_version = get_parameter('snmp_version', '1');
$snmp3_auth_user = get_parameter('snmp3_auth_user');
@ -305,7 +306,13 @@ if ($create_modules) {
$common_values['tcp_port'] = $tcp_port;
}
$common_values['snmp_community'] = $snmp_community;
$common_values['ip_target'] = $ip_target;
if($use_agent){
$common_values['ip_target'] = 'auto';
}
else{
$common_values['ip_target'] = $ip_target;
}
$common_values['tcp_send'] = $snmp_version;
if ($snmp_version == '3') {
@ -696,18 +703,22 @@ $table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60,
$table->data[0][2] = '<b>' . __('Port') . '</b>';
$table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true);
$table->data[1][0] = '<b>' . __('Use agent ip') . '</b>';
$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true);
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';
$table->data[1][0] = '<b>' . __('SNMP community') . '</b>';
$table->data[1][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true);
$table->data[2][0] = '<b>' . __('SNMP community') . '</b>';
$table->data[2][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true);
$table->data[1][2] = '<b>' . __('SNMP version') . '</b>';
$table->data[1][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, '');
$table->data[2][2] = '<b>' . __('SNMP version') . '</b>';
$table->data[2][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, '');
$table->data[2][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
html_print_input_hidden('snmpwalk', 1);
html_print_table($table);
@ -760,9 +771,10 @@ if (!$fail) {
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente=$id_agent'>";
echo '<span id="form_interfaces">';
html_print_input_hidden('create_modules', 1);
html_print_input_hidden('ip_target', $ip_target);
html_print_input_hidden('use_agent', $use_agent);
html_print_input_hidden('tcp_port', $tcp_port);
html_print_input_hidden('snmp_community', $snmp_community);
html_print_input_hidden('snmp_version', $snmp_version);

View File

@ -28,6 +28,7 @@ $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent);
check_login ();
$ip_target = (string) get_parameter ('ip_target', $ipAgent);
$use_agent = get_parameter ('use_agent');
$snmp_community = (string) get_parameter ('snmp_community', 'public');
$snmp_version = get_parameter('snmp_version', '1');
$snmp3_auth_user = get_parameter('snmp3_auth_user');
@ -136,7 +137,12 @@ if ($create_modules) {
$values['tcp_port'] = $tcp_port;
}
$values['snmp_community'] = $snmp_community;
$values['ip_target'] = $ip_target;
if($use_agent){
$values['ip_target'] = 'auto';
}
else{
$values['ip_target'] = $ip_target;
}
$values['tcp_send'] = $snmp_version;
if ($snmp_version == '3') {
@ -200,7 +206,7 @@ if ($create_modules) {
// Get the name
$name_array = explode('::', $oid_array[0]);
$name = $name_array[1] . "_" . $ifname;
$name = $ifname . "_" . $name_array[1];
// Clean the name
$name = str_replace ( "\"" , "" , $name);
@ -336,18 +342,21 @@ $table->data[0][1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60,
$table->data[0][2] = '<b>' . __('Port') . '</b>';
$table->data[0][3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true);
$table->data[1][0] = '<b>' . __('Use agent ip') . '</b>';
$table->data[1][1] = html_print_checkbox ('use_agent', 1, $use_agent, true);
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';
$table->data[1][0] = '<b>' . __('SNMP community') . '</b>';
$table->data[1][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true);
$table->data[2][0] = '<b>' . __('SNMP community') . '</b>';
$table->data[2][1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true);
$table->data[1][2] = '<b>' . __('SNMP version') . '</b>';
$table->data[1][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, '');
$table->data[2][2] = '<b>' . __('SNMP version') . '</b>';
$table->data[2][3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, '');
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
$table->data[2][3] .= '<div id="spinner_modules" style="float: left; display: none;">' . html_print_image("images/spinner.gif", true) . '</div>';
html_print_input_hidden('snmpwalk', 1);
html_print_table($table);
@ -409,6 +418,7 @@ if (!empty($interfaces_list)) {
html_print_input_hidden('create_modules', 1);
html_print_input_hidden('ip_target', $ip_target);
html_print_input_hidden('use_agent', $use_agent);
html_print_input_hidden('tcp_port', $tcp_port);
html_print_input_hidden('snmp_community', $snmp_community);
html_print_input_hidden('snmp_version', $snmp_version);

View File

@ -133,6 +133,7 @@ $grupo = 0;
$id_os = 9; // Windows
$custom_id = "";
$cascade_protection = 0;
$cascade_protection_modules = 0;
$icon_path = '';
$update_gis_data = 0;
$unit = "";
@ -163,6 +164,7 @@ if ($create_agent) {
$disabled = (int) get_parameter_post ("disabled");
$custom_id = (string) get_parameter_post ("custom_id",'');
$cascade_protection = (int) get_parameter_post ("cascade_protection", 0);
$cascade_protection_module = (int) get_parameter_post("cascade_protection_module", 0);
$icon_path = (string) get_parameter_post ("icon_path",'');
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description");
@ -200,6 +202,7 @@ if ($create_agent) {
'id_os' => $id_os,
'disabled' => $disabled,
'cascade_protection' => $cascade_protection,
'cascade_protection_module' => $cascade_protection_module,
'server_name' => $server_name,
'id_parent' => $id_parent,
'custom_id' => $custom_id,
@ -233,7 +236,8 @@ if ($create_agent) {
' ID os: ' . $id_os .
' Disabled: ' . $disabled .
' Custom ID: ' . $custom_id .
' Cascade protection: ' . $cascade_protection .
' Cascade protection: ' . $cascade_protection .
' Cascade protection module: ' . $cascade_protection_module .
' Icon path: ' . $icon_path .
' Update GIS data: ' . $update_gis_data .
' Url description: ' . $url_description .
@ -391,7 +395,7 @@ if ($id_agente) {
$total_incidents = agents_get_count_incidents($id_agente);
/* Incident tab */
if ($config['integria_enabled'] == 0 and $total_incidents > 0) {
if ($total_incidents > 0) {
$incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=incident&amp;id_agente='.$id_agente.'">'
. html_print_image ("images/book_edit.png", true, array ("title" =>__('Incidents')))
. '</a>';
@ -669,6 +673,7 @@ if ($update_agent) { // if modified some agent paramenter
$id_parent = (int) agents_get_agent_id ($parent_name);
$custom_id = (string) get_parameter_post ("custom_id", "");
$cascade_protection = (int) get_parameter_post ("cascade_protection", 0);
$cascade_protection_module = (int) get_parameter ("cascade_protection_module", 0);
$icon_path = (string) get_parameter_post ("icon_path",'');
$update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description");
@ -736,6 +741,7 @@ if ($update_agent) { // if modified some agent paramenter
'intervalo' => $intervalo,
'comentarios' => $comentarios,
'cascade_protection' => $cascade_protection,
'cascade_protection_module' => $cascade_protection_module,
'server_name' => $server_name,
'custom_id' => $custom_id,
'icon_path' => $icon_path,
@ -767,6 +773,7 @@ if ($update_agent) { // if modified some agent paramenter
' ID OS: ' . $id_os . ' Disabled: ' . $disabled .
' Server Name: ' . $server_name . ' ID parent: ' . $id_parent .
' Custom ID: ' . $custom_id . ' Cascade Protection: ' . $cascade_protection .
' Cascade protection module: ' . $cascade_protection_module .
' Icon Path: ' . $icon_path . 'Update GIS data: ' .$update_gis_data .
' Url description: ' . $url_description .
' Quiet: ' . (int)$quiet;
@ -817,6 +824,7 @@ if ($id_agente) {
$id_parent = $agent["id_parent"];
$custom_id = $agent["custom_id"];
$cascade_protection = $agent["cascade_protection"];
$cascade_protection_module = $agent["cascade_protection_module"];
$icon_path = $agent["icon_path"];
$update_gis_data = $agent["update_gis_data"];
$url_description = $agent["url_address"];
@ -980,10 +988,18 @@ if ($update_module || $create_module) {
$plugin_parameter = (string) get_parameter ('plugin_parameter');
}
$parent_module_id = (int) get_parameter('parent_module_id');
$ip_target = (string) get_parameter ('ip_target');
if($ip_target == ''){
$ip_target = 'auto';
}
$custom_id = (string) get_parameter ('custom_id');
$history_data = (int) get_parameter('history_data');
$dynamic_interval = (int) get_parameter('dynamic_interval');
$dynamic_max = (int) get_parameter('dynamic_max');
$dynamic_min = (int) get_parameter('dynamic_min');
$dynamic_two_tailed = (int) get_parameter('dynamic_two_tailed');
$min_warning = (float) get_parameter ('min_warning');
$max_warning = (float) get_parameter ('max_warning');
$str_warning = (string) get_parameter ('str_warning');
@ -1007,12 +1023,53 @@ if ($update_module || $create_module) {
$id_category = (int) get_parameter('id_category');
$hour = get_parameter('hour');
$minute = get_parameter('minute');
$mday = get_parameter('mday');
$month = get_parameter('month');
$wday = get_parameter('wday');
$cron_interval = "$minute $hour $mday $month $wday";
$hour_from = get_parameter('hour_from');
$minute_from = get_parameter('minute_from');
$mday_from = get_parameter('mday_from');
$month_from = get_parameter('month_from');
$wday_from = get_parameter('wday_from');
$hour_to = get_parameter('hour_to');
$minute_to = get_parameter('minute_to');
$mday_to = get_parameter('mday_to');
$month_to = get_parameter('month_to');
$wday_to = get_parameter('wday_to');
if ($hour_to != "*") {
$hour_to = "-" . $hour_to;
}
else {
$hour_to = "";
}
if ($minute_to != "*") {
$minute_to = "-" . $minute_to;
}
else {
$minute_to = "";
}
if ($mday_to != "*") {
$mday_to = "-" . $mday_to;
}
else {
$mday_to = "";
}
if ($month_to != "*") {
$month_to = "-" . $month_to;
}
else {
$month_to = "";
}
if ($wday_to != "*") {
$wday_to = "-" . $wday_to;
}
else {
$wday_to = "";
}
$cron_interval = $minute_from . $minute_to . " " . $hour_from . $hour_to . " " . $mday_from . $mday_to . " " . $month_from . $month_to . " " . $wday_from . $wday_to;
if (!cron_check_syntax($cron_interval)) {
$cron_interval = '';
}
if ($prediction_module != MODULE_PREDICTION_SYNTHETIC) {
unset($serialize_ops);
@ -1078,6 +1135,11 @@ if ($update_module) {
'max_retries' => $max_retries,
'custom_id' => $custom_id,
'history_data' => $history_data,
'dynamic_interval' => $dynamic_interval,
'dynamic_max' => $dynamic_max,
'dynamic_min' => $dynamic_min,
'dynamic_two_tailed' => $dynamic_two_tailed,
'parent_module_id' => $parent_module_id,
'min_warning' => $min_warning,
'max_warning' => $max_warning,
'str_warning' => $str_warning,
@ -1221,6 +1283,11 @@ if ($create_module) {
'id_modulo' => $id_module,
'custom_id' => $custom_id,
'history_data' => $history_data,
'dynamic_interval' => $dynamic_interval,
'dynamic_max' => $dynamic_max,
'dynamic_min' => $dynamic_min,
'dynamic_two_tailed' => $dynamic_two_tailed,
'parent_module_id' => $parent_module_id,
'min_warning' => $min_warning,
'max_warning' => $max_warning,
'str_warning' => $str_warning,

View File

@ -178,7 +178,8 @@ echo "</tr></table>";
$order_collation = "";
switch ($config["dbtype"]) {
case "mysql":
$order_collation = "COLLATE utf8_general_ci";
$order_collation = "";
//$order_collation = "COLLATE utf8_general_ci";
break;
case "postgresql":
case "oracle":
@ -194,6 +195,22 @@ $selectOsDown = '';
$selectGroupUp = '';
$selectGroupDown = '';
switch ($sortField) {
case 'remote':
switch ($sort) {
case 'up':
$selectRemoteUp = $selected;
$order = array('field' => 'remote ' . $order_collation,
'field2' => 'nombre ' . $order_collation,
'order' => 'ASC');
break;
case 'down':
$selectRemoteDown = $selected;
$order = array('field' => 'remote ' . $order_collation,
'field2' => 'nombre ' . $order_collation,
'order' => 'DESC');
break;
}
break;
case 'name':
switch ($sort) {
case 'up':
@ -265,8 +282,8 @@ if ($search != "") {
$id = db_get_all_rows_sql($sql);
if($id != ''){
$aux = $id[0]['id_agent'];
$search_sql = " AND ( nombre " . $order_collation . "
LIKE '%$search%' OR tagente.id_agente = $aux";
$search_sql = " AND ( LOWER(nombre) " . $order_collation . "
LIKE LOWER('%$search%') OR tagente.id_agente = $aux";
if(count($id)>=2){
for ($i = 1; $i < count($id); $i++){
$aux = $id[$i]['id_agent'];
@ -461,7 +478,10 @@ if ($agents !== false) {
'<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>';
echo "</th>";
echo "<th title='".__('Remote agent configuration')."'>".__('R')."</th>";
echo "<th title='".__('Remote agent configuration')."'>".__('R'). ' ' .
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectRemoteUp)) . '</a>' .
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=remote&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectRemoteDown)) . '</a>';
echo "</th>";
echo "<th>".__('OS'). ' ' .
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp)) . '</a>' .
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown)) . '</a>';
@ -477,6 +497,18 @@ if ($agents !== false) {
$rowPair = true;
$iterator = 0;
foreach ($agents as $agent) {
/* Begin Update tagente.remote 0/1 with remote agent function return */
if(enterprise_hook('config_agents_has_remote_configuration',array($agent['id_agente']))){
db_process_sql_update('tagente', array('remote' => 1),'id_agente = '.$agent['id_agente'].'');
}
else{
db_process_sql_update('tagente', array('remote' => 0),'id_agente = '.$agent['id_agente'].'');
}
/* End Update tagente.remote 0/1 with remote agent function return */
$id_grupo = $agent["id_grupo"];
if (! check_acl ($config["id_user"], $id_grupo, "AW", $agent['id_agente']) && ! check_acl ($config["id_user"], $id_grupo, "AD", $agent['id_agente']))
@ -556,7 +588,7 @@ if ($agents !== false) {
// Has remote configuration ?
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (config_agents_has_remote_configuration($agent["id_agente"])) {
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
echo "<a href='index.php?" .
"sec=gagente&" .
"sec2=godmode/agentes/configurar_agente&" .

View File

@ -101,6 +101,7 @@ if (strstr($sec2, "enterprise/godmode/policies/policies") !== false) {
}
$show_creation = false;
$checked = get_parameter("checked");
if (($policy_page) || (isset($agent))) {
if ($policy_page) {
@ -114,6 +115,18 @@ if (($policy_page) || (isset($agent))) {
if ($show_creation) {
// Create module/type combo
echo '<form id="create_module_type" method="post" action="'.$url.'">';
if (!$policy_page) {
echo '<td class="datos" style="font-weight: bold;">';
echo __('Show in hierachy mode');
if ($checked == "true") {
$checked = true;
}
else {
$checked = false;
}
html_print_checkbox ('status_hierachy_mode', "", $checked, false, false, "onChange=change_mod_filter();");
echo '</td>';
}
echo '<td class="datos" style="font-weight: bold;">';
echo __("Type");
html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' );
@ -450,12 +463,23 @@ switch ($config["dbtype"]) {
else {
$limit_sql = '';
}
$sql = sprintf("SELECT %s
FROM tagente_modulo
LEFT JOIN tmodule_group
ON tagente_modulo.id_module_group = tmodule_group.id_mg
WHERE %s %s %s %s %s",
$params, $basic_where, $where, $where_tags, $order_sql, $limit_sql);
if ($checked) {
$sql = sprintf("SELECT *
FROM tagente_modulo
LEFT JOIN tmodule_group
ON tagente_modulo.id_module_group = tmodule_group.id_mg
WHERE %s %s %s %s %s",
$basic_where, $where, $where_tags, $order_sql, $limit_sql);
}
else {
$sql = sprintf("SELECT %s
FROM tagente_modulo
LEFT JOIN tmodule_group
ON tagente_modulo.id_module_group = tmodule_group.id_mg
WHERE %s %s %s %s %s",
$params, $basic_where, $where, $where_tags, $order_sql, $limit_sql);
}
$modules = db_get_all_rows_sql($sql);
break;
@ -465,12 +489,24 @@ switch ($config["dbtype"]) {
$set['limit'] = $limit;
$set['offset'] = $offset;
}
$sql = sprintf("SELECT %s
FROM tagente_modulo
LEFT JOIN tmodule_group
ON tmodule_group.id_mg = tagente_modulo.id_module_group
WHERE %s %s %s %s",
$params, $basic_where, $where, $where_tags, $order_sql);
if ($checked) {
$sql = sprintf("SELECT *
FROM tagente_modulo
LEFT JOIN tmodule_group
ON tmodule_group.id_mg = tagente_modulo.id_module_group
WHERE %s %s %s %s",
$basic_where, $where, $where_tags, $order_sql);
}
else {
$sql = sprintf("SELECT %s
FROM tagente_modulo
LEFT JOIN tmodule_group
ON tmodule_group.id_mg = tagente_modulo.id_module_group
WHERE %s %s %s %s",
$params, $basic_where, $where, $where_tags, $order_sql);
}
$modules = oracle_recode_query ($sql, $set, 'AND', false);
break;
}
@ -555,6 +591,15 @@ foreach($tempRows as $row) {
$numericModules[$row['id_tipo']] = true;
}
if ($checked) {
$modules_hierachy = array();
$modules_hierachy = get_hierachy_modules_tree($modules);
$modules_dt = get_dt_from_modules_tree($modules_hierachy);
$modules = $modules_dt;
}
foreach ($modules as $module) {
if (! check_acl ($config["id_user"], $group, "AW", $id_agente) && ! check_acl ($config["id_user"], $group, "AD", $id_agente)) {
continue;
@ -570,20 +615,29 @@ foreach ($modules as $module) {
$module_group2 = $module["id_module_group"];
$data = array ();
if ($module['id_module_group'] != $last_modulegroup) {
$last_modulegroup = $module['id_module_group'];
$data[0] = '<strong>'.modules_get_modulegroup_name ($last_modulegroup).'</strong>';
$i = array_push ($table->data, $data);
$table->rowstyle[$i - 1] = 'text-align: center';
$table->rowclass[$i - 1] = 'datos3';
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK)
$table->colspan[$i - 1][0] = 10;
else
$table->colspan[$i - 1][0] = 8;
$data = array ();
if (!$checked) {
if ($module['id_module_group'] != $last_modulegroup) {
$last_modulegroup = $module['id_module_group'];
$data[0] = '<strong>'.modules_get_modulegroup_name ($last_modulegroup).'</strong>';
$i = array_push ($table->data, $data);
$table->rowstyle[$i - 1] = 'text-align: center';
$table->rowclass[$i - 1] = 'datos3';
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK)
$table->colspan[$i - 1][0] = 10;
else
$table->colspan[$i - 1][0] = 8;
$data = array ();
}
}
$data[0] = "";
if (isset($module['deep']) && ($module['deep'] != 0)) {
$data[0] .= str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $module['deep']);
$data[0] .= html_print_image("images/icono_escuadra.png", true, array("style" => 'padding-bottom: inherit;')) . "&nbsp;&nbsp;";
}
if ($module['quiet']) {
$data[0] .= html_print_image("images/dot_green.disabled.png",
true, array("border" => '0', "title" => __('Quiet'),
@ -764,3 +818,22 @@ if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
echo '</form>';
}
?>
<script type="text/javascript">
function change_mod_filter() {
var checked = $("#checkbox-status_hierachy_mode").is(":checked");
if (/checked/.test(window.location)) {
var url = window.location.toString();
if (checked) {
window.location = url.replace("checked=false", "checked=true");
}
else {
window.location = url.replace("checked=true", "checked=false");
}
}
else {
window.location = window.location + "&checked=true";
}
}
</script>

View File

@ -30,7 +30,7 @@ if (is_ajax ()) {
$component = db_get_row ('tnetwork_component', 'id_nc', $id_component);
$component['throw_unknown_events'] =
!network_components_is_disable_type_event($id_component, EVENTS_GOING_UNKNOWN);
network_components_is_disable_type_event($id_component, EVENTS_GOING_UNKNOWN);
// Decrypt passwords in the component.
$component['plugin_pass'] = io_output_password($component['plugin_pass']);
@ -198,6 +198,11 @@ if ($id_agent_module) {
$max_retries = $module['max_retries'];
$custom_id = $module['custom_id'];
$history_data = $module['history_data'];
$dynamic_interval = $module['dynamic_interval'];
$dynamic_max = $module['dynamic_max'];
$dynamic_min = $module['dynamic_min'];
$parent_module_id = $module['parent_module_id'];
$dynamic_two_tailed = $module['dynamic_two_tailed'];
$min_warning = $module['min_warning'];
$max_warning = $module['max_warning'];
$str_warning = $module['str_warning'];
@ -224,18 +229,53 @@ if ($id_agent_module) {
$cron_interval = explode (" ", $module['cron_interval']);
if (isset ($cron_interval[4])) {
$minute = $cron_interval[0];
$hour = $cron_interval[1];
$mday = $cron_interval[2];
$month = $cron_interval[3];
$wday = $cron_interval[4];
$minute_from = $cron_interval[0];
$min = explode("-", $minute_from);
$minute_from = $min[0];
if (isset($min[1])) {
$minute_to = $min[1];
}
$hour_from = $cron_interval[1];
$h = explode("-", $hour_from);
$hour_from = $h[0];
if (isset($h[1])) {
$hour_to = $h[1];
}
$mday_from = $cron_interval[2];
$md = explode("-", $mday_from);
$mday_from = $md[0];
if (isset($md[1])) {
$mday_to = $md[1];
}
$month_from = $cron_interval[3];
$m = explode("-", $month_from);
$month_from = $m[0];
if (isset($m[1])) {
$month_to = $m[1];
}
$wday_from = $cron_interval[4];
$wd = explode("-", $wday_from);
$wday_from = $wd[0];
if (isset($wd[1])) {
$wday_to = $wd[1];
}
}
else {
$minute = '*';
$hour = '*';
$mday = '*';
$month = '*';
$wday = '*';
$minute_from = '*';
$hour_from = '*';
$mday_from = '*';
$month_from = '*';
$wday_from = '*';
$minute_to = '*';
$hour_to = '*';
$mday_to = '*';
$month_to = '*';
$wday_to = '*';
}
$module_macros = null;
@ -280,6 +320,11 @@ else {
$plugin_parameter = '';
$custom_id = '';
$history_data = 1;
$dynamic_interval = 0;
$dynamic_min = 0;
$dynamic_max = 0;
$parent_module_id = 0;
$dynamic_two_tailed = 0;
$min_warning = 0;
$max_warning = 0;
$str_warning = '';
@ -312,11 +357,16 @@ else {
$id_category = 0;
$cron_interval = '* * * * *';
$hour = '*';
$minute = '*';
$mday = '*';
$month = '*';
$wday = '*';
$hour_from = '*';
$minute_from = '*';
$mday_from = '*';
$month_from = '*';
$wday_from = '*';
$hour_to = '*';
$minute_to = '*';
$mday_to = '*';
$month_to = '*';
$wday_to = '*';
$ff_interval = 0;
@ -386,7 +436,7 @@ switch ($moduletype) {
$remote_conf = false;
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
$remote_conf = config_agents_has_remote_configuration($id_agente);
$remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($id_agente));
}
/* Categories is an array containing the allowed module types

View File

@ -17,6 +17,8 @@
include_once("include/functions_modules.php");
include_once("include/functions_categories.php");
echo "<script type='text/javascript' src='include/javascript/d3.3.5.14.js'></script>" . "\n";
function prepend_table_simple ($row, $id = false) {
global $table_simple;
@ -100,15 +102,29 @@ global $__code_from;
$disabledBecauseInPolicy = false;
$disabledTextBecauseInPolicy = '';
$largeClassDisabledBecauseInPolicy = '';
$page = get_parameter('page', '');
if (strstr($page, "policy_modules") === false && $id_agent_module) {
if ($config['enterprise_installed'])
$disabledBecauseInPolicy = policies_is_module_in_policy($id_agent_module) && policies_is_module_linked($id_agent_module);
if(policies_is_module_linked($id_agent_module) == 1){
$disabledBecauseInPolicy = 1;
}
else{
$disabledBecauseInPolicy = 0;
}
else
$disabledBecauseInPolicy = false;
if ($disabledBecauseInPolicy)
$disabledTextBecauseInPolicy = 'disabled = "disabled"';
$disabledTextBecauseInPolicy = 'readonly = "readonly"';
}
if($disabledBecauseInPolicy){
$classdisabledBecauseInPolicy = 'readonly';
$largeClassDisabledBecauseInPolicy = 'class=readonly';
} else {
$classdisabledBecauseInPolicy = '';
}
$update_module_id = (int) get_parameter_get ('update_module');
@ -119,9 +135,11 @@ $table_simple->class = 'databox';
$table_simple->data = array ();
$table_simple->colspan = array ();
$table_simple->style = array ();
$table_simple->style[0] = 'font-weight: bold; width: 26%;';
$table_simple->style[1] = 'width: 40%';
$table_simple->style[2] = 'font-weight: bold;';
$table_simple->style[0] = 'font-weight: bold; width: 15%;';
$table_simple->style[1] = 'width: 35%';
$table_simple->style[2] = 'font-weight: bold; width: 25%;';
$table_simple->style[3] = 'width: 25%';
#$table_simple->colspan[4][1] = 3;
$table_simple->colspan[5][1] = 3;
@ -129,7 +147,7 @@ $table_simple->colspan[6][1] = 3;
$table_simple->data[0][0] = __('Name');
$table_simple->data[0][1] = html_print_input_text_extended ('name',
io_safe_output($name), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', 'autocomplete="off"', true);
io_safe_output($name), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
//$table_simple->data[0][1] = html_print_input_text ('name',
// io_safe_output($name), '', 45, 100, true, $disabledBecauseInPolicy);
@ -151,10 +169,21 @@ if ($policy_link != 0) {
$disabled_enable = 1;
}
$table_simple->data[0][2] = __('Disabled');
$table_simple->data[0][3] = html_print_checkbox ("disabled", 1, $disabled, true, $disabled_enable);
$table_simple->data[0][2] .= html_print_checkbox ("disabled", 1, $disabled, true, $disabled_enable);
$table_simple->data[0][3] = __('Module group');
$table_simple->data[0][3] .= html_print_select_from_sql ('SELECT id_mg, name FROM tmodule_group ORDER BY name',
'id_module_group', $id_module_group, '', __('Not assigned'), '0', true, false, true, $disabledBecauseInPolicy);
$table_simple->data[1][0] = __('Type').' ' . ui_print_help_icon ('module_type', true);
$table_simple->data[1][0] .= html_print_input_hidden ('id_module_type_hidden', $id_module_type, true);
$in_policy = strstr($page, "policy_modules");
if (!$in_policy) {
$table_simple->data[1][0] = __('Module parent');
$table_simple->data[1][1] .= html_print_select_from_sql ('SELECT id_agente_modulo, nombre FROM tagente_modulo WHERE id_agente = ' . $id_agente . ' ORDER BY nombre',
'parent_module_id', $parent_module_id, '', __('Not assigned'), '0', true, false, true);
}
$table_simple->data[2][0] = __('Type').' ' . ui_print_help_icon ('module_type', true);
$table_simple->data[2][0] .= html_print_input_hidden ('id_module_type_hidden', $id_module_type, true);
if (isset($id_agent_module)) {
if ($id_agent_module) {
@ -183,8 +212,8 @@ if (!$edit) {
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
}
$table_simple->data[1][1] = '<em>'.modules_get_moduletype_description ($id_module_type).' ('.$type_names_hash[$id_module_type].')</em>';
$table_simple->data[1][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true);
$table_simple->data[2][1] = '<em>'.modules_get_moduletype_description ($id_module_type).' ('.$type_names_hash[$id_module_type].')</em>';
$table_simple->data[2][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true);
}
else {
if (isset($id_module_type)) {
@ -200,7 +229,7 @@ else {
ORDER BY descripcion',
implode (',', $categories));
$table_simple->data[1][1] = html_print_select_from_sql ($sql, 'id_module_type',
$table_simple->data[2][1] = html_print_select_from_sql ($sql, 'id_module_type',
$idModuleType, '', '', '', true, false, false, $disabledBecauseInPolicy, false, false, 100);
// Store the relation between id and name of the types on a hidden field
@ -217,81 +246,90 @@ else {
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
}
$table_simple->data[1][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true);
$table_simple->data[2][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true);
}
$table_simple->data[1][2] = __('Module group');
$table_simple->data[1][3] = html_print_select_from_sql ('SELECT id_mg, name FROM tmodule_group ORDER BY name',
'id_module_group', $id_module_group, '', __('Not assigned'), '0',
true, false, true, $disabledBecauseInPolicy);
if($disabledBecauseInPolicy){
$table_simple->data[1][3] .= html_print_input_hidden ('id_module_group', $id_module_group, true);
$table_simple->data[2][3] .= html_print_input_hidden ('id_module_group', $id_module_group, true);
}
$table_simple->data[3][0] = __('Dynamic Threshold Interval') .' ' . ui_print_help_icon ('dynamic_threshold', true);
$table_simple->data[3][1] = html_print_extended_select_for_time ('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px',false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
$table_simple->data[3][1] .= '<a onclick=advanced_option_dynamic()>' . html_print_image('images/cog.png', true, array('title' => __('Advanced options Dynamic Threshold'))) . '</a>';
$table_simple->data[2][0] = __('Warning status').' ' . ui_print_help_icon ('warning_status', true);
$table_simple->data[3][2] = '<span><em>'.__('Dynamic Threshold Min. ').'</em>';
$table_simple->data[3][2] .= html_print_input_text ('dynamic_min', $dynamic_min, '', 10, 255, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_simple->data[3][2] .= '<br /><em>'.__('Dynamic Threshold Max. ').'</em>';
$table_simple->data[3][2] .= html_print_input_text ('dynamic_max', $dynamic_max, '', 10, 255, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_simple->data[3][3] = '<span><em>'.__('Dynamic Threshold Two Tailed: ').'</em>';
$table_simple->data[3][3] .= html_print_checkbox ("dynamic_two_tailed", 1, $dynamic_two_tailed, true, $disabledBecauseInPolicy);
$table_simple->data[2][1] = '';
$table_simple->data[4][0] = __('Warning status').' ' . ui_print_help_icon ('warning_status', true);
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[2][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
$table_simple->data[2][1] .= html_print_input_text ('min_warning', $min_warning,
'', 10, 255, true, $disabledBecauseInPolicy);
$table_simple->data[2][1] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[2][1] .= html_print_input_text ('max_warning', $max_warning,
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
$table_simple->data[4][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
$table_simple->data[4][1] .= html_print_input_text ('min_warning', $min_warning, '', 10, 255, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_simple->data[4][1] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[4][1] .= html_print_input_text ('max_warning', $max_warning, '', 10, 255, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).'</span>';
}
if (modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[2][1] .= '<span id="string_warning"><em>'.__('Str.').'</em>';
$table_simple->data[2][1] .= html_print_input_text ('str_warning', $str_warning,
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
$table_simple->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').'</em>';
$table_simple->data[4][1] .= html_print_input_text ('str_warning', str_replace("\"","",$str_warning),
'', 10, 255, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).'</span>';
}
$table_simple->data[2][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[2][1] .= html_print_checkbox ("warning_inverse", 1,
$warning_inverse, true);
$table_simple->data[2][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true);
$table_simple->data[2][3] = '';
$table_simple->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true, $disabledBecauseInPolicy);
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[2][3] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
$table_simple->data[2][3] .= html_print_input_text ('min_critical', $min_critical,
'', 10, 255, true, $disabledBecauseInPolicy);
$table_simple->data[2][3] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[2][3] .= html_print_input_text ('max_critical', $max_critical,
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
$table_simple->data[4][2] = '<svg id="svg_dinamic" width="350" height="200" style="padding:40px; padding-left: 100px; margin-bottom: 60px;"> </svg>';
$table_simple->colspan[4][2] = 2;
$table_simple->rowspan[4][2] = 3;
}
$table_simple->data[5][0] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true);
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[5][1] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
$table_simple->data[5][1] .= html_print_input_text ('min_critical', $min_critical, '', 10, 255, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_simple->data[5][1] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[5][1] .= html_print_input_text ('max_critical', $max_critical, '', 10, 255, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).'</span>';
}
if (modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[2][3] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
$table_simple->data[2][3] .= html_print_input_text ('str_critical', $str_critical,
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
$table_simple->data[5][1] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
$table_simple->data[5][1] .= html_print_input_text ('str_critical', str_replace("\"","",$str_critical),
'', 10, 255, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy).'</span>';
}
$table_simple->data[2][3] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[2][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
$table_simple->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[5][1] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true, $disabledBecauseInPolicy);
/* FF stands for Flip-flop */
$table_simple->data[3][0] = __('FF threshold').' ' . ui_print_help_icon ('ff_threshold', true);
$table_simple->colspan[3][1] = 3;
$table_simple->data[6][0] = __('FF threshold').' ' . ui_print_help_icon ('ff_threshold', true);
$table_simple->colspan[5][1] = 3;
$table_simple->data[3][1] = html_print_radio_button ('each_ff', 0, '', $each_ff, true) . ' ' . __('All state changing') . ' : ';
$table_simple->data[3][1] .= html_print_input_text ('ff_event', $ff_event, '', 5
, 15, true, $disabledBecauseInPolicy) . '<br />';
$table_simple->data[3][1] .= html_print_radio_button ('each_ff', 1, '', $each_ff, true) . ' ' . __('Each state changing') . ' : ';
$table_simple->data[3][1] .= __('To normal');
$table_simple->data[3][1] .= html_print_input_text ('ff_event_normal', $ff_event_normal, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
$table_simple->data[3][1] .= __('To warning');
$table_simple->data[3][1] .= html_print_input_text ('ff_event_warning', $ff_event_warning, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
$table_simple->data[3][1] .= __('To critical');
$table_simple->data[3][1] .= html_print_input_text ('ff_event_critical', $ff_event_critical, '', 5, 15, true, $disabledBecauseInPolicy);
$table_simple->data[4][0] = __('Historical data');
$table_simple->data[6][1] = html_print_radio_button ('each_ff', 0, '', $each_ff, true, $disabledBecauseInPolicy) . ' ' . __('All state changing') . ' : ';
$table_simple->data[6][1] .= html_print_input_text ('ff_event', $ff_event, '', 5, 15, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy) . '<br />';
$table_simple->data[6][1] .= html_print_radio_button ('each_ff', 1, '', $each_ff, true, $disabledBecauseInPolicy) . ' ' . __('Each state changing') . ' : ';
$table_simple->data[6][1] .= __('To normal');
$table_simple->data[6][1] .= html_print_input_text ('ff_event_normal', $ff_event_normal, '', 5, 15, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy) . ' ';
$table_simple->data[6][1] .= __('To warning');
$table_simple->data[6][1] .= html_print_input_text ('ff_event_warning', $ff_event_warning, '', 5, 15, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy) . ' ';
$table_simple->data[6][1] .= __('To critical');
$table_simple->data[6][1] .= html_print_input_text ('ff_event_critical', $ff_event_critical, '', 5, 15, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_simple->data[7][0] = __('Historical data');
if($disabledBecauseInPolicy) {
// If is disabled, we send a hidden in his place and print a false checkbox because HTML dont send disabled fields and could be disabled by error
$table_simple->data[4][1] = html_print_checkbox ("history_data_fake", 1, $history_data, true, $disabledBecauseInPolicy);
$table_simple->data[4][1] .= '<input type="hidden" name="history_data" value="'.(int)$history_data.'">';
$table_simple->data[7][1] = html_print_checkbox ("history_data_fake", 1, $history_data, true, $disabledBecauseInPolicy);
$table_simple->data[7][1] .= '<input type="hidden" name="history_data" value="'.(int)$history_data.'">';
}
else {
$table_simple->data[4][1] = html_print_checkbox ("history_data", 1, $history_data, true, $disabledBecauseInPolicy);
$table_simple->data[7][1] = html_print_checkbox ("history_data", 1, $history_data, true, $disabledBecauseInPolicy);
}
/* Advanced form part */
@ -309,16 +347,16 @@ $table_advanced->colspan = array ();
$table_advanced->data[0][0] = __('Description');
$table_advanced->colspan[0][1] = 6;
$table_advanced->data[0][1] = html_print_textarea ('description', 2, 65,
$description, $disabledTextBecauseInPolicy, true);
$description, $disabledTextBecauseInPolicy, true, $largeClassDisabledBecauseInPolicy);
$table_advanced->data[1][0] = __('Custom ID');
$table_advanced->colspan[1][1] = 2;
$table_advanced->data[1][1] = html_print_input_text ('custom_id', $custom_id,
'', 20, 65, true);
$table_advanced->data[1][1] = html_print_input_text ('custom_id', $custom_id, '', 20, 65, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_advanced->data[1][3] = __('Unit');
$table_advanced->data[1][4] = html_print_input_text ('unit', $unit,
'', 20, 65, true);
$table_advanced->data[1][4] = html_print_input_text ('unit', $unit, '', 20, 65, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_advanced->colspan[1][4] = 3;
$module_id_policy_module = 0;
@ -357,7 +395,7 @@ if ($moduletype == MODULE_DATA) {
else {
$table_advanced->data[2][0] = __('Interval') . ui_print_help_icon ('module_interval', true);
$table_advanced->colspan[2][1] = 2;
$table_advanced->data[2][1] = html_print_extended_select_for_time ('module_interval' , $interval, '', '', '0', false, true, false, false);
$table_advanced->data[2][1] = html_print_extended_select_for_time ('module_interval' , $interval, '', '', '0', false, true, false, false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
}
$table_advanced->data[2][1] .= html_print_input_hidden ('moduletype', $moduletype, true);
@ -372,9 +410,9 @@ $table_advanced->colspan[2][4] = 3;
$table_advanced->data[3][0] = __('Min. Value');
$table_advanced->colspan[3][1] = 2;
$table_advanced->data[3][1] = html_print_input_text ('min', $min, '', 5, 15, true, $disabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Any value below this number is discarted.'), true);
$table_advanced->data[3][1] = html_print_input_text ('min', $min, '', 5, 15, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Any value below this number is discarted.'), true);
$table_advanced->data[3][3] = __('Max. Value');
$table_advanced->data[3][4] = html_print_input_text ('max', $max, '', 5, 15, true, $disabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Any value over this number is discarted.'), true);
$table_advanced->data[3][4] = html_print_input_text ('max', $max, '', 5, 15, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Any value over this number is discarted.'), true);
$table_advanced->colspan[3][4] = 3;
$table_advanced->data[4][0] = __('Export target');
@ -393,22 +431,22 @@ $table_advanced->colspan[4][1] = 2;
// Code comes from module_editor
if ($__code_from == 'modules') {
$throw_unknown_events_check =
!modules_is_disable_type_event($id_agent_module, EVENTS_GOING_UNKNOWN);
modules_is_disable_type_event($id_agent_module, EVENTS_GOING_UNKNOWN);
}
else {
global $__id_pol_mod;
$throw_unknown_events_check =
!policy_module_is_disable_type_event($__id_pol_mod, EVENTS_GOING_UNKNOWN);
policy_module_is_disable_type_event($__id_pol_mod, EVENTS_GOING_UNKNOWN);
}
$table_advanced->data[4][3] = __('Throw unknown events');
$table_advanced->data[4][3] = __('Discard unknown events');
$table_advanced->data[4][4] = html_print_checkbox('throw_unknown_events',
1, $throw_unknown_events_check, true);
1, $throw_unknown_events_check, true, $disabledBecauseInPolicy);
$table_advanced->colspan[4][4] = 3;
$table_advanced->data[5][0] = __('FF interval') . ' ' . ui_print_help_icon ('ff_interval', true);
$table_advanced->data[5][1] = html_print_input_text ('module_ff_interval', $ff_interval,
'', 5, 10, true, $disabledBecauseInPolicy) .
'', 5, 10, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy) .
ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true);
$table_advanced->colspan[5][1] = 2;
@ -460,7 +498,7 @@ if (!tags_has_user_acl_tags($config["id_user"])) {
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
ORDER BY name", 'id_tag_available[]', '', '','','',
true, true, false, false, 'width: 200px', '5');
true, true, false, $disabledBecauseInPolicy, 'width: 200px', '5');
}
else {
$user_tags = tags_get_user_tags($config["id_user"], "AW");
@ -476,7 +514,7 @@ else {
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
ORDER BY name", 'id_tag_available[]', '', '','','',
true, true, false, false, 'width: 200px', '5');
true, true, false, $disabledBecauseInPolicy, 'width: 200px', '5');
}
else {
$table_advanced->data[6][1] = html_print_select_from_sql (
@ -487,7 +525,7 @@ else {
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
ORDER BY name", 'id_tag_available[]', '', '','','',
true, true, false, false, 'width: 200px', '5');
true, true, false, $disabledBecauseInPolicy, 'width: 200px', '5');
}
}
$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add tags to module'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
@ -501,7 +539,7 @@ $table_advanced->data[6][4] = html_print_select_from_sql (
$__sql
ORDER BY name",
'id_tag_selected[]', '', '','','', true, true, false,
false, 'width: 200px', '5');
$disabledBecauseInPolicy, 'width: 200px', '5');
if ($__code_from == 'modules') {
$table_advanced->data[6][5] = '<b>' . __('Tags from policy') . '</b>';
@ -512,7 +550,7 @@ if ($__code_from == 'modules') {
$__sql_policy
ORDER BY name",
'id_tag_policy[]', '', '','','', true, true, false,
false, 'width: 200px', '5');
$disabledBecauseInPolicy, 'width: 200px', '5');
}
$table_advanced->data[7][0] = __('Quiet');
@ -520,51 +558,73 @@ $table_advanced->data[7][0] .= ui_print_help_tip(
__('The module still stores data but the alerts and events will be stop'), true);
$table_advanced->colspan[7][1] = 7;
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1,
$quiet_module, true);
$quiet_module, true, $disabledBecauseInPolicy);
$table_advanced->data[8][0] = __('Critical instructions') .
ui_print_help_tip(__("Instructions when the status is critical"), true);
$table_advanced->data[8][1] = html_print_textarea ('critical_instructions', 2, 65, $critical_instructions, '', true);
$table_advanced->data[8][1] = html_print_textarea ('critical_instructions', 2, 65, $critical_instructions, $disabledTextBecauseInPolicy, true, $largeClassDisabledBecauseInPolicy);
$table_advanced->colspan[8][1] = 6;
$table_advanced->data[9][0] = __('Warning instructions') .
ui_print_help_tip(__("Instructions when the status is warning"), true);
$table_advanced->data[9][1] = html_print_textarea ('warning_instructions', 2, 65, $warning_instructions, '', true);
$table_advanced->data[9][1] = html_print_textarea ('warning_instructions', 2, 65, $warning_instructions, $disabledTextBecauseInPolicy, true, $largeClassDisabledBecauseInPolicy);
$table_advanced->colspan[9][1] = 6;
$table_advanced->data[10][0] = __('Unknown instructions'). ui_print_help_tip(__("Instructions when the status is unknown"), true);
$table_advanced->data[10][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, '', true);
$table_advanced->data[10][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, $disabledTextBecauseInPolicy, true, $largeClassDisabledBecauseInPolicy);
$table_advanced->colspan[10][1] = 6;
if (isset($id_agente) && $moduletype == MODULE_DATA) {
$table_advanced->data[11][0] = __('Cron') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true, true);
$table_advanced->colspan[11][1] = 6;
$has_remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]));
if ($has_remote_conf) {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
$table_advanced->data[12][0] = __('Cron to');
$table_advanced->data[12][1] = html_print_extended_select_for_cron ($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, $disabledBecauseInPolicy, true);
$table_advanced->colspan[12][1] = 6;
}
else {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, true);
$table_advanced->colspan[11][1] = 6;
$table_advanced->data[12][0] = __('Cron to');
$table_advanced->data[12][1] = html_print_extended_select_for_cron ($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, true, true);
$table_advanced->colspan[12][1] = 6;
}
}
else {
$table_advanced->data[11][0] = __('Cron') .
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true, false);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
$table_advanced->data[12][0] = __('Cron to');
$table_advanced->data[12][1] = html_print_extended_select_for_cron ($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, $disabledBecauseInPolicy, true);
$table_advanced->colspan[12][1] = 6;
}
$table_advanced->data[12][0] = __('Timeout');
$table_advanced->data[12][1] = html_print_input_text ('max_timeout', $max_timeout, '', 5, 10, true). ' ' . ui_print_help_tip (__('Seconds that agent will wait for the execution of the module.'), true);
$table_advanced->data[12][2] = '';
$table_advanced->data[12][3] = __('Retries');
$table_advanced->data[12][4] = html_print_input_text ('max_retries', $max_retries, '', 5, 10, true). ' ' . ui_print_help_tip (__('Number of retries that the module will attempt to run.'), true);
$table_advanced->colspan[12][4] = 3;
$table_advanced->data[13][0] = __('Timeout');
$table_advanced->data[13][1] = html_print_input_text ('max_timeout', $max_timeout, '', 5, 10, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Seconds that agent will wait for the execution of the module.'), true);
$table_advanced->data[13][2] = '';
$table_advanced->data[13][3] = __('Retries');
$table_advanced->data[13][4] = html_print_input_text ('max_retries', $max_retries, '', 5, 10, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Number of retries that the module will attempt to run.'), true);
$table_advanced->colspan[13][4] = 3;
if (check_acl ($config['id_user'], 0, "PM")) {
$table_advanced->data[13][0] = __('Category');
$table_advanced->data[13][1] = html_print_select(
categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true);
$table_advanced->colspan[13][1] = 6;
$table_advanced->data[14][0] = __('Category');
$table_advanced->data[14][1] = html_print_select(
categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true, false, true, "", $disabledBecauseInPolicy);
$table_advanced->colspan[14][1] = 6;
}
else {
// Store in a hidden field if is not visible to avoid delete the value
$table_advanced->data[12][4] .= html_print_input_hidden ('id_category', $id_category, true);
$table_advanced->data[13][4] .= html_print_input_hidden ('id_category', $id_category, true);
}
/* Advanced form part */
@ -584,16 +644,21 @@ if (isset($module_macros)) {
if (is_array($module_macros)) {
foreach ($module_macros as $macro_name => $macro_value) {
$table_macros->data[$macro_count][0] = __('Name');
$table_macros->data[$macro_count][1] = html_print_input_text ('module_macro_names[]', $macro_name, '', 50, 60, true);
$table_macros->data[$macro_count][1] = html_print_input_text ('module_macro_names[]', $macro_name, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$table_macros->data[$macro_count][2] = __('Value');
$table_macros->data[$macro_count][3] = html_print_input_text ('module_macro_values[]', $macro_value, '', 50, 60, true);
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro(' . $macro_count . ');">' . html_print_image('images/cross.png', true) . '</a>';
$table_macros->data[$macro_count][3] = html_print_input_text ('module_macro_values[]', $macro_value, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
if(!$disabledBecauseInPolicy){
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro(' . $macro_count . ');">' . html_print_image('images/cross.png', true) . '</a>';
}
$macro_count++;
}
}
}
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png',true).'</a>';
$table_macros->colspan[$macro_count][0] = 5;
if(!$disabledBecauseInPolicy){
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png',true).'</a>';
$table_macros->colspan[$macro_count][0] = 5;
}
$macro_count++;
html_print_input_hidden ('module_macro_count', $macro_count);
@ -710,6 +775,7 @@ ui_require_jquery_file('json');
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
var disabledBecauseInPolicy = '<?php echo $disabledBecauseInPolicy ?>';
$("#right").click (function () {
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
tag_name = $(value).html();
@ -764,6 +830,7 @@ $(document).ready (function () {
$('#string_warning').hide();
$('#minmax_critical').show();
$('#minmax_warning').show();
$('#svg_dinamic').show();
}
else {
// String types
@ -771,6 +838,7 @@ $(document).ready (function () {
$('#string_warning').show();
$('#minmax_critical').hide();
$('#minmax_warning').hide();
$('#svg_dinamic').hide();
}
if (type_name_selected.match(/async/) == null) {
@ -800,9 +868,88 @@ $(document).ready (function () {
validate_post_process();
});
//Dynamic_interval;
disabled_status(disabledBecauseInPolicy);
$('#dynamic_interval_select').change (function() {
disabled_status(disabledBecauseInPolicy);
});
//Dynamic_options_advance;
$('#simple-2-2').hide();
$('#simple-2-3').hide();
//paint graph stutus critical and warning:
paint_graph_values();
$('#text-min_warning').on ('input', function() {
paint_graph_values();
if (isNaN($('#text-min_warning').val()) && !($('#text-min_warning').val() == "-")){
$('#text-min_warning').val(0);
}
});
$('#text-max_warning').on ('input', function() {
paint_graph_values();
if (isNaN($('#text-max_warning').val()) && !($('#text-max_warning').val() == "-")){
$('#text-max_warning').val(0);
}
});
$('#text-min_critical').on ('input', function() {
paint_graph_values();
if (isNaN($('#text-min_critical').val()) && !($('#text-min_critical').val() == "-")){
$('#text-min_critical').val(0);
}
});
$('#text-max_critical').on ('input', function() {
paint_graph_values();
if (isNaN($('#text-max_critical').val()) && !($('#text-max_critical').val() == "-")){
$('#text-max_critical').val(0);
}
});
$('#checkbox-warning_inverse').change (function() {
paint_graph_values();
});
$('#checkbox-critical_inverse').change (function() {
paint_graph_values();
});
});
// Add a new module macro
//readonly and add class input
function disabled_status (disabledBecauseInPolicy) {
if($('#dynamic_interval_select').val() != 0){
$('#text-min_warning').prop('readonly', true);
$('#text-min_warning').addClass('readonly');
$('#text-max_warning').prop('readonly', true);
$('#text-max_warning').addClass('readonly');
$('#text-min_critical').prop('readonly', true);
$('#text-min_critical').addClass('readonly');
$('#text-max_critical').prop('readonly', true);
$('#text-max_critical').addClass('readonly');
} else {
if (!disabledBecauseInPolicy){
$('#text-min_warning').prop('readonly', false);
$('#text-min_warning').removeClass('readonly');
$('#text-max_warning').prop('readonly', false);
$('#text-max_warning').removeClass('readonly');
$('#text-min_critical').prop('readonly', false);
$('#text-min_critical').removeClass('readonly');
$('#text-max_critical').prop('readonly', false);
$('#text-max_critical').removeClass('readonly');
}
}
}
//Dynamic_options_advance;
function advanced_option_dynamic() {
if($('#simple-2-2').is(":visible")){
$('#simple-2-2').hide();
$('#simple-2-3').hide();
} else {
$('#simple-2-2').show();
$('#simple-2-3').show();
}
}
//Add a new module macro
function add_macro () {
var macro_count = parseInt($("#hidden-module_macro_count").val());
var delete_icon = '<?php html_print_image ("images/cross.png", false) ?>';
@ -1029,6 +1176,312 @@ function validate_post_process() {
$("#text-post_process").val(new_post_process);
}
//function paint graph
function paint_graph_values(){
//Parse integrer
var min_w = parseInt($('#text-min_warning').val());
if(min_w == '0.00'){ min_w = 0; }
var max_w = parseInt($('#text-max_warning').val());
if(max_w == '0.00'){ max_w = 0; }
var min_c = parseInt($('#text-min_critical').val());
if(min_c =='0.00'){ min_c = 0; }
var max_c = parseInt($('#text-max_critical').val());
if(max_c =='0.00'){ max_c = 0; }
var inverse_w = $('input:checkbox[name=warning_inverse]:checked').val();
if(!inverse_w){ inverse_w = 0; }
var inverse_c = $('input:checkbox[name=critical_inverse]:checked').val();
if(!inverse_c){ inverse_c = 0; }
//inicialiced error
var error_w = 0;
var error_c = 0;
//if haven't error
if(max_w == 0 || max_w > min_w){
if(max_c == 0 || max_c > min_c){
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, error_w, error_c);
} else {
error_c = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c);
}
} else {
error_w = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c);
}
}
//function use d3.js for paint graph
function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, error_w, error_c) {
//Check if they are numbers
if(isNaN(min_w)){ min_w = 0; };
if(isNaN(max_w)){ max_w = 0; };
if(isNaN(min_c)){ min_c = 0; };
if(isNaN(max_c)){ max_c = 0; };
//messages legend
var legend_normal = '<?php echo __("Normal Status");?>';
var legend_warning = '<?php echo __("Warning Status");?>';
var legend_critical = '<?php echo __("Critical Status");?>';
//remove elements
d3.select("#svg_dinamic rect").remove();
$("#text-max_warning").removeClass("input_error");
$("#text-max_critical").removeClass("input_error");
//if haven't errors
if (error_w == 0 && error_c == 0){
//parse element
min_w = parseInt(min_w);
min_c = parseInt(min_c);
max_w = parseInt(max_w);
max_c = parseInt(max_c);
//inicialize var
var range_min = 0;
var range_max = 0;
var range_max_min = 0;
var range_max_min = 0;
//Find the lowest possible value
if(min_w < 0 || min_c < 0){
if(min_w < min_c){
range_min = min_w - 100;
} else {
range_min = min_c - 100;
}
} else if (min_w > 0 || min_c > 0) {
if(min_w > min_c){
range_max_min = min_w;
} else {
range_max_min = min_c;
}
} else {
if(min_w < min_c){
range_min = min_w - 100;
} else {
range_min = min_c - 100;
}
}
//Find the maximum possible value
if(max_w > max_c){
range_max = max_w + 100 + range_max_min;
} else {
range_max = max_c + 100 + range_max_min;
}
//Controls whether the maximum = 0 is infinite
if((max_w == 0 || max_w == 0.00) && min_w != 0){
max_w = range_max;
}
if((max_c == 0 || max_c == 0.00) && min_c != 0){
max_c = range_max;
}
//Scale according to the position
position = 200 / (range_max-range_min);
//axes
var yScale = d3.scale.linear()
.domain([range_min, range_max])
.range([100, -100]);
var yAxis = d3.svg.axis()
.orient("left")
.scale(yScale);
//create svg
var svg = d3.select("#svg_dinamic");
//delete elements
svg.selectAll("g").remove();
svg.selectAll("rect").remove();
svg.selectAll("text").remove();
svg.append("g")
.attr("transform", "translate(0, 100)")
.call(yAxis);
//legend Normal text
svg.append("text")
.attr("x", 0)
.attr("y", -20)
.attr("fill", 'black')
.style("font-family", "arial")
.style("font-weight", "bold")
.style("font-size", 10)
.html(legend_normal)
.style("text-anchor", "first");
//legend Normal rect
svg.append("rect")
.attr("id", "legend_normal")
.attr("x", 72)
.attr("y", -30)
.attr("width", 10)
.attr("height", 10)
.style("fill", "#82B92E");
//legend Warning text
svg.append("text")
.attr("x", 91)
.attr("y", -20)
.attr("fill", 'black')
.style("font-family", "arial")
.style("font-weight", "bold")
.style("font-size", 10)
.html(legend_warning)
.style("text-anchor", "first");
//legend Warning rect
svg.append("rect")
.attr("id", "legend_warning")
.attr("x", 168)
.attr("y", -30)
.attr("width", 10)
.attr("height", 10)
.style("fill", "#ffd731");
//legend Critical text
svg.append("text")
.attr("x", 187)
.attr("y", -20)
.attr("fill", 'black')
.style("font-family", "arial")
.style("font-weight", "bold")
.style("font-size", 10)
.html(legend_critical)
.style("text-anchor", "first");
//legend critical rect
svg.append("rect")
.attr("id", "legend_critical")
.attr("x", 258)
.attr("y", -30)
.attr("width", 10)
.attr("height", 10)
.style("fill", "#fc4444");
//styles for number and axes
svg.selectAll("g .domain")
.style("stroke-width", 2)
.style("fill", "none")
.style("stroke", "black");
svg.selectAll("g .tick text")
.style("font-size", "9pt")
.style("font-weight", "initial");
//estatus normal
svg.append("rect")
.attr("id", "warning_rect")
.attr("x", 3)
.attr("y", 0)
.attr("width", 300)
.attr("height", 200)
.style("fill", "#82B92E");
//controls the inverse warning
if(inverse_w == 0){
svg.append("rect").transition()
.duration(600)
.attr("id", "warning_rect")
.attr("x", 3)
.attr("y", ((range_max - min_w) * position) - ((max_w - min_w) * position))
.attr("width", 300)
.attr("height", ((max_w - min_w) * position))
.style("fill", "#ffd731");
}
else {
svg.append("rect").transition()
.duration(600)
.attr("id", "warning_rect")
.attr("x", 3)
.attr("y", 200 - ((min_w -range_min) * position))
.attr("width", 300)
.attr("height", (min_w -range_min) * position)
.style("fill", "#ffd731");
svg.append("rect").transition()
.duration(600)
.attr("id", "warning_inverse_rect")
.attr("x", 3)
.attr("y", 0)
.attr("width", 300)
.attr("height", ((range_max - min_w) * position) - ((max_w - min_w) * position))
.style("fill", "#ffd731");
}
//controls the inverse critical
if(inverse_c == 0){
svg.append("rect").transition()
.duration(600)
.attr("id", "critical_rect")
.attr("x", 3)
.attr("y", ((range_max - min_c) * position) - ((max_c - min_c) * position))
.attr("width", 300)
.attr("height", ((max_c - min_c) * position))
.style("fill", "#fc4444");
}
else {
svg.append("rect").transition()
.duration(600)
.attr("id", "critical_rect")
.attr("x", 3)
.attr("y", 200 - ((min_c -range_min) * position))
.attr("width", 300)
.attr("height", (min_c -range_min) * position)
.style("fill", "#fc4444");
svg.append("rect").transition()
.duration(600)
.attr("id", "critical_inverse_rect")
.attr("x", 3)
.attr("y", 0)
.attr("width", 300)
.attr("height", ((range_max - min_c) * position) - ((max_c - min_c) * position))
.style("fill", "#fc4444");
}
}
else {
var message_error_warning = '<?php echo __("Please introduce a maximum warning higher than the minimun warning") ?>';
var message_error_critical = '<?php echo __("Please introduce a maximum critical higher than the minimun critical") ?>';
d3.select("#svg_dinamic rect").remove();
//create svg
var svg = d3.select("#svg_dinamic");
svg.selectAll("g").remove();
svg.selectAll("rect").remove();
svg.selectAll("text").remove();
//message error warning
if (error_w == 1) {
$("#text-max_warning").addClass("input_error");
svg.append("text")
.attr("x", -90)
.attr("y", 10)
.attr("fill", 'black')
.style("font-family", "arial")
.style("font-weight", "bold")
.style("font-size", 14)
.style("fill", "red")
.html(message_error_warning)
.style("text-anchor", "first");
}
//message error critical
if (error_c == 1) {
$("#text-max_critical").addClass("input_error");
svg.append("text")
.attr("x", -90)
.attr("y", 105)
.attr("fill", 'black')
.style("font-family", "arial")
.style("font-weight", "bold")
.style("font-size", 14)
.style("fill", "red")
.html(message_error_critical)
.style("text-anchor", "first");
}
}
}
/* End of relationship javascript */
/* ]]> */

View File

@ -33,6 +33,8 @@ $isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
$disabledBecauseInPolicy = false;
$disabledTextBecauseInPolicy = '';
$classdisabledBecauseInPolicy = '';
$largeclassdisabledBecauseInPolicy = '';
$page = get_parameter('page', '');
if (strstr($page, "policy_modules") === false) {
if ($config['enterprise_installed']) {
@ -41,8 +43,12 @@ if (strstr($page, "policy_modules") === false) {
else {
$disabledBecauseInPolicy = false;
}
if ($disabledBecauseInPolicy)
$disabledTextBecauseInPolicy = 'disabled = "disabled"';
if ($disabledBecauseInPolicy){
$disabledTextBecauseInPolicy = 'readonly = "yes"';
$classdisabledBecauseInPolicy = 'readonly';
$largeclassdisabledBecauseInPolicy = 'class = readonly';
}
}
define ('ID_NETWORK_COMPONENT_TYPE', 2);
@ -59,7 +65,37 @@ $extra_title = __('Network server module');
$data = array ();
$data[0] = __('Target IP');
$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
//show agent_for defect;
if($page == 'enterprise/godmode/policies/policy_modules'){
if($ip_target != 'auto' && $ip_target != ''){
$custom_ip_target = $ip_target;
$ip_target = 'custom';
}
elseif($ip_target == ''){
$ip_target = 'force_pri';
$custom_ip_target = '';
}
else{
$custom_ip_target = '';
}
$target_ip_values = array();
$target_ip_values['auto'] = __('Auto');
$target_ip_values['force_pri'] = __('Force primary key');
$target_ip_values['custom'] = __('Custom');
$data[1] = html_print_select ($target_ip_values, 'ip_target', $ip_target, '', '', '',
true, false, false, '', false, 'width:200px;');
$data[1] .= html_print_input_text ('custom_ip_target', $custom_ip_target, '', 15, 60, true);
}
else{
if($ip_target == 'auto'){
$ip_target = agents_get_address ($id_agente);
}
$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
}
// In ICMP modules, port is not configurable
if ($id_module_type >= 6 && $id_module_type <= 7) {
@ -68,7 +104,8 @@ if ($id_module_type >= 6 && $id_module_type <= 7) {
}
else {
$data[2] = __('Port');
$data[3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true, $disabledBecauseInPolicy);
$data[3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 20, true, $disabledBecauseInPolicy,
false, '', $classdisabledBecauseInPolicy);
}
push_table_simple ($data, 'target_ip');
@ -85,7 +122,8 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && isset($id_agent_module)) {
$adopt = policies_is_module_adopt($id_agent_module);
}
if (!$adopt) {
$data[1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true, $disabledBecauseInPolicy);
$data[1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true, $disabledBecauseInPolicy,
false, '', $classdisabledBecauseInPolicy);
}
else {
$data[1] = html_print_input_text ('snmp_community', $snmp_community, '', 15, 60, true, false);
@ -95,11 +133,13 @@ $data[2] = _('SNMP version');
if ($id_module_type >= 15 && $id_module_type <= 18) {
$data[3] = html_print_select ($snmp_versions, 'snmp_version', $tcp_send,
'', '', '', true, false, false, '', $disabledBecauseInPolicy);
'', '', '', true, false, false, '', $disabledBecauseInPolicy,
false, '', $classdisabledBecauseInPolicy);
}
else {
$data[3] = html_print_select ($snmp_versions, 'snmp_version', 0, '', '',
'', true, false, false, '', $disabledBecauseInPolicy);
'', true, false, false, '', $disabledBecauseInPolicy,
false, '', $classdisabledBecauseInPolicy);
}
if($disabledBecauseInPolicy){
if ($id_module_type >= 15 && $id_module_type <= 18) {
@ -111,7 +151,8 @@ push_table_simple ($data, 'snmp_1');
$data = array ();
$data[0] = __('SNMP OID');
$data[1] = '<span class="left"; style="width: 50%">';
$data[1] .= html_print_input_text ('snmp_oid', $snmp_oid, '', 30, 255, true, $disabledBecauseInPolicy);
$data[1] .= html_print_input_text ('snmp_oid', $snmp_oid, '', 30, 255, true, $disabledBecauseInPolicy,
false, '', $classdisabledBecauseInPolicy);
$data[1] .= '<span class="invisible" id="oid">';
$data[1] .= html_print_select (array (), 'select_snmp_oid', $snmp_oid, '', '', 0, true, false, false, '', $disabledBecauseInPolicy);
$data[1] .= html_print_image("images/edit.png", true, array("class" => "invisible clickable", "id" => "edit_oid"));
@ -128,13 +169,13 @@ push_table_simple ($data, 'snmp_2');
/* Advanced stuff */
$data = array ();
$data[0] = __('TCP send') . ' ' . ui_print_help_icon ("tcp_send", true);
$data[1] = html_print_textarea ('tcp_send', 2, 65, $tcp_send, $disabledTextBecauseInPolicy, true);
$data[1] = html_print_textarea ('tcp_send', 2, 65, $tcp_send, $disabledTextBecauseInPolicy, true, $largeclassdisabledBecauseInPolicy);
$table_simple->colspan['tcp_send'][1] = 3;
push_table_simple ($data, 'tcp_send');
$data[0] = __('TCP receive');
$data[1] = html_print_textarea ('tcp_rcv', 2, 65, $tcp_rcv, $disabledTextBecauseInPolicy, true);
$data[1] = html_print_textarea ('tcp_rcv', 2, 65, $tcp_rcv, $disabledTextBecauseInPolicy, true, $largeclassdisabledBecauseInPolicy);
$table_simple->colspan['tcp_receive'][1] = 3;
push_table_simple ($data, 'tcp_receive');
@ -173,27 +214,31 @@ else if ($id_agent_module === false) {
$data = array();
$data[0] = __('Auth user');
$data[1] = html_print_input_text ('snmp3_auth_user', $snmp3_auth_user, '', 15, 60, true);
$data[1] = html_print_input_text ('snmp3_auth_user', $snmp3_auth_user, '', 15, 60, true, $disabledBecauseInPolicy,
false, '', $classdisabledBecauseInPolicy);
$data[2] = __('Auth password') . ui_print_help_tip(__("The pass length must be eight character minimum."), true);
$data[3] = html_print_input_password ('snmp3_auth_pass', $snmp3_auth_pass, '', 15, 60, true);
$data[3] = html_print_input_password ('snmp3_auth_pass', $snmp3_auth_pass, '', 15, 60, true, $disabledBecauseInPolicy,
false, $largeclassdisabledBecauseInPolicy);
$data[3] .= html_print_input_hidden('active_snmp_v3', 0, true);
if ($snmp_version != 3) $table_simple->rowstyle['field_snmpv3_row1'] = 'display: none;';
push_table_simple($data, 'field_snmpv3_row1');
$data = array();
$data[0] = __('Privacy method');
$data[1] = html_print_select(array('DES' => __('DES'), 'AES' => __('AES')), 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true);
$data[1] = html_print_select(array('DES' => __('DES'), 'AES' => __('AES')), 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', $disabledBecauseInPolicy);
$data[2] = __('Privacy pass') . ui_print_help_tip(__("The pass length must be eight character minimum."), true);
$data[3] = html_print_input_password ('snmp3_privacy_pass', $snmp3_privacy_pass, '', 15, 60, true);
$data[3] = html_print_input_password ('snmp3_privacy_pass', $snmp3_privacy_pass, '', 15, 60, true, $disabledBecauseInPolicy,
false, $largeclassdisabledBecauseInPolicy);
if ($snmp_version != 3) $table_simple->rowstyle['field_snmpv3_row2'] = 'display: none;';
push_table_simple($data, 'field_snmpv3_row2');
$data = array();
$data[0] = __('Auth method');
$data[1] = html_print_select(array('MD5' => __('MD5'), 'SHA' => __('SHA')), 'snmp3_auth_method', $snmp3_auth_method, '', '', '', true);
$data[1] = html_print_select(array('MD5' => __('MD5'), 'SHA' => __('SHA')), 'snmp3_auth_method', $snmp3_auth_method, '', '', '', true, false, false, '', $disabledBecauseInPolicy);
$data[2] = __('Security level');
$data[3] = html_print_select(array('noAuthNoPriv' => __('Not auth and not privacy method'),
'authNoPriv' => __('Auth and not privacy method'), 'authPriv' => __('Auth and privacy method')), 'snmp3_security_level', $snmp3_security_level, '', '', '', true);
'authNoPriv' => __('Auth and not privacy method'), 'authPriv' => __('Auth and privacy method')), 'snmp3_security_level', $snmp3_security_level, '', '', '', true, false, false, '', $disabledBecauseInPolicy);
if ($snmp_version != 3)
$table_simple->rowstyle['field_snmpv3_row3'] = 'display: none;';
push_table_simple($data, 'field_snmpv3_row3');
@ -203,6 +248,24 @@ snmp_browser_print_container (false, '100%', '60%', 'none');
?>
<script type="text/javascript">
$(document).ready (function () {
$("#id_module_type").change(function (){
if ((this.value == "17") || (this.value == "18") || (this.value == "16") || (this.value == "15")) {
if ($("#snmp_version").val() == "3"){
$("#simple-field_snmpv3_row1").attr("style", "");
$("#simple-field_snmpv3_row2").attr("style", "");
$("#simple-field_snmpv3_row3").attr("style", "");
$("input[name=active_snmp_v3]").val(1);
$("input[name=snmp_community]").attr("disabled", true);
}
} else {
$("#simple-field_snmpv3_row1").css("display", "none");
$("#simple-field_snmpv3_row2").css("display", "none");
$("#simple-field_snmpv3_row3").css("display", "none");
$("input[name=active_snmp_v3]").val(0);
$("input[name=snmp_community]").removeAttr('disabled');
}
});
$("#snmp_version").change(function () {
if (this.value == "3") {
$("#simple-field_snmpv3_row1").attr("style", "");
@ -314,6 +377,18 @@ $(document).ready (function () {
$('#snmp3_browser_privacy_pass').keyup(function() {
$('#snmp3_privacy_pass').val($(this).val());
});
var custom_ip_target = "<?php echo $custom_ip_target?>";
if(custom_ip_target == ''){
$("#text-custom_ip_target").hide();
}
$('#ip_target').change(function() {
if($(this).val() == 'custom') {
$("#text-custom_ip_target").show();
}
else{
$("#text-custom_ip_target").hide();
}
});
});
// Show the SNMP browser window

View File

@ -21,14 +21,17 @@ $macros = $module['macros'];
$disabledBecauseInPolicy = false;
$disabledTextBecauseInPolicy = '';
$classdisabledBecauseInPolicy = '';
$page = get_parameter('page', '');
if (strstr($page, "policy_modules") === false) {
if ($config['enterprise_installed'])
$disabledBecauseInPolicy = policies_is_module_in_policy($id_agent_module) && policies_is_module_linked($id_agent_module);
else
$disabledBecauseInPolicy = false;
if ($disabledBecauseInPolicy)
$disabledTextBecauseInPolicy = 'disabled = "disabled"';
if ($disabledBecauseInPolicy){
$disabledTextBecauseInPolicy = 'readonly = "readonly"';
$classdisabledBecauseInPolicy = 'readonly';
}
}
define ('ID_NETWORK_COMPONENT_TYPE', 4);
@ -93,7 +96,8 @@ if (!empty($macros)) {
$data[1] = html_print_input_password($m['macro'], io_output_password($m['value']), '', 100, 255, true);
}
else {
$data[1] = html_print_input_text($m['macro'], $m['value'], '', 100, 255, true);
$data[1] = html_print_input_text($m['macro'], $m['value'], '', 100, 255, true,
$disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
}
$table_simple->colspan['macro'.$m['macro']][1] = 3;
$table_simple->rowclass['macro'.$m['macro']] = 'macro_field';

View File

@ -30,7 +30,6 @@ $row = db_get_row_sql($sql);
$is_service = false;
$is_synthetic = false;
$is_synthetic_avg = false;
$is_netflow = false;
$ops = false;
if ($row !== false && is_array($row)) {
$prediction_module = $row['prediction_module'];
@ -69,10 +68,6 @@ if ($row !== false && is_array($row)) {
$custom_integer_1 = 0;
$custom_integer_2 = 0;
break;
case MODULE_PREDICTION_NETFLOW:
$is_netflow = true;
$custom_integer_2 = 0;
break;
default:
$prediction_module = $custom_integer_1;
break;
@ -97,7 +92,7 @@ $data[0] = __('Source module');
$data[0] .= ui_print_help_icon ('prediction_source_module', true);
$data[1] = '';
// Services and Synthetic are an Enterprise feature.
$module_service_synthetic_selector = enterprise_hook('get_module_service_synthetic_selector', array($is_service, $is_synthetic, $is_synthetic_avg, $is_netflow));
$module_service_synthetic_selector = enterprise_hook('get_module_service_synthetic_selector', array($is_service, $is_synthetic, $is_synthetic_avg));
if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
$data[1] = $module_service_synthetic_selector;

View File

@ -16,14 +16,17 @@ enterprise_include_once('include/functions_policies.php');
$disabledBecauseInPolicy = false;
$disabledTextBecauseInPolicy = '';
$classdisabledBecauseInPolicy = '';
$page = get_parameter('page', '');
if (strstr($page, "policy_modules") === false) {
if ($config['enterprise_installed'])
$disabledBecauseInPolicy = policies_is_module_in_policy($id_agent_module) && policies_is_module_linked($id_agent_module);
else
$disabledBecauseInPolicy = false;
if ($disabledBecauseInPolicy)
$disabledTextBecauseInPolicy = 'disabled = "disabled"';
if ($disabledBecauseInPolicy){
$disabledTextBecauseInPolicy = 'readonly = "readonly"';
$classdisabledBecauseInPolicy = 'readonly';
}
}
$extra_title = __('WMI server module');
@ -43,22 +46,25 @@ $data[0] = __('Target IP');
$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
$data[2] = __('Namespace');
$data[2] .= ui_print_help_icon ('wminamespace', true);
$data[3] = html_print_input_text ('tcp_send', $tcp_send, '', 5, 20, true, $disabledBecauseInPolicy);
$data[3] = html_print_input_text ('tcp_send', $tcp_send, '', 5, 20, true, $disabledBecauseInPolicy, false,
'', $classdisabledBecauseInPolicy);
push_table_simple ($data, 'target_ip');
$data = array ();
$data[0] = __('Username');
$data[1] = html_print_input_text ('plugin_user', $plugin_user, '', 15, 60, true);
$data[1] = html_print_input_text ('plugin_user', $plugin_user, '', 15, 60, true, $disabledBecauseInPolicy, false,
'', $classdisabledBecauseInPolicy);
$data[2] = __('Password');
$data[3] = html_print_input_password ('plugin_pass', $plugin_pass, '', 15, 60, true);
$data[3] = html_print_input_password ('plugin_pass', $plugin_pass, '', 15, 60, true, $disabledBecauseInPolicy, false,
'', $classdisabledBecauseInPolicy);
push_table_simple ($data, 'user_pass');
$data = array ();
$data[0] = __('WMI query');
$data[0] .= ui_print_help_icon ('wmiquery', true);
$data[1] = html_print_input_text ('snmp_oid', $snmp_oid, '', 35, 255, true, $disabledBecauseInPolicy);
$data[1] = html_print_input_text ('snmp_oid', $snmp_oid, '', 35, 255, true, $disabledBecauseInPolicy, false,
'', $classdisabledBecauseInPolicy);
$table_simple->colspan['wmi_query'][1] = 3;
push_table_simple ($data, 'wmi_query');
@ -66,10 +72,12 @@ push_table_simple ($data, 'wmi_query');
$data = array ();
$data[0] = __('Key string');
$data[0] .= ui_print_help_icon ('wmikey', true);
$data[1] = html_print_input_text ('snmp_community', $snmp_community, '', 20, 60, true, $disabledBecauseInPolicy);
$data[1] = html_print_input_text ('snmp_community', $snmp_community, '', 20, 60, true, $disabledBecauseInPolicy, false,
'', $classdisabledBecauseInPolicy);
$data[2] = __('Field number');
$data[2] .= ui_print_help_icon ('wmifield', true);
$data[3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 15, true, $disabledBecauseInPolicy);
$data[3] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 15, true, $disabledBecauseInPolicy, false,
'', $classdisabledBecauseInPolicy);
push_table_simple ($data, 'key_field');
?>

View File

@ -47,6 +47,10 @@ ui_print_page_header(
true,
$buttons);
//recursion group filter
$recursion = get_parameter('recursion', $_POST['recursion']);
//Initialize data
$id_group = (int) get_parameter ('id_group');
$name = (string) get_parameter ('name');
@ -628,7 +632,7 @@ echo '</form>';
if ($id_downtime > 0) {
echo "<td valign=top>";
echo "<td valign=top style='width:300px;padding-left:20px;'>";
// Show available agents to include into downtime
echo '<h4>' . __('Available agents') . ':</h4>';
@ -643,8 +647,31 @@ if ($id_downtime > 0) {
}
$filter_cond = '';
if ($filter_group > 0)
$filter_cond = " AND id_grupo = $filter_group ";
if ($filter_group > 0){
if($recursion){
$rg = groups_get_id_recursive($filter_group, true);
$filter_cond .= " AND id_grupo IN (";
$i = 0;
$len = count($rg);
foreach ($rg as $key) {
if ($i == $len - 1) {
$filter_cond .= $key.")";
}else{
$i++;
$filter_cond .= $key.",";
}
}
}
else{
$filter_cond = " AND id_grupo = $filter_group ";
}
}
$sql = sprintf("SELECT tagente.id_agente, tagente.alias
FROM tagente
WHERE tagente.id_agente NOT IN (
@ -671,17 +698,19 @@ if ($id_downtime > 0) {
$disabled_add_button = true;
}
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;width:180px;max-width:180px;margin-right:15px;');
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'width:180px');
html_print_checkbox ("recursion", 1, $recursion, false, false, '');
echo __('Recursion') . '&nbsp;';
echo "<br /><br />";
html_print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false);
echo "</form>";
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
echo html_print_select ($agents, "id_agents[]", '', '', '', 0, false, true, true, '', false, 'width: 180px;');
echo html_print_select ($agents, "id_agents[]", -1, '', _("Any"), -2, false, true, true, '', false, 'width: 180px;');
echo '<h4>' . __('Available modules:') .
ui_print_help_tip (__('Only for type Quiet for downtimes.'), true) . '</h4>';

View File

@ -149,7 +149,7 @@ if ($create_action) {
$fields_values = array();
$info_fields = '';
$values = array();
for($i=1;$i<=10;$i++) {
for($i=1;$i<=$config['max_macro_fields'];$i++) {
$values['field'.$i] = (string) get_parameter ('field'.$i.'_value');
$info_fields .= ' Field'.$i.': ' . $values['field'.$i];
$values['field'.$i.'_recovery'] = (string) get_parameter ('field'.$i.'_recovery_value');
@ -228,7 +228,7 @@ if ($update_action) {
$info_fields = '';
$values = array();
for ($i = 1; $i <= 10; $i++) {
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$values['field'.$i] = (string) get_parameter ('field'.$i.'_value');
$info_fields .= ' Field1: ' . $values['field'.$i];
$values['field'.$i.'_recovery'] = (string) get_parameter ('field'.$i.'_recovery_value');

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