Merge branch 'develop' into feature/rolling_release

Conflicts:
	pandora_console/general/header.php
	pandora_console/include/functions.php
	pandora_console/index.php
	pandora_console/pandoradb_data.sql
This commit is contained in:
Arturo Gonzalez 2017-02-13 14:19:25 +01:00
commit 5b7f4a5139
715 changed files with 155345 additions and 118667 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,33 +1,7 @@
sudo: required
language: python
python:
- 2.7
env:
global:
- secure: "MEfyEpYEBkPmgPYX3CDKhaoiOltH5lDcUOYZ/19Yflg6ee20IBZOywCmrKH7VouKlOHUrGTUQqHBou0npm93qBju3MrPCE2R62PiDV2EHCGl3AFpLkgt0m1/DceWCWKlL+gI8uvnEFzVUuaPm6cEcRn1ikzg5b084bTxJ2B1Bvs="
- SAUCE_USERNAME="artica_pandorafms"
addons:
firefox: "latest"
sauce_connect: true
services:
- docker
before_install:
- sudo apt-get install xvfb
install:
- pip install selenium PyVirtualDisplay sauceclient
#before_script:
# - "export DISPLAY=:99.0"
# - "sh -e /etc/init.d/xvfb start"
# - sleep 4 # give xvfb some time to start
script:
- docker run --name pandorafms -h pandorafms -dt -v "$TRAVIS_BUILD_DIR:/tmp/pandorafms" -p 127.0.0.1:80:80 pandorafms/pandorafms-base tail -f /var/log/messages
- docker exec -t pandorafms /tmp/pandorafms/tests/test.sh
- python $TRAVIS_BUILD_DIR/tests/run_console_tests.py
- docker run --rm -h pandorafms -t -v "$TRAVIS_BUILD_DIR:/tmp/pandorafms" pandorafms/pandorafms-base /tmp/pandorafms/tests/test.sh

View File

@ -1,21 +1,25 @@
[![Build Status](https://travis-ci.org/pandorafms/pandorafms.svg?branch=develop)](https://travis-ci.org/pandorafms/pandorafms)
<a href="http://pandorafms.com"><img src="http://pandorafms.com/github/logo_2.png" align="left" hspace="10" vspace="6"></a>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. 
<br />
[![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.
### Support
For community support you can visit our forums at http://forums.pandorafms.org. Visit our community page at http://pandorafms.org and if you need commercial information or/and professional support visit http://pandorafms.com.
<br />
<br />
###How to install Pandora FMS
### How to install Pandora FMS
Installing Pandora FMS is a very easy task. Please visit our wiki and follow all the steps described for a quick and proper installation. http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Installing
###What is Pandora FMS?
### What is Pandora FMS?
Pandora FMS is a monitoring application to watch systems and applications that allows to know the status of any element of the business systems. Pandora FMS watches your hardware, software, your multilayer system and, of course, your OS. Pandora FMS can detect if a network interface is down or the movement of any NASDAQ new technology market value. If you wish, Pandora FMS can send a SMS message when your system or your application fails or when Google stock value drops below 330 US$. Pandora FMS will fit your systems and requirements, because it has been designed to be open, modular, multiplattform and easy to customize.
###Other things Pandora FMS can do
### Other things Pandora FMS can do
Pandora FMS is a monitoring tool that not only measures if a parameter is right or wrong. Pandora FMS can quantify the state (right or wrong), or store a value (numeric or alphanumeric) for months if necessary. Pandora FMS can measure performances, compare values among different systems and set alarms over thresholds. Pandora FMS works against a Database so it can generate reports, statistics, SLA and meausre anything: OS, applications and hardware systems, such as firewalls, proxies, Databases, web servers, VPN, routers, switches, processes, services, remote accesses to servers, etc. Everything integrated in an open and distributed architecture. Pandora FMS can be deployed over any OS, with specific agents for each platform. There are agents for Windows (2000, XP, 2003), GNU/Linux, Solaris, HP-UX, BSD, AIX, IPSO and OpenWRT. Pandora FMS not only gathers information through its agents, but it can also monitor any hardware system with TCP/IP connectivity, such as load balancing systems, routers, switches or printers, through SNMP and TCP/ICMP checks.
###Main features
### Main features
* Network monitoring
* WMI monitoring
* Agent monitoring (for all OS)
@ -28,14 +32,14 @@ Pandora FMS is a monitoring tool that not only measures if a parameter is right
* Very high capacity (Thousands of devices)
* Multiuser, several levels of ACL management.
###Screenshots
![screenshot 1](http://pandorafms.com/github/agent_list.png)
### Screenshots
![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)

7
extras/build_ci_dev_vars.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
export TRAVIS_JOB_NUMBER="DEBUG"
export TRAVIS_COMMIT="DEBUG"
export TRAVIS_BRANCH="DEBUG"
export SAUCE_USERNAME="DEBUG"
export SAUCE_ACCESS_KEY="DEBUG"
export DEVELOPMENT=1

View File

@ -15,22 +15,22 @@ fi
echo "Creating source tarballs in $RPMHOME/SOURCES"
# Console
cd $CODEHOME && tar zcvf $RPMHOME/SOURCES/pandorafms_console-$LOCAL_VERSION.tar.gz --exclude \.svn --exclude config.php --exclude enterprise pandora_console || exit 1
cd $CODEHOME && tar zcvf $RPMHOME/SOURCES/pandorafms_console-$LOCAL_VERSION.tar.gz --exclude \.svn --exclude config.php --exclude \.exe --exclude enterprise pandora_console || exit 1
# Server
cd $CODEHOME && tar zcvf $RPMHOME/SOURCES/pandorafms_server-$LOCAL_VERSION.tar.gz --exclude \.svn pandora_server || exit 1
cd $CODEHOME && tar zcvf $RPMHOME/SOURCES/pandorafms_server-$LOCAL_VERSION.tar.gz --exclude \.svn pandora_server --exclude \.exe || exit 1
# Linux agent
cd $CODEHOME/pandora_agents/shellscript && tar zcvf $RPMHOME/SOURCES/pandorafms_agent-$LOCAL_VERSION.tar.gz --exclude \.svn --exclude nohup linux || exit 1
cd $CODEHOME/pandora_agents/shellscript && tar zcvf $RPMHOME/SOURCES/pandorafms_agent-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn --exclude nohup linux || exit 1
# Unix agent
cd $CODEHOME/pandora_agents && tar zvcf $RPMHOME/SOURCES/pandorafms_agent_unix-$LOCAL_VERSION.tar.gz --exclude \.svn --exclude nohup --exclude NT4 unix || exit 1
cd $CODEHOME/pandora_agents && tar zvcf $RPMHOME/SOURCES/pandorafms_agent_unix-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn --exclude nohup --exclude NT4 unix || exit 1
# Enterprise console
cd $PANDHOME_ENT/pandora_console && tar zcvf $RPMHOME/SOURCES/pandorafms_console_enterprise-$LOCAL_VERSION.tar.gz --exclude \.svn enterprise/* || exit 1
cd $PANDHOME_ENT/pandora_console && tar zcvf $RPMHOME/SOURCES/pandorafms_console_enterprise-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn enterprise/* || exit 1
# Enterprise server
cd $PANDHOME_ENT/pandora_server/ && tar zcvf $RPMHOME/SOURCES/pandorafms_server_enterprise-$LOCAL_VERSION.tar.gz --exclude \.svn PandoraFMS-Enterprise || exit 1
cd $PANDHOME_ENT/pandora_server/ && tar zcvf $RPMHOME/SOURCES/pandorafms_server_enterprise-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn PandoraFMS-Enterprise || exit 1
# Create symlinks needed to build RPM packages
if [ "$1" == "nightly" ]; then

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

773
pandora_agents/pc/tentacle_server Normal file → Executable file

File diff suppressed because it is too large Load Diff

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
@ -94,6 +97,9 @@ transfer_mode tentacle
# User the agent will run as
#pandora_user root
# Agent mode: Learn (default), No-learn, Autodisable
# agent_mode autodisable
# Secondary server configuration
# ==============================

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 6.1dev-160601
Version: 7.0dev-170213
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-160601"
pandora_version="7.0dev-170213"
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
@ -135,6 +138,9 @@ transfer_mode tentacle
# 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, 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

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
@ -96,6 +99,9 @@ transfer_mode tentacle
# User the agent will run as
#pandora_user root
# 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, 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
@ -146,6 +149,9 @@ 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
# ==============================
@ -239,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
@ -108,6 +111,9 @@ transfer_mode tentacle
# User the agent will run as
#pandora_user root
# 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, 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
@ -99,6 +102,9 @@ transfer_mode tentacle
# User the agent will run as
#pandora_user root
# Agent mode: Learn (default), No-learn, Autodisable
# agent_mode autodisable
# Secondary server configuration
# ==============================

View File

@ -40,8 +40,12 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '6.1dev';
use constant AGENT_BUILD => '160601';
use constant AGENT_VERSION => '7.0dev';
use constant AGENT_BUILD => '170213';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
use constant DEFAULT_LOG_ROTATE => 3;
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {
@ -122,20 +126,25 @@ my %DefaultConf = (
'server_ip' => 'localhost',
'server_path' => '/var/spool/pandora/data_in',
'logfile' =>'/var/log/pandora/pandora_agent.log',
'logsize' => DEFAULT_MAX_LOG_SIZE,
'logrotate' => DEFAULT_LOG_ROTATE,
'temporal' => '/var/spool/pandora',
'interval' => 300,
'debug' => 0,
'ehorus_conf' => undef,
'agent_name' => hostname (),
'agent_name_cmd' => '',
'description' => '',
'group' => '',
'group_id' => undef,
'group_password' => undef,
'encoding' => 'UTF-8',
'server_port' => 41121,
'transfer_mode' => 'tentacle',
'transfer_timeout' => 30,
'server_user' => 'pandora',
'server_pwd' => '',
'server_ssl' => 'no',
'server_ssl' => '0',
'server_opts' => '',
'delayed_startup' => 0,
'pandora_nice' => 10,
@ -149,7 +158,7 @@ my %DefaultConf = (
'secondary_transfer_timeout' => 30,
'secondary_server_user' => 'pandora',
'secondary_server_pwd' => '',
'secondary_server_ssl' => 'no',
'secondary_server_ssl' => '0',
'secondary_server_opts' => '',
'autotime' => 0,
'temporal_min_size' => 1,
@ -176,6 +185,9 @@ my @Modules;
# Logfile file handle
my $LogFileFH;
# Logfile index
my $LogFileIdx;
# Agent name MD5;
my $AgentMD5;
@ -309,6 +321,32 @@ sub start_log (;$) {
}
}
################################################################################
# Rotates the agent logfile.
################################################################################
sub rotate_log () {
if ($Conf{'logfile'} eq 'syslog') {
# No action needed
return;
} else {
if ($Conf{'logrotate'} < 0){
$Conf{'logrotate'} = DEFAULT_LOG_ROTATE;
}
if ($Conf{'logfile'} eq 'syslog') {
return;
}
# Rotate file
$LogFileIdx = ($LogFileIdx+1) % $Conf{'logrotate'};
my $fsize = (stat $Conf{'logfile'})[7];
stop_log();
move ($Conf{'logfile'}, $Conf{'logfile'} . "." . $LogFileIdx);
start_log('quiet');
}
}
################################################################################
# Close the agent logfile and stop logging.
################################################################################
@ -595,6 +633,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;
@ -796,16 +844,20 @@ sub read_config (;$) {
log_message ('log', 'Thread is disabled.');
}
# Accept 'yes' for backward compatibility
$Conf{'server_ssl'} = '1' if ($Conf{'server_ssl'} eq 'yes');
$Conf{'secondary_server_ssl'} = '1' if ($Conf{'secondary_server_ssl'} eq 'yes');
# Set tentacle client options
if ($Conf{'transfer_mode'} eq 'tentacle') {
$Conf{'server_opts'} = '-x \'' . $Conf{'server_pwd'} . '\' ' . $Conf{'server_opts'} if ($Conf{'server_pwd'} ne '');
$Conf{'server_opts'} = '-c ' . $Conf{'server_opts'} if ($Conf{'server_ssl'} eq 'yes');
$Conf{'server_opts'} = '-c ' . $Conf{'server_opts'} if ($Conf{'server_ssl'} eq '1');
}
# Set tentacle client options for secondary server
if ($Conf{'secondary_transfer_mode'} eq 'tentacle') {
$Conf{'secondary_server_opts'} = '-x \'' . $Conf{'secondary_server_pwd'} . '\' ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_pwd'} ne '');
$Conf{'secondary_server_opts'} = '-c ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_ssl'} eq 'yes');
$Conf{'secondary_server_opts'} = '-c ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_ssl'} eq '1');
}
}
@ -1064,7 +1116,7 @@ sub launch_tentacle_proxy () {
#Execute tentacle server as a daemon
my $new_process = "tentacle_server -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'};
$new_process .= ' -C' if ($Conf{'server_ssl'} eq 'yes');
$new_process .= ' -C' if ($Conf{'server_ssl'} eq '1');
log_message ('setup', 'Proxy mode enabled');
exec ($new_process);
@ -1884,7 +1936,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";
@ -2137,6 +2196,39 @@ sub init_module ($) {
$module->{'alert_template'} = undef;
}
################################################################################
# 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.
################################################################################
@ -2226,10 +2318,12 @@ my $main_agent = -1;
# base time to start eatch iteration with the same interval.
my $iter_base_time = time();
$LogFileIdx = -1;
# Loop
while (1) {
if (-e $Conf{'logfile'} && (stat($Conf{'logfile'}))[7] > $Conf{'logsize'}) {
rotate_log();
}
# Ignore signals from UDP and Tentacle server while processing execution
if ($Conf{'udp_server'} == 1 || $Conf{'proxy_mode'}){
$SIG{'INT'} = 'DEFAULT';
@ -2288,12 +2382,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) {
@ -2311,11 +2408,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"})) {
@ -2326,6 +2426,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";
}
@ -2358,7 +2467,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'} . "' timezone_offset='". $Conf{'timezone_offset'} .
@ -2372,6 +2483,16 @@ while (1) {
$xml_header .= "' parent_agent_name='" .$Conf{'parent_agent_name'};
}
if (defined ($Conf{'agent_mode'})) {
if ($Conf{'agent_mode'} =~ m/no.?learn/ig) {
$xml_header .= "' agent_mode='0";
} elsif ($Conf{'agent_mode'} =~ m/auto.?disable.?/ig) {
$xml_header .= "' agent_mode='2";
} else {
$xml_header .= "' agent_mode='1";
}
}
# Check the gis mode (exec or manual). If exec script is defined, we execute it and get the coordenates
if (defined ($Conf{'gis_exec'}) && (-e $Conf{'gis_exec'})) {
my $coord_str = `$Conf{'gis_exec'}`;
@ -2402,6 +2523,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 160601
%define version 7.0dev
%define release 170213
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
@ -46,7 +46,7 @@ mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/
mkdir -p $RPM_BUILD_ROOT/usr/bin/
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
mkdir -p $RPM_BUILD_ROOT/etc/pandora/
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
@ -54,8 +54,7 @@ cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/init.d/pandora_agent_daemon
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/init.d/pandora_agent_daemon
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/rc.d/init.d/pandora_agent_daemon
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
@ -114,29 +113,29 @@ if [ "$1" = "1" ]; then
fi
/sbin/chkconfig --del pandora_agent_daemon
/etc/init.d/pandora_agent_daemon stop >/dev/null 2>&1 || :
rm /etc/init.d/pandora_agent_daemon
/usr/sbin/userdel pandora
rm -Rf /etc/pandora/pandora_agent.conf
rm -Rf /var/log/pandora/pandora_agent* 2> /dev/null
rm -Rf /usr/share/pandora_agent
rm -Rf /usr/share/man/man1/pandora_agent.1.gz
rm -Rf /usr/share/man/man1/tentacle_client.1.gz
/etc/rc.d/init.d/pandora_agent_daemon stop >/dev/null 2>&1 || :
# Remove symbolic links
pushd /etc/pandora
for f in pandora_agent.conf plugins collections
do
[ -L $f ] && rm -f $f
done
exit 0
%files
%defattr(750,pandora,root)
%defattr(750,root,root)
/usr/bin/pandora_agent
/usr/bin/pandora_agent_exec
%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent
%defattr(755,pandora,root)
/usr/bin/tentacle_client
/etc/init.d/pandora_agent_daemon
%docdir %{prefix}/pandora_agents/docs
%{prefix}/pandora_agent
%defattr(644,pandora,root)
%defattr(755,root,root)
/usr/bin/pandora_agent_exec
/usr/bin/tentacle_client
/etc/rc.d/init.d/pandora_agent_daemon
%defattr(644,root,root)
/usr/share/man/man1/pandora_agent.1.gz
/usr/share/man/man1/tentacle_client.1.gz
%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 6.1dev
%define release 160601
%define version 7.0dev
%define release 170213
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="160601"
PI_VERSION="7.0dev"
PI_BUILD="170213"
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 = '';
@ -53,6 +53,50 @@ my $Idx_size = 0;
# Regular expression to be matched
my $Reg_exp = '';
# Flag to show or not summary module
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.
@ -72,7 +116,7 @@ sub error_msg ($) {
# Print a help message.
###############################################################################
sub print_help () {
print "Usage: $0 <log_file> <module_name> <pattern>\n";
print "Usage: $0 <log_file> <module_name> <pattern> <up_lines_extra> <bot_lines_extra> [--summary]\n";
}
###############################################################################
@ -168,7 +212,8 @@ sub create_idx () {
# SUB parse_log
# Parse log file starting from position $Idx_pos.
###############################################################################
sub parse_log () {
sub parse_log (;$$) {
my ($up_lines,$bot_lines) = @_;
my $line;
log_msg("Parsing log file $Log_file");
@ -181,10 +226,54 @@ sub parse_log () {
seek(LOGFILE, $Idx_pos, 0);
# Parse log file
my @data;
while ($line = <LOGFILE>) {
if ($line =~ m/$Reg_exp/i) {
push (@data, $line);
my %data;
# Matched line id
my $matched_line = 0;
if ( (defined($up_lines)) || (defined($bot_lines)) ){
# Detailed workmode
my @lines;
my $nl = 0;
my @nl_found;
while ($line = <LOGFILE>) {
push @lines, $line;
if ($line =~ m/$Reg_exp/i) {
push @nl_found, $nl;
$coincidences++;
}
$nl++;
}
# Return all coincidences with the desired margin
foreach my $curr_line (@nl_found){
my $flag = 0; # avoid repetition of current line
if (defined($up_lines)){
$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{$matched_line}}, $lines[$i]);
}
}
}
if (defined($bot_lines)){
# Push bottom lines
for (my $i = ($curr_line+$flag); $i<=($curr_line+$bot_lines); $i++){
if (defined ($lines[$i])) {
push (@{$data{$matched_line}}, $lines[$i]);
}
}
}
$matched_line++;
}
}
else { # Standar workmode
while ($line = <LOGFILE>) {
if ($line =~ m/$Reg_exp/i) {
push (@{$data{$matched_line++}}, $line);
}
}
}
@ -194,18 +283,35 @@ sub parse_log () {
# Save the index file
save_idx();
return @data;
return \%data;
}
###############################################################################
# SUB print_summary
# Print module summary to stdout.
###############################################################################
sub print_summary() {
my $output = "<module>\n";
$output .= "<name><![CDATA[" . $Module_name . " coincidences]]></name>\n";
$output .= "<type><![CDATA[async_data]]></type>\n";
$output .= "<datalist>\n";
$output .= "<data><value><![CDATA[$coincidences]]></value></data>\n";
$output .= "</datalist>\n";
$output .= "</module>\n";
print stdout $output;
}
###############################################################################
# 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;
}
@ -214,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";
@ -224,12 +330,18 @@ sub print_log (@) {
}
# Regular module
else {
my $output = "<module>\n";
my $output;
print_summary() if ($summary_flag == 1);
$output = "<module>\n";
$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";
@ -245,15 +357,23 @@ sub print_log (@) {
###############################################################################
# Check command line parameters
if ($#ARGV != 2) {
if ($#ARGV < 2) {
print_help();
exit 1;
}
$Log_file = $ARGV[0];
$Module_name = $ARGV[1];
$Reg_exp = $ARGV[2];
$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"))
|| ( defined($sum_flag) && ($sum_flag eq "--summary")) ) {
$summary_flag = 1;
}
# Create index file storage directory
if ( ! -d $Idx_dir) {
mkdir($Idx_dir) || error_msg("Error creating directory $Idx_dir: "
@ -276,9 +396,9 @@ if (! -e $Idx_file) {
load_idx();
# Parse log file
my @data = parse_log();
my $data = parse_log($up_lines,$bot_lines);
# Print output to stdout
print_log (@data);
print_log ($data);
exit 0;

View File

@ -11,6 +11,8 @@
#
# Sample usage: ./pandora_df tmpfs /dev/sda1
#
# Set the first parameter as "-r" to use regular expressions in name match
#
# 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.
@ -27,11 +29,48 @@ use strict;
# Retrieve information from all filesystems
my $all_filesystems = 0;
# Regex flag
my $regex_mode = 0;
sub check_re($$){
my $item = shift;
my $array = shift;
foreach my $check (@{$array}){
if ($item =~ /$check/){
return 1;
}
}
return undef;
}
sub check_in($$){
my $filesystems = shift;
my $fs = shift;
if(($regex_mode == 0) || ( !defined ($regex_mode))) {
return defined ($filesystems->{$fs});
}
# check if matches any key
my @keys = keys %{$filesystems};
return check_re($fs, \@keys);
}
#
# MAIN
#
# Check command line parameters
if ($#ARGV < 0) {
$all_filesystems = 1;
}
# Check if regex mode is enabled
if ($ARGV[0] eq "-r") {
$regex_mode = 1;
shift @ARGV;
}
# Parse command line parameters
my %filesystems;
my %excluded_filesystems;
@ -59,16 +98,17 @@ if ($#df < 0) {
exit 1;
}
my %out;
# Parse filesystem usage
foreach my $row (@df) {
my @columns = split (' ', $row);
exit 1 if ($#columns < 4);
if (defined ($filesystems{$columns[0]}) || ($all_filesystems == 1 && !defined ($excluded_filesystems{$columns[0]}))) {
$filesystems{$columns[0]} = $columns[4] ;
if (check_in (\%filesystems,$columns[0]) || ($all_filesystems == 1 && !check_in(\%excluded_filesystems,$columns[0]) )) {
$out{$columns[0]} = $columns[4] ;
}
}
while (my ($filesystem, $use) = each (%filesystems)) {
while (my ($filesystem, $use) = each (%out)) {
# Remove the trailing %
chop ($use);

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

@ -30,7 +30,7 @@ tentacle_server - Tentacle Server
=head1 VERSION
Version 0.5.0
Version 0.6.1
=head1 USAGE
@ -65,6 +65,7 @@ use Thread::Semaphore;
use POSIX ":sys_wait_h";
use Time::HiRes qw(usleep);
use Scalar::Util qw(refaddr);
use POSIX qw(strftime);
# Constants for Win32 services.
use constant WIN32_SERVICE_STOPPED => 0x01;
@ -76,13 +77,23 @@ if ($t_libwrap_installed) {
Authen::Libwrap->import( qw( hosts_ctl STRING_UNKNOWN ) );
}
# Log messages, 1 enabled, 0 disabled
# Log errors, 1 enabled, 0 disabled
my $t_log = 0;
my $SOCKET_MODULE =
eval { require IO::Socket::INET6 } ? 'IO::Socket::INET6'
: eval { require IO::Socket::INET } ? 'IO::Socket::INET'
: die $@;
# Log information, 1 enabled, 0 enabled
my $t_log_hard = 0;
my $SOCKET_MODULE;
if ($^O eq 'MSWin32') {
# Only support INET on windows
require IO::Socket::INET;
$SOCKET_MODULE = 'IO::Socket::INET';
} else {
$SOCKET_MODULE =
eval { require IO::Socket::INET6 } ? 'IO::Socket::INET6'
: eval { require IO::Socket::INET } ? 'IO::Socket::INET'
: die $@;
}
# Service name for Win32.
my $SERVICE_NAME="Tentacle Server";
@ -91,7 +102,7 @@ my $SERVICE_NAME="Tentacle Server";
my $SERVICE_PARAMS=join(' ', @ARGV);
# Program version
our $VERSION = '0.5.0';
our $VERSION = '0.6.1';
# IPv4 address to listen on
my @t_addresses = ('0', '0.0.0.0');
@ -184,6 +195,9 @@ my $t_use_libwrap = 0;
my $t_program_name = $0;
$t_program_name =~ s/.*\///g;
# Log file
my $log_file = undef;
################################################################################
## SUB print_help
## Print help screen.
@ -203,6 +217,7 @@ sub print_help {
print ("\t-h\t\tShow help.\n");
print ("\t-i\t\tFilters.\n");
print ("\t-k key\t\tOpenSSL private key file.\n");
print ("\t-l log_file\t\tFile to write logs.\n");
print ("\t-m size\t\tMaximum file size in bytes (default ${t_max_size}b).\n");
print ("\t-o\t\tEnable file overwrite.\n");
print ("\t-p port\t\tPort to listen on (default $t_port).\n");
@ -210,7 +225,8 @@ sub print_help {
print ("\t-r number\tNumber of retries for network opertions (default $t_retries).\n");
print ("\t-S (install|uninstall|run) Manage the win32 service.\n");
print ("\t-t time\t\tTime-out for network operations in seconds (default ${t_timeout}s).\n");
print ("\t-v\t\tBe verbose.\n");
print ("\t-v\t\tBe verbose (display errors).\n");
print ("\t-V\t\tBe verbose on hard way (display errors and other info).\n");
print ("\t-w\t\tPrompt for OpenSSL private key password.\n");
print ("\t-x pwd\t\tServer password.\n");
print ("\t-b ip_address\tProxy requests to the given address.\n");
@ -262,7 +278,7 @@ sub parse_options {
my @t_addresses_tmp;
# Get options
if (getopts ('a:b:c:de:f:g:hi:k:m:op:qr:s:S:t:Tvwx:', \%opts) == 0 || defined ($opts{'h'})) {
if (getopts ('a:b:c:de:f:g:hi:k:l:m:op:qr:s:S:t:TvVwx:', \%opts) == 0 || defined ($opts{'h'})) {
print_help ();
exit 1;
}
@ -438,6 +454,12 @@ sub parse_options {
$t_log = 1;
}
# Be verbose hard
if (defined ($opts{'V'})) {
$t_log = 1;
$t_log_hard = 1;
}
# SSL private key password
if (defined ($opts{'w'})) {
$t_ssl_pwd = ask_passwd ("Enter private key file password: ", "Enter private key file password again for confirmation: ");
@ -498,6 +520,11 @@ sub parse_options {
}
}
}
# Get the config file
if (defined ($opts{'l'})) {
$log_file = $opts{'l'};
}
}
################################################################################
@ -706,7 +733,7 @@ sub accept_connections {
error ("accept: $!.");
}
print_log ("Client connected from " . $t_client_socket->peerhost ());
print_info ("Client connected from " . $t_client_socket->peerhost ());
if ($t_use_libwrap && (! hosts_ctl($t_program_name, $t_client_socket))) {
print_log ("Connection from " . $t_client_socket->peerhost() . " is closed by tcpwrappers.");
@ -810,17 +837,17 @@ sub serve_connection {
# Client wants to send a file
if ($command =~ /^SEND <(.*)> SIZE (\d+)$/) {
print_log ("Request to send file '$1' size ${2}b from " . $t_client_socket->sockhost ());
print_info ("Request to send file '$1' size ${2}b from " . $t_client_socket->sockhost ());
recv_file ($1, $2);
}
# Client wants to receive a file
elsif ($command =~ /^RECV <(.*)>$/) {
print_log ("Request to receive file '$1' from " . $t_client_socket->sockhost ());
print_info ("Request to receive file '$1' from " . $t_client_socket->sockhost ());
send_file ($1);
}
# Quit
elsif ($command =~ /^QUIT$/) {
print_log ("Connection closed from " . $t_client_socket->sockhost ());
print_info ("Connection closed from " . $t_client_socket->sockhost ());
last;
}
# Unknown command
@ -906,7 +933,7 @@ sub recv_file {
close (FILE);
send_data ("SEND OK\n");
print_log ("Received file '$base_name' size ${size}b from " . $t_client_socket->sockhost ());
print_info ("Received file '$base_name' size ${size}b from " . $t_client_socket->sockhost ());
}
################################################################################
@ -968,11 +995,42 @@ sub send_file {
## SUB print_log
## Print log messages.
################################################################################
sub print_log {
sub print_log($) {
if ($t_log == 1) {
print (STDOUT "[log] $_[0]\n");
my ($msg) = @_;
return unless ($t_log == 1);
my $fh = *STDOUT;
if (defined($log_file)) {
open($fh, ">>", $log_file) || die("Starting log failed: $!.\n");
}
print ($fh strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "[log]$msg.\n");
close ($fh) if (defined($log_file));
}
################################################################################
## SUB print_log
## Print log messages.
################################################################################
sub print_info($) {
my ($msg) = @_;
return unless ($t_log_hard == 1);
my $fh = *STDOUT;
if (defined($log_file)) {
open($fh, ">>", $log_file) || die("Starting log failed: $!.\n");
}
print ($fh strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "[info]$msg.\n");
close ($fh) if (defined($log_file));
}
################################################################################
@ -981,10 +1039,19 @@ sub print_log {
################################################################################
sub error {
if ($t_quiet == 0) {
print (STDERR "[err] $_[0]\n");
my ($msg) = @_;
return unless ($t_quiet == 0);
my $fh = *STDERR;
if (defined($log_file)) {
open($fh, ">>", $log_file) || die("$!\n");
}
print ($fh strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "[err]$msg\n");
close ($fh) if (defined($log_file));
die("\n");
}

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
@ -96,6 +96,9 @@ remote_config 0
# Enable or disable XML buffer.
xml_buffer 1
# Agent mode: Learn (default), No-learn, Autodisable
# agent_mode autodisable
# Secondary server configuration
# ==============================

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
{160601}
{170213}
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 160601)")
#define PANDORA_VERSION ("7.0dev(Build 170213)")
string pandora_path;
string pandora_dir;

View File

@ -384,7 +384,8 @@ string
Pandora_Windows_Service::getXmlHeader () {
char timestamp[20];
string agent_name, os_name, os_version, encoding, value, xml, address, parent_agent_name, agent_name_cmd;
string custom_id, url_address, latitude, longitude, altitude, position_description, gis_exec, gis_result;
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;
@ -477,6 +478,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");
@ -539,12 +554,28 @@ Pandora_Windows_Service::getXmlHeader () {
}
}
}
// Get agent mode
agent_mode = conf->getValue ("agent_mode");
// Convert the type string to lowercase
for (int i = 0; i < agent_mode.length(); i++) {
agent_mode[i] = tolower(agent_mode[i]);
}
if (!agent_mode.compare("no-learn") || !agent_mode.compare("nolearn")) {
agent_mode = "0";
} else if (!agent_mode.compare("autodisable")) {
agent_mode = "2";
} else {
agent_mode = "1";
}
xml += "\" interval=\"" + conf->getValue ("interval") +
"\" os_name=\"" + os_name +
"\" os_version=\"" + os_version +
"\" group=\"" + conf->getValue ("group") +
"\" parent_agent_name=\"" + conf->getValue ("parent_agent_name") + "\">\n";
"\" parent_agent_name=\"" + conf->getValue ("parent_agent_name") +
"\" agent_mode=\"" + agent_mode +
"\">\n";
return xml;
}
@ -1610,6 +1641,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;
@ -1629,6 +1661,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;
@ -1638,8 +1676,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";
@ -1653,6 +1691,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";
}
@ -2010,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

@ -114,6 +114,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 ();

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 160601))"
VALUE "ProductVersion", "(7.0dev(Build 170213))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -0,0 +1,14 @@
FROM mysql:5.5
MAINTAINER Pandora FMS Team <info@pandorafms.com>
WORKDIR /pandorafms/pandora_console
ADD pandoradb.sql /docker-entrypoint-initdb.d
ADD pandoradb_data.sql /docker-entrypoint-initdb.d
ENV MYSQL_DATABASE=pandora
RUN echo " \n\
sed -i \"1iUSE \$MYSQL_DATABASE\" /docker-entrypoint-initdb.d/pandoradb.sql \n\
sed -i \"1iUSE \$MYSQL_DATABASE\" /docker-entrypoint-initdb.d/pandoradb_data.sql \n\
" >> /docker-entrypoint-initdb.d/create_pandoradb.sh

View File

@ -1,10 +1,10 @@
package: pandorafms-console
Version: 6.1dev-160601
Version: 7.0dev-170213
Architecture: all
Priority: optional
Section: admin
Installed-Size: 42112
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Maintainer: Artica ST <deptec@artica.es>
Homepage: http://pandorafms.org/
Depends: php5, php5-snmp, php5-gd, php5-mysql, php-db, php5-xmlrpc, php-gettext, php5-curl, graphviz, dbconfig-common, php5-ldap, mysql-client | virtual-mysql-client
Description: Pandora FMS is a monitoring Open Source software. It watches your systems and applications, and allows you to know the status of any element of those systems. Web console is the graphical user interface (GUI) to manage and watch reports and graphs from Pandora FMS monitoring.
Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process.

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-160601"
pandora_version="7.0dev-170213"
package_pear=0
package_pandora=1

View File

@ -4,7 +4,8 @@ echo Change the user and group to /var/www/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/pandora_console
chgrp www-data /var/www/pandora_console -R
chown www-data /var/www/pandora_console -R
if [ -d /var/www/html ]; then mv /var/www/pandora_console /var/www/html/; fi
if [ -f /etc/init.d/apache2 ]; then
echo Restart the apache.
/etc/init.d/apache2 restart

View File

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

View File

@ -47,7 +47,7 @@ if (isset ($_GET["loginhash"])) {
}
// Check user
check_login ();
//check_login ();
define ('AJAX', true);

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;

View File

@ -44,7 +44,7 @@ function extension_db_status() {
"images/extensions.png", false, "", true, "");
if (! check_acl ($config['id_user'], 0, "PM")) {
if (! check_acl ($config['id_user'], 0, "DM")) {
db_pandora_audit("ACL Violation",
"Trying to access db status");
require ("general/noaccess.php");
@ -277,7 +277,7 @@ function extension_db_check_tables_differences($connection_test,
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $field . " " . $value . ";" .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $value . ";" .
'</pre>'
);
break;
@ -289,7 +289,7 @@ function extension_db_check_tables_differences($connection_test,
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $field . "INT NULL;" .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . "INT NULL;" .
'</pre>'
);
}
@ -297,7 +297,7 @@ function extension_db_check_tables_differences($connection_test,
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $field . "INT NOT NULL;" .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . "INT NOT NULL;" .
'</pre>'
);
}
@ -362,5 +362,5 @@ function extension_db_status_execute_sql_file($url, $connection) {
}
extensions_add_godmode_function('extension_db_status');
extensions_add_godmode_menu_option(__('DB Status'), 'PM', 'gextensions', null, "v1r1", 'gdbman');
extensions_add_godmode_menu_option(__('DB Status'), 'DM', 'gextensions', null, "v1r1", 'gdbman');
?>

View File

@ -87,6 +87,6 @@ function extension_uploader_extensions() {
echo "</form>";
}
extensions_add_godmode_menu_option(__('Extension uploader'), 'AM', null, null, "v1r1");
extensions_add_godmode_menu_option(__('Extension uploader'), 'PM', null, null, "v1r1");
extensions_add_godmode_function('extension_uploader_extensions');
?>

View File

@ -100,7 +100,7 @@ function pandora_files_repo_godmode () {
}
// Header tabs
$godmode['text'] = '<a href="index.php?sec=gextensions&sec2=extensions/files_repo">'
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'
. html_print_image ("images/setup.png", true, array ("title" => __('Administration view')))
. "</a>";
$godmode['godmode'] = 1;
@ -183,7 +183,7 @@ function pandora_files_repo_operation () {
// Header tabs
$onheader = array();
if (check_acl($config['id_user'], 0, "PM")) {
$godmode['text'] = '<a href="index.php?sec=gextensions&sec2=extensions/files_repo">'
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'
. html_print_image ("images/setup.png", true, array ("title" => __('Administration view')))
. "</a>";
$godmode['godmode'] = 1;

View File

@ -97,7 +97,7 @@ if ($file_id > 0) {
$table->data[] = $row;
$table->colspan[][1] = 1;
$url = ui_get_full_url("index.php?sec=gextensions&sec2=extensions/files_repo");
$url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo");
echo "<form method='post' action='$url' enctype='multipart/form-data'>";
html_print_table($table);
echo "</form>";

View File

@ -38,7 +38,7 @@ if (!empty($files)) {
// Pagination
if ($manage) {
$url = ui_get_full_url("index.php?sec=gextensions&sec2=extensions/files_repo");
$url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo");
}
else {
$url = ui_get_full_url("index.php?sec=extensions&sec2=extensions/files_repo");
@ -96,12 +96,12 @@ if (!empty($files)) {
if ($manage) {
$config_url = ui_get_full_url("index.php?sec=gextensions&sec2=extensions/files_repo&file_id=$file_id");
$config_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id=$file_id");
$data[4] .= " <a href=\"$config_url\">";
$data[4] .= html_print_image('images/config.png', true, array('title' => __('Edit'))); // Edit image
$data[4] .= "</a>";
$delete_url = ui_get_full_url("index.php?sec=gextensions&sec2=extensions/files_repo&delete=1&file_id=$file_id");
$delete_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&delete=1&file_id=$file_id");
$data[4] .= " <a href=\"$delete_url\" onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\">";
$data[4] .= html_print_image('images/cross.png', true, array('title' => __('Delete'))); // Delete image
$data[4] .= "</a>";

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;
}
}
@ -330,7 +332,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>";
@ -362,8 +364,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,

View File

@ -397,6 +397,7 @@ function generate_info($checks, $log_num_lines = 2000) {
function mainSystemInfo() {
global $config;
if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access Setup Management");
require ("general/noaccess.php");

View File

@ -120,12 +120,7 @@ function users_extension_main_god ($god = true) {
}
}
extensions_add_godmode_menu_option (__('Users connected'), 'UM','gusuarios',"users/icon.png", "v1r1");
if (isset($config["id_user"])) {
if (check_acl ($config["id_user"], 0, "UM")) {
extensions_add_operation_menu_option(__('Users connected'), 'workspace',"users/icon.png", "v1r1");
}
}
extensions_add_operation_menu_option(__('Users connected'), 'workspace',"users/icon.png", "v1r1", '', "UM");
extensions_add_godmode_function('users_extension_main_god');
extensions_add_main_function('users_extension_main');

View File

@ -64,7 +64,7 @@ UPDATE `talert_commands` SET `fields_descriptions` = '[\"Destination&#x20;addres
-- ---------------------------------------------------------------------
INSERT INTO `tconfig` (`token`, `value`) VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}');
UPDATE `tconfig` SET value = 'v6.0dev' WHERE token = 'db_scheme_version';
UPDATE `tconfig` SET value = 'https://artica.es/pandoraupdate6/server.php' WHERE token = 'url_update_manager';
UPDATE `tconfig` SET value = 'https://firefly.artica.es/pandoraupdate6/server.php' WHERE token = 'url_update_manager';
-- ---------------------------------------------------------------------
-- Table `tnetwork_map`

View File

@ -64,7 +64,7 @@ UPDATE talert_commands SET fields_descriptions = '["Destination&#x20;address","S
-- ---------------------------------------------------------------------
INSERT INTO tconfig (token, value) VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}');
UPDATE tconfig SET value = 'v6.0dev' WHERE token = 'db_scheme_version';
UPDATE tconfig SET value = 'https://artica.es/pandoraupdate6/server.php' WHERE token='url_update_manager';
UPDATE tconfig SET value = 'https://firefly.artica.es/pandoraupdate6/server.php' WHERE token='url_update_manager';
-- ---------------------------------------------------------------------
-- Table `tnetwork_map`

View File

@ -1,20 +1,110 @@
-- ---------------------------------------------------------------------
-- 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;
-- ---------------------------------------------------------------------
-- Table `talert_actions`
@ -27,15 +117,134 @@ 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');
-- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents`
-- ---------------------------------------------------------------------
ALTER TABLE tplanned_downtime_agents ADD COLUMN `manually_disabled` tinyint(1) DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tlink`
-- ---------------------------------------------------------------------
UPDATE `tlink` SET `link` = 'http://library.pandorafms.com/' WHERE `name` = 'Module library';
UPDATE `tlink` SET `name` = 'Enterprise Edition' WHERE `id_link` = 0000000002;
UPDATE `tlink` SET `name` = 'Documentation', `link` = 'http://wiki.pandorafms.com/' WHERE `id_link` = 0000000001;
UPDATE `tlink` SET `link` = 'http://forums.pandorafms.com/index.php?board=22.0' WHERE `id_link` = 0000000004;
UPDATE `tlink` SET `link` = 'https://github.com/pandorafms/pandorafms/issues' WHERE `id_link` = 0000000003;
-- ---------------------------------------------------------------------
-- Table `tevent_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tevent_filter ADD COLUMN `date_from` date DEFAULT NULL;
ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
-- ---------------------------------------------------------------------
-- Table `tusuario`
-- ---------------------------------------------------------------------
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';
-- ---------------------------------------------------------------------
-- 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`
@ -10,6 +38,13 @@ ALTER TABLE talert_templates ADD COLUMN min_alerts_reset_counter NUMBER(5, 0) DE
ALTER TABLE tserver ADD COLUMN server_keepalive NUMBER(10, 0) DEFAULT 0;
-- ----------------------------------------------------------------------
-- Table `tagente_estado`
-- ----------------------------------------------------------------------
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 `talert_actions`
-- ---------------------------------------------------------------------
@ -21,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`
@ -33,4 +78,82 @@ 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');
-- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents`
-- ---------------------------------------------------------------------
ALTER TABLE tplanned_downtime_agents ADD COLUMN manually_disabled NUMBER(5, 0) DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tlink`
-- ---------------------------------------------------------------------
UPDATE tlink SET link = 'http://library.pandorafms.com/' WHERE name = 'Module library';
UPDATE tlink SET name = 'Enterprise Edition' WHERE id_link = 0000000002;
UPDATE tlink SET name = 'Documentation', link = 'http://wiki.pandorafms.com/' WHERE id_link = 0000000001;
UPDATE tlink SET link = 'http://forums.pandorafms.com/index.php?board=22.0' WHERE id_link = 0000000004;
UPDATE tlink SET link = 'https://github.com/pandorafms/pandorafms/issues' WHERE id_link = 0000000003;
-- ---------------------------------------------------------------------
-- Table `tevent_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tevent_filter ADD COLUMN date_from date DEFAULT NULL;
ALTER TABLE tevent_filter ADD COLUMN date_to date DEFAULT NULL;
-- ---------------------------------------------------------------------
-- Table `tusuario`
-- ---------------------------------------------------------------------
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';
-- ---------------------------------------------------------------------
-- 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

@ -0,0 +1,93 @@
-- ----------------------------------------------------------------------
-- Table `tagente_estado`
-- ----------------------------------------------------------------------
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

@ -0,0 +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='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 "infomodal":
echo "icono_info.png";
break;
case "helpmodal":
echo "icono_info.png";
break;
case "modulemodal":
echo "icono_popup.png";
break;
case "massivemodal":
echo "icono_popup.png";
break;
case "eventsmodal":
echo "icono_popup.png";
break;
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 "'>
<div class='modalcontenttext'>";
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>
$(".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

@ -28,7 +28,7 @@ ui_require_css_file ('firts_task');
<h3> <?php echo __('Create Fields Manager'); ?></h3>
<p id="description_task"> <?php echo __("Custom fields are an easy way to personalized agent's information.
You're able to create custom fields by klicking on 'Administration' -> 'Manage monitoring' -> 'Manage custom fields'. "); ?></p>
<form action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create" method="post">
<form action="index.php?sec=gagente&sec2=godmode/agentes/configure_field" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Fields '); ?>" />
</form>
</div>

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

@ -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,14 +65,14 @@ 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;';
$table->width = "100%";
$table->styleTable = 'margin: auto; margin-top: 0px;';
$table->rowclass[0] = '';
$table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true);
// Search bar
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
if (!isset($config['search_keywords'])) {
@ -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']) {
@ -241,7 +244,10 @@ config_check();
if ($config["alert_cnt"] > 0) {
echo '<div id="alert_messages" style="display: none"></div>';
echo '<div id="alert_messages" style="display: none"></div>';
if ($config["alert_cnt"] > 0) {
$maintenance_link = 'javascript:';
$maintenance_title = __("System alerts detected - Please fix as soon as possible");
$maintenance_class = $maintenance_id = 'show_systemalert_dialog white';
@ -276,7 +282,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') . '">';
@ -309,9 +319,9 @@ config_check();
$table->data[0][9] .= html_print_image ("images/header_email.png", true, array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot", 'style' => 'width:24px;'));
$table->data[0][9] .= '</a>';
}
$table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true);
html_print_table($table);
unset($table);
@ -345,7 +355,19 @@ config_check();
var new_chat = <?php echo (int)$_SESSION['new_chat'];?>;
$(document).ready (function () {
<?php
if (($config['autorefresh_white_list'] !== null) && (array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) && (!isset($_GET["refr"]))) {
?>
$("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle ();
$("#combo_refr").css('padding-right', '9px');
href = $("a.autorefresh").attr ("href");
$(document).attr ("location", href + "30");
<?php
}
?>
if (fixed_header) {
$('div#head').addClass('fixed_header');
$('div#page')
@ -363,11 +385,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
}
?>
@ -376,12 +406,12 @@ config_check();
<?php
if ($config["alert_cnt"] > 0) {
?>
$("#yougotalert").pulsate ();
blinkalert();
<?php
}
?>
blinkpubli();
<?php
if ($_GET["refr"]) {
$_get_refr = strip_tags($_GET["refr"]);

View File

@ -0,0 +1,74 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2016 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.
/**
* @package General
*/
global $config;
include_once("include/functions_update_manager.php");
$message = array();
if (is_ajax()) {
$message_id = get_parameter ('message_id', false);
if ($message_id === false) return false;
$message = update_manger_get_single_message ($message_id);
} else {
$message = update_manger_get_last_message ();
if ($message === false) return false;
update_manger_set_read_message($message["svn_version"], 1);
update_manager_remote_read_messages ($message["svn_version"]);
}
// Prints first step pandora registration
echo '<div id="message_id_dialog" title="' .
io_safe_output($message['db_field_value']) . '">';
echo '<div>';
echo io_safe_output_html($message["data"]);
echo '</div>';
echo '</div>';
?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
$(document).ready (function () {
$("#message_id_dialog").dialog({
resizable: true,
draggable: true,
modal: true,
width: 850
});
$(".ui-widget-overlay").css("background", "#000");
$(".ui-widget-overlay").css("opacity", 0.6);
});
/* ]]> */
</script>

View File

@ -0,0 +1,407 @@
<?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.
/**
* @package General
*/
global $config;
function display_register ($data) {
if ($data['instance_registered'] == 1) return false;
if ($data['force_register'] == 1) return true;
if ($data['force_register'] == 0) return false;
if ($data['identification_reminder'] == 0) return false;
if (!isset ($data['identification_reminder_timestamp'])) return true;
if ($data['identification_reminder_timestamp'] < time()) return true;
return false;
}
function display_newsletter ($data) {
if ($data['newsletter_subscribed'] == 1) return false;
if ($data['force_newsletter'] == 1) return true;
if ($data['force_newsletter'] == 0) return false;
if ($data['newsletter_reminder'] === 0) return false;
if (!isset ($data['newsletter_reminder_timestamp'])) return true;
if (!is_numeric ($data['newsletter_reminder_timestamp'])) return true;
if ($data['newsletter_reminder_timestamp'] < time()) return true;
return false;
}
if (is_ajax()) {
include_once($config['homedir'] . "/include/functions_update_manager.php");
$open_wizard = get_parameter ('open_wizard', 0);
$not_return = get_parameter ('not_return', 0);
$reset_initial_wizard = get_parameter ('reset_initial_wizard', 0);
if ($reset_initial_wizard) {
config_update_value ('initial_wizard', 0);
}
if ($open_wizard) {
$register_pandora = get_parameter ('register_pandora', 0);
$newsletter = get_parameter ('newsletter', 0);
$forced = get_parameter ('forced', 0);
$future_8_days = time() + 8 * SECONDS_1DAY;
$ui_feedback = array('status' => true, 'message' => '');
if ($register_pandora) {
// Pandora register update
$um_message = update_manager_register_instance ();
$ui_feedback['message'] .= $um_message['message'] . '<br><br>';
if ($um_message['success']) {
config_update_value ('instance_registered', 1);
$ui_feedback['status'] = true && $ui_feedback['status'];
} else {
$ui_feedback['status'] = false;
}
} elseif (!$forced) {
config_update_value ('identification_reminder_timestamp', $future_8_days);
}
if ($newsletter) {
// Pandora newsletter update
$email = get_parameter ('email', '');
$um_message = update_manager_insert_newsletter ($email);
$ui_feedback['message'] .= $um_message['message'];
if ($um_message['success']) {
db_process_sql_update ('tusuario', array ('middlename' => 1), array('id_user' => $config['id_user']));
$ui_feedback['status'] = true && $ui_feedback['status'];
} else {
$ui_feedback['status'] = false;
}
} elseif (!$forced) {
db_process_sql_update ('tusuario', array ('lastname' => $future_8_days), array('id_user' => $config['id_user']));
}
// Form answer JSON
$ui_feedback['status'] = $ui_feedback['status'] ? 1 : 0;
echo io_json_mb_encode($ui_feedback);
}
if (!$not_return) {
return;
}
}
//Check if user is admin
if (!license_free()) return;
if (!users_is_admin ($config['id_user'])) return;
// Get data to display properly the wizard
$wizard_data = array ();
$wizard_data['newsletter_subscribed'] = db_get_value ('middlename', 'tusuario', 'id_user', $config['id_user']);
// force_* = 1 -> force show
// force_* = 0 -> force hide
// force_* = -1 -> show or hide depends reminder and timestamp
$wizard_data['force_newsletter'] = get_parameter ('force_newsletter', -1);
$wizard_data['newsletter_reminder'] = db_get_value ('firstname', 'tusuario', 'id_user', $config['id_user']);
$wizard_data['newsletter_reminder_timestamp'] = db_get_value ('lastname', 'tusuario', 'id_user', $config['id_user']);
$wizard_data['instance_registered'] = $config['instance_registered'];
$wizard_data['force_register'] = get_parameter ('force_register', -1);
$wizard_data['identification_reminder'] = $config['identification_reminder'];
$wizard_data['identification_reminder_timestamp'] = $config['identification_reminder_timestamp'];
$display_newsletter = display_newsletter ($wizard_data);
$display_register = display_register ($wizard_data);
$display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1);
// Return if it is fully completed
if ((!$display_register) && (!$display_newsletter)) return false;
$return_button = get_parameter ('return_button', 0) == 1;
$email = db_get_value ('email', 'tusuario', 'id_user', $config['id_user']);
//Avoid to show default email
if ($email == 'admin@example.com') $email = '';
// Prints accept register license
echo '<div id="login_accept_register" title="' .
__('The Pandora FMS community wizard') . '" style="">';
echo '<div style="margin: 5px 0 10px; float: left; padding-left: 15px;">';
echo html_print_image ('images/pandora_circle_big.png', true);
echo '</div>';
echo '<div style="font-size: 12pt; margin: 5px 20px; float: left; padding-top: 23px;">';
echo __('Stay up to date with the Pandora FMS community') . ".";
echo '</div>';
echo '<div id="license_newsletter">';
echo '<p>' . __("When you subscribe to the Pandora FMS Update Manager service, you accept that we register your Pandora instance as an identifier on the database owned by Artica TS. This data will solely be used to provide you with information about Pandora FMS and will not be conceded to third parties. You'll be able to unregister from said database at any time from the Update Manager options") . '.</p>';
echo '<p>' . __("In the same fashion, when subscribed to the newsletter you accept that your email will pass on to a database property of Artica TS. This data will solely be used to provide you with information about Pandora FMS and will not be conceded to third parties. You'll be able to unregister from said database at any time from the newsletter subscription options") . '.</p>';
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; padding-top:10px; position:relative; border: 1px solid #FFF;">';
echo '<div style="float: right;">';
html_print_submit_button(__("Finish"), 'finish_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>';
$display_status_return = $return_button ? 'block' : 'none';
echo '<div style="float: right; width: 20%; display: ' . $display_status_return . ';">';
html_print_submit_button(__("Return"), 'return_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
echo '</div>';
echo '<div style="float: left; margin-left: 0px; width: 50%; text-align: left;">';
html_print_checkbox('register', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;" id="label-register">' .__("Join the Pandora FMS community") . '!</span><br>';
html_print_checkbox('newsletter', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;" id="label-newsletter">' .__("Subscribe to our newsletter") . '</span>';
echo "<br>";
echo '<div id="email_container">';
echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">' .__("Email") . ': </span>';
html_print_input_text_extended ('email-newsletter', $email, 'text-email-newsletter', '', 30, 255, false, '', array ("style" => "display:none; width: 200px;")); echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">' .__("Email") . ': </span>';
echo '&nbsp;<span id="required-email-newsletter">*'.__("Required") .' </span>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
// Print yes or not dialog
echo '<div id="login_registration_yesno" title="' .
__('Pandora FMS instance identification wizard') . '" style="">';
echo '<div style="font-size: 12pt; margin: 20px;">';
echo __("Do you want to continue without any registration") . "?";
echo '</div>';
echo '<div style="float: left; padding-left: 15px; padding-top: 20px;">';
html_print_submit_button(__("No"), 'no_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub cancel" style="width:100px;"');
echo '</div>';
echo '<div style="float: right; padding-right: 15px; padding-top: 20px;">';
html_print_submit_button(__("Yes"), 'yes_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
echo '</div>';
echo '</div>';
// Print feedback user dialog
echo '<div id="ui_messages_feedback" style="">';
echo '<div style="float: left; margin: 15px; margin-left: 5px;">';
echo html_print_image ('images/success_circle_big.png', true);
echo '</div>';
echo '<div id="feedback_message" style="font-size: 13pt; margin: 15px 20px; padding-left:80px;"></div>';
echo '</div>';
?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
//Show newsletter and register checkboxes
var display_register = <?php echo json_encode($display_register); ?>;
var display_newsletter = <?php echo json_encode($display_newsletter); ?>;
var display_forced = <?php echo json_encode($display_forced); ?>;
var return_button = <?php echo json_encode($return_button); ?>;
////////////////////////////////////////////////////////////////////////
//HELPER FUNCTIONS
function submit_open_wizard (register, newsletter, email, forced) {
register = register;
newsletter = newsletter ? 1 : 0;
forced = forced ? 1 : 0;
var feedback_message = '';
var feedback_status = 1;
jQuery.post ("ajax.php",
{"page": "general/login_identification_wizard",
"open_wizard": 1,
"register_pandora": register,
"newsletter": newsletter,
"email": email,
"forced": forced},
function (data) {
var feedback_message = '';
var feedback_status = 1;
jQuery.each (data, function (i, val) {
if (i == 'message') feedback_message = val;
if (i == 'status') feedback_status = val;
});
if (feedback_status == 0) {
$("#ui_messages_feedback img").attr("src", "images/fail_circle_big.png");
} else {
$("#ui_messages_feedback img").attr("src", "images/success_circle_big.png");
}
$("#feedback_message").html(feedback_message);
},
"json"
);
}
////////////////////////////////////////////////////////////////////////
//EVENT FUNCTIONS
$("#submit-return_dialog_button").click (function () {
$("#login_accept_register" ).dialog('close');
$("#all-required").hide();
$("#login_id_dialog" ).dialog('open');
jQuery.post ("ajax.php",
{"page": "general/login_identification_wizard",
"reset_initial_wizard": 1},
function (data) {}
);
});
$("#submit-finish_dialog_button").click (function () {
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
var register = $("#checkbox-register").is(':checked');
var email = $("#text-email-newsletter").val();
if (email == '' && newsletter) {
$("#label-email-newsletter").show();
$("#text-email-newsletter").show();
$("#required-email-newsletter").show();
return;
}
if (!register && display_register && !display_forced) {
$("#login_registration_yesno").dialog('open');
} else {
var register_forced = register ? 1 : 0;
submit_open_wizard (register_forced, newsletter, email, display_forced);
$("#login_accept_register" ).dialog('close');
if (register || newsletter) {
$("#ui_messages_feedback").dialog('open');
}
}
});
$("#submit-no_registration").click (function () {
$("#login_registration_yesno").dialog('close');
});
$("#submit-yes_registration").click (function () {
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
var email = $("#text-email-newsletter").val();
submit_open_wizard (0, newsletter, email, display_forced);
$("#login_registration_yesno").dialog('close');
$("#login_accept_register" ).dialog('close');
});
$("#checkbox-newsletter").click (function () {
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
if (!return_button && newsletter) {
$("#label-email-newsletter").show();
$("#text-email-newsletter").show();
}
if (!newsletter) {
$("#label-email-newsletter").hide();
$("#text-email-newsletter").hide();
$("#required-email-newsletter").hide();
}
});
////////////////////////////////////////////////////////////////////////
//DISPLAY
$(document).ready (function () {
$("#login_accept_register").dialog({
resizable: false,
draggable: true,
modal: true,
height: 320,
width: 750
});
$("#login_registration_yesno").dialog({
resizable: false,
draggable: true,
modal: true,
width: 320,
overlay: {
opacity: 1,
background: "black"
},
autoOpen: false
});
$("#ui_messages_feedback").dialog({
resizable: false,
draggable: true,
modal: true,
width: 300,
overlay: {
opacity: 1,
background: "black"
},
autoOpen: false
});
//Display return button if required
if (return_button) {
$("#submit-return_dialog_button").show ();
}
// Remove the completed parts
if (!display_register) {
$("#checkbox-register").attr ('style', 'display: none !important');
$("#label-register").hide ();
}
if (!display_newsletter) {
$("#checkbox-newsletter").attr ('style', 'display: none !important');
$("#label-newsletter").hide ();
}
});
/* ]]> */
</script>
<style type="text/css">
#required-email-newsletter{
font-size : 9px;
color: red;
margin-left: -2px;
margin-top: 3px;
position: absolute;
display: none;
}
#email_container{
margin-top: 3px;
width: 500px;
}
#license_newsletter {
height: 100px;
width: 100%;
overflow-y: scroll;
border: 1px solid #E4E4E4;
border-radius: 3px;
}
#license_newsletter p{
padding: 0 3px;
}
.ui-widget-overlay {
background: #000;
opacity: .6;
}
.ui-draggable {
cursor: inherit;
}
</style>

View File

@ -79,9 +79,9 @@ echo '<div id="login_in">';
echo '<table id="login_layout">';
echo'<tr style="height:15px;"><td>';
echo '<div class="login_links">';
echo '<a href="http://wiki.pandorafms.com/" target="_blank">' . __('Help') . '</a>';
echo '<a href="http://wiki.pandorafms.com/" target="_blank">' . __('Docs') . '</a>';
echo ' | ';
echo '<a href="http://forums.pandorafms.com/" target="_blank">' . __('Support') . '</a>';
echo '<a href="https://pandorafms.com/monitoring-services/support/" target="_blank">' . __('Support') . '</a>';
echo '</div>';
echo '</td></tr>';
echo'<tr>
@ -89,22 +89,38 @@ 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>';
// This prints the current pandora console version.
// For stable/live function it might be wise to comment it out
/* CUSTOM BRANDING ENDS HERE */
echo '</td><td style="padding-top: 15px; position:fixed;">';
echo '</td><td style="padding-top: 15px; position:absolute;">';
switch ($login_screen) {
case 'login':
if (!empty ($page) && !empty ($sec)) {

View File

@ -0,0 +1,239 @@
<?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.
/**
* @package General
*/
global $config;
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) {
$email = get_parameter ('email', false);
$timezone = get_parameter ('timezone', false);
$language = get_parameter ('language', false);
if ($email !== false) config_update_value ('language', $language);
if ($timezone !== false) config_update_value ('timezone', $timezone);
if ($email !== false) db_process_sql_update ('tusuario',
array ('email' => $email), array('id_user' => $config['id_user']));
// Update the alert action Mail to XXX/Administrator if it is set to default
$mail_check = 'yourmail@domain.es';
$mail_alert = alerts_get_alert_action_field1(1);
if ($mail_check === $mail_alert && $email !== false) {
alerts_update_alert_action (1, array('field1' => $email,
'field1_recovery' => $email));
}
config_update_value ('initial_wizard', 1);
}
//Change the language if is change in checkbox
if ($change_language !== 0) {
config_update_value ('language', $change_language);
}
if ($cancel_wizard !== 0) {
config_update_value ('initial_wizard', 1);
}
return;
}
$email = db_get_value ('email', 'tusuario', 'id_user', $config['id_user']);
//Avoid to show default email
if ($email == 'admin@example.com') $email = '';
// Prints first step pandora registration
echo '<div id="login_id_dialog" title="' .
__('Pandora FMS instance identification wizard') . '" style="display: none;">';
echo '<div style="font-size: 10pt; margin: 20px;">';
echo __('Please fill the following information in order to configure your Pandora FMS instance successfully') . '.';
echo '</div>';
echo '<div style="">';
$table = new StdClass();
$table->class = 'databox filters';
$table->width = '100%';
$table->data = array ();
$table->size = array();
$table->size[0] = '40%';
$table->style[0] = 'font-weight:bold';
$table->size[1] = '60%';
$table->border = '5px solid';
$table->data[0][0] = __('Language code for Pandora');
$table->data[0][1] = html_print_select_from_sql (
'SELECT id_language, name FROM tlanguage',
'language', $config['language'] , '', '', '', true);
$zone_name = array('Africa' => __('Africa'), 'America' => __('America'), 'Antarctica' => __('Antarctica'), 'Arctic' => __('Arctic'), 'Asia' => __('Asia'), 'Atlantic' => __('Atlantic'), 'Australia' => __('Australia'), 'Europe' => __('Europe'), 'Indian' => __('Indian'), 'Pacific' => __('Pacific'), 'UTC' => __('UTC'));
if ($zone_selected == "") {
if ($config["timezone"] != "") {
list($zone) = explode("/", $config["timezone"]);
$zone_selected = $zone;
}
else {
$zone_selected = 'Europe';
}
}
$timezones = timezone_identifiers_list();
foreach ($timezones as $timezone) {
if (strpos($timezone, $zone_selected) !== false) {
$timezone_country = preg_replace('/^.*\//', '', $timezone);
$timezone_n[$timezone] = $timezone_country;
}
}
$table->data[2][0] = __('Timezone setup'). ' ' . ui_print_help_tip(
__('Must have the same time zone as the system or database to avoid mismatches of time.'), true);
$table->data[2][1] = html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone()', '', '', true);
$table->data[2][1] .= "&nbsp;&nbsp;". html_print_select($timezone_n, 'timezone', $config["timezone"], '', '', '', true);
$table->data[4][0] = __('E-mail for receiving alerts');
$table->data[4][1] = html_print_input_text ('email', $email, '', 50, 255, true);
html_print_table ($table);
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; right: 10px; border: 1px solid #FFF; width: 570px">';
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>';
echo '</div>';
echo '</div>';
?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
var default_language_displayed;
////////////////////////////////////////////////////////////////////////
//HELPER FUNCTIONS
function show_timezone () {
zone = $("#zone").val();
$.ajax({
type: "POST",
url: "ajax.php",
data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone,
dataType: "json",
success: function(data) {
$("#timezone").empty();
jQuery.each (data, function (id, value) {
timezone = value;
var timezone_country = timezone.replace (/^.*\//g, "");
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone_country));
});
}
});
}
////////////////////////////////////////////////////////////////////////
//EVENT FUNCTIONS
$("#submit-id_dialog_button").click (function () {
//All fields required
if ($("#text-email").val() == '') {
$("#all-required").show();
} else {
var timezone = $("#timezone").val();
var language = $("#language").val();
var email_identification = $("#text-email").val();
jQuery.post ("ajax.php",
{"page": "general/login_required",
"save_required_wizard": 1,
"email": email_identification,
"language": language,
"timezone": timezone},
function (data) {}
);
$("#login_id_dialog").dialog('close');
first_time_identification ();
}
});
$("#language").click(function () {
var change_language = $("#language").val();
if (change_language === default_language_displayed) return;
jQuery.post ("ajax.php",
{"page": "general/login_required",
"change_language": change_language},
function (data) {}
);
location.reload();
});
////////////////////////////////////////////////////////////////////////
//DISPLAY
$(document).ready (function () {
$("#login_id_dialog").dialog({
resizable: true,
draggable: true,
modal: true,
height: 280,
width: 630,
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
});
default_language_displayed = $("#language").val();
$(".ui-widget-overlay").css("background", "#000");
$(".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');
});
});
/* ]]> */
</script>

View File

@ -272,8 +272,8 @@ if (!empty($all_data)) {
$data[2] = $session['accion'];
$data[3] = ui_print_help_tip($session['fecha'], true) . human_time_comparation($session['utimestamp'], 'tiny');
$data[4] = $session_ip_origen;
$data[5] = io_safe_output ($session['descripcion']);
$data[5] = io_safe_output(io_safe_output($session['descripcion']));
array_push ($table->data, $data);
}
echo "<div style='width:100%; overflow-x:auto;'>";

View File

@ -74,6 +74,19 @@ var fixed_header = <?php echo json_encode((bool)$config_fixed_header); ?>;
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) {
@ -101,6 +114,13 @@ function close_submenus () {
}
$(document).ready( function() {
//Daniel maya 02/06/2016 Fixed menu position--INI
if (fixed_menu) {
$('div#menu')
.css('position', 'fixed')
.css('z-index', '9000')
}
//Daniel maya 02/06/2016 Fixed menu position--END
/*
$("img.toggle").click (function (e) {
//In case the links gets activated, we don't want to follow link
@ -218,25 +238,77 @@ $(document).ready( function() {
*/
handsInMenu = 0;
openTimeMenu = 0;
$('#menu').mouseenter(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');
}).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);
});
$('#menu').mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '145px');
$('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}
}, 2500);
});
}
else {
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" );
$('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();
}
}, 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);
});
});
}
}
}
else {
$('div#title_menu').hide();
@ -250,31 +322,98 @@ $(document).ready( function() {
openTime2 = 0;
handsIn = 0;
handsIn2 = 0;
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
//$('div#menu').offset().top;
//$('div#menu').css('overflow','visible');
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function() {
//$('div#menu').css('overflow', 'hidden');
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 3000 && handsIn == 0) {
openTime = 4000;
//Daniel maya 02/06/2016 Display menu with click --INI
if(!click_display){
//Daniel barbero 10/08/2016 Display menu with click --INI
if (autohidden_menu) {
//Daniel barbero 10/08/2016 Display menu with click --END
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 3000 && handsIn == 0) {
openTime = 4000;
$("ul#sub"+table_hover[0].id).hide();
}
}, 2500);
});
//Daniel barbero 10/08/2016 Display menu with click --INI
} else {
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
$("ul#sub"+table_hover[0].id).hide();
/*
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 3000 && handsIn == 0) {
openTime = 4000;
$("ul#sub"+table_hover[0].id).hide();
}
}, 2500);
*/
});
}
//Daniel barbero 10/08/2016 Display menu with click --END
}else{
$(document).ready(function() {
//Daniel barbero 10/08/2016 Display menu with click --INI
if (autohidden_menu) {
//Daniel barbero 10/08/2016 Display menu with click --END
$('.menu_icon').on("click", function() {
if( typeof(table_hover) != 'undefined'){
$("ul#sub"+table_hover[0].id).hide();
}
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 5000 && handsIn == 0) {
openTime = 6000;
$("ul#sub"+table_hover[0].id).hide();
}
}, 5500);
});
//Daniel barbero 10/08/2016 Display menu with click --INI
} else {
$('.menu_icon').on("click", function() {
if( typeof(table_hover) != 'undefined'){
$("ul#sub"+table_hover[0].id).hide();
}
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
});
}
}, 3500);
});
//Daniel barbero 10/08/2016 Display menu with click --END
});
}
//Daniel maya 02/06/2016 Display menu with click --END
- $('.has_submenu').mouseenter(function() {
table_hover2 = $(this);
handsIn2 = 1;
@ -296,40 +435,103 @@ $(document).ready( function() {
});
$(document).ready(function() {
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
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');
});
}
}
$('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();
});
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();
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 -->

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