diff --git a/extras/bin/gotty b/extras/bin/gotty
new file mode 100755
index 0000000000..1a1de33cf6
Binary files /dev/null and b/extras/bin/gotty differ
diff --git a/extras/chrome_extension/js/popup.js b/extras/chrome_extension/js/popup.js
index 44e0725a73..e323a9b12b 100644
--- a/extras/chrome_extension/js/popup.js
+++ b/extras/chrome_extension/js/popup.js
@@ -1,170 +1,183 @@
var max_events;
var bg;
-$(document).ready(function(){
- max_events=localStorage["events"];
- if(localStorage["events"]==undefined){
- localStorage["events"]="20";
- }
- bg=chrome.extension.getBackgroundPage();
+$(document).ready(function() {
+ max_events = localStorage["events"];
+ if (localStorage["events"] == undefined) {
+ localStorage["events"] = "20";
+ }
+ bg = chrome.extension.getBackgroundPage();
- // Display the information
- if (bg.fetchEvents().length == 0) {
- showError("Error in fetching data!! Check your internet connection");
- } else {
- showEvents();
- }
+ // Display the information
+ if (bg.fetchEvents().length == 0) {
+ showError("No events");
+ } else {
+ showEvents();
+ }
- // Adding buttons listeners
- document.getElementById("m_refresh").addEventListener("click", mrefresh);
+ // Adding buttons listeners
+ document.getElementById("m_refresh").addEventListener("click", mrefresh);
- // Added listener to background messages
- chrome.runtime.onMessage.addListener(function(message,sender,sendResponse){
- switch (message.text) {
- case "FETCH_EVENTS":
- setSpinner();
- //$('div.b').hide();
- break;
- case "FETCH_EVENTS_SUCCESS":
- unsetSpinner();
- showEvents();
- break;
- case "FETCH_EVENTS_DATA_ERROR":
- unsetSpinner();
- showError("Error in fetching data!! Check your internet connection");
- break;
- case "FETCH_EVENTS_URL_ERROR":
- unsetSpinner();
- showError("Configure ip address,API password, user name and password with correct values");
- break;
- default:
- console.log("Unrecognized message: ", message.text);
- break;
- }
- });
+ // Added listener to background messages
+ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
+ switch (message.text) {
+ case "FETCH_EVENTS":
+ setSpinner();
+ //$('div.b').hide();
+ break;
+ case "FETCH_EVENTS_SUCCESS":
+ unsetSpinner();
+ showEvents();
+ break;
+ case "FETCH_EVENTS_DATA_ERROR":
+ unsetSpinner();
+ showError("Error in fetching data!! Check your internet connection");
+ break;
+ case "FETCH_EVENTS_URL_ERROR":
+ unsetSpinner();
+ showError(
+ "Configure ip address,API password, user name and password with correct values"
+ );
+ break;
+ default:
+ console.log("Unrecognized message: ", message.text);
+ break;
+ }
+ });
});
-function setSpinner () {
- $('#refr_img_id').attr("src", "images/spinny.gif");
+function setSpinner() {
+ $("#refr_img_id").attr("src", "images/spinny.gif");
}
function unsetSpinner() {
- $('#refr_img_id').attr("src", "images/refresh.png");
+ $("#refr_img_id").attr("src", "images/refresh.png");
}
function clearError() {
- $('.error').hide();
- $('.error a').text("");
- $('.result').css('height', null);
+ $(".error").hide();
+ $(".error a").text("");
+ $(".result").css("height", null);
}
-function showError(text){
- $('.error a').text(text);
- $('.error').show();
- $('.result').height(420);
+function showError(text) {
+ $(".error a").text(text);
+ $(".error").show();
+ $(".result").height(420);
}
-function showEvents(){
+function showEvents() {
+ clearError();
+ $("#events").empty();
+ var e_refr = document.getElementById("event_temp");
+ if (e_refr) {
+ wrapper.removeChild(e_refr);
+ }
+ var allEvents = bg.fetchEvents();
+ var notVisitedEvents = bg.fetchNotVisited();
+ var eve = document.createElement("div");
+ eve.id = "event_temp";
+ eve.setAttribute("class", "b");
- clearError();
- $('#events').empty();
- var e_refr = document.getElementById('event_temp');
- if(e_refr){
- wrapper.removeChild(e_refr);
- }
- var allEvents = bg.fetchEvents();
- var notVisitedEvents = bg.fetchNotVisited();
- var eve=document.createElement('div');
- eve.id="event_temp";
- eve.setAttribute("class","b");
-
- var i=0;
- if(allEvents.length>0){
- while(i 0) {
+ while (i < max_events && i < allEvents.length) {
+ var eve_title = document.createElement("div");
+ eve_title.id = "e_" + i + "_" + allEvents[i]["id"];
+ var img = document.createElement("img");
+ img.src = "images/plus.png";
+ img.className = "pm";
+ img.id = "i_" + i + "_" + allEvents[i]["id"];
+ eve_title.appendChild(img);
+ var div_empty = document.createElement("img");
+ var a = document.createElement("a");
+ var temp_style;
- if (notVisitedEvents[allEvents[i]['id']] === true) {
- eve_title.style.fontWeight = 600;
- }
-
- eve_title.appendChild(a);
- eve.appendChild(eve_title);
-
- var time=allEvents[i]['date'].split(" ");
- var time_text = time[0]+" "+time[1];
-
- var p = document.createElement('p');
- var id = (allEvents[i]['module']==0)
- ? "."
- : " in the module with Id "+ allEvents[i]['module'] + ".";
-
- p.innerText = allEvents[i]['type']+" : "+allEvents[i]['source']+". Event occured at "+ time_text+id;
- p.id = 'p_' + i;
- eve_title.appendChild(p);
- i++;
- }
-
- $('#events').append(eve);
+ var agent_url =
+ allEvents[i]["agent"] == 0
+ ? localStorage["ip_address"] +
+ "/index.php?sec=eventos&sec2=operation/events/events"
+ : localStorage["ip_address"] +
+ "/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=" +
+ allEvents[i]["agent"];
+ a.setAttribute("href", agent_url);
+ a.target = "_blank";
+ a.className = "a_2_mo";
- $('img.pm').click(showHide);
- $('div.b').show();
- } else {
- showError("Error in fetching data!! Check your internet connection");
- }
-
- localStorage["new_events"]=0;
- bg.updateBadge();
+ a.innerText = allEvents[i]["title"];
+ eve_title.setAttribute("class", "event sev-" + allEvents[i]["severity"]);
+
+ if (notVisitedEvents[allEvents[i]["id"]] === true) {
+ eve_title.style.fontWeight = 600;
+ }
+
+ eve_title.appendChild(a);
+ eve.appendChild(eve_title);
+
+ var time = allEvents[i]["date"].split(" ");
+ var time_text = time[0] + " " + time[1];
+
+ var p = document.createElement("p");
+ var id =
+ allEvents[i]["module"] == 0
+ ? "."
+ : " in the module with Id " + allEvents[i]["module"] + ".";
+
+ p.innerText =
+ allEvents[i]["type"] +
+ " : " +
+ allEvents[i]["source"] +
+ ". Event occured at " +
+ time_text +
+ id;
+ p.id = "p_" + i;
+ eve_title.appendChild(p);
+ i++;
+ }
+
+ $("#events").append(eve);
+
+ $("img.pm").click(showHide);
+ $("div.b").show();
+ } else {
+ showError("No events");
+ }
+
+ localStorage["new_events"] = 0;
+ bg.updateBadge();
}
function showHide() {
- var id = $(this).attr('id');
- // Image id has the form i__
- var nums = id.split('_');
- var pid = "p_" + nums[1];
+ var id = $(this).attr("id");
+ // Image id has the form i__
+ var nums = id.split("_");
+ var pid = "p_" + nums[1];
- // Mark as visited if visited
- if($(this).parent().css('font-weight') == '600') {
- bg.removeNotVisited(nums[2]);
- $(this).parent().css('font-weight', '');
- }
+ // Mark as visited if visited
+ if (
+ $(this)
+ .parent()
+ .css("font-weight") == "600"
+ ) {
+ bg.removeNotVisited(nums[2]);
+ $(this)
+ .parent()
+ .css("font-weight", "");
+ }
- // Toggle information
- if($('#' + pid).css('display') == 'none') {
- $('#' + pid).slideDown();
- $(this).attr({src: 'images/minus.png'});
- }
- else {
- $('#' + pid).slideUp();
- $(this).attr({src: 'images/plus.png'});
- }
+ // Toggle information
+ if ($("#" + pid).css("display") == "none") {
+ $("#" + pid).slideDown();
+ $(this).attr({ src: "images/minus.png" });
+ } else {
+ $("#" + pid).slideUp();
+ $(this).attr({ src: "images/plus.png" });
+ }
}
-function mrefresh(){
- localStorage["new_events"]=0;
- bg.updateBadge();
- clearError();
- bg.resetInterval();
- bg.main();
+function mrefresh() {
+ localStorage["new_events"] = 0;
+ bg.updateBadge();
+ clearError();
+ bg.resetInterval();
+ bg.main();
}
diff --git a/extras/chrome_extension/manifest.json b/extras/chrome_extension/manifest.json
index b591121309..bff5586f0c 100644
--- a/extras/chrome_extension/manifest.json
+++ b/extras/chrome_extension/manifest.json
@@ -1,30 +1,30 @@
{
- "name": "__MSG_name__",
- "version": "2.1",
- "manifest_version": 2,
- "description": "Pandora FMS Event viewer Chrome extension",
- "homepage_url": "http://pandorafms.com",
- "browser_action": {
- "default_title": "__MSG_default_title__",
- "default_icon": "images/icon.png",
- "default_popup": "popup.html"
- },
- "background": {
- "page": "background.html"
- },
- "icons": {
- "128": "images/icon128.png",
- "16": "images/icon16.png",
- "32": "images/icon32.png",
- "48": "images/icon48.png"
- },
- "options_page": "options.html",
- "permissions": [
- "tabs",
- "notifications",
- "http://*/*",
- "https://*/*",
- "background"
- ],
- "default_locale": "en"
- }
+ "name": "__MSG_name__",
+ "version": "2.2",
+ "manifest_version": 2,
+ "description": "Pandora FMS Event viewer Chrome extension",
+ "homepage_url": "http://pandorafms.com",
+ "browser_action": {
+ "default_title": "__MSG_default_title__",
+ "default_icon": "images/icon.png",
+ "default_popup": "popup.html"
+ },
+ "background": {
+ "page": "background.html"
+ },
+ "icons": {
+ "128": "images/icon128.png",
+ "16": "images/icon16.png",
+ "32": "images/icon32.png",
+ "48": "images/icon48.png"
+ },
+ "options_page": "options.html",
+ "permissions": [
+ "tabs",
+ "notifications",
+ "http://*/*",
+ "https://*/*",
+ "background"
+ ],
+ "default_locale": "en"
+}
diff --git a/extras/docker/build_and_push.sh b/extras/docker/build_and_push.sh
index 91e6fa15e5..c58a73bf8e 100755
--- a/extras/docker/build_and_push.sh
+++ b/extras/docker/build_and_push.sh
@@ -1,3 +1,4 @@
#!/bin/bash
docker build --rm=true --pull --no-cache --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \
+[ "$QA_ENV" == "" ] && \
docker push pandorafms/pandorafms:7
diff --git a/pandora_agents/Dockerfile b/pandora_agents/Dockerfile
new file mode 100644
index 0000000000..945a74b1c9
--- /dev/null
+++ b/pandora_agents/Dockerfile
@@ -0,0 +1,50 @@
+FROM centos:centos7
+MAINTAINER Pandora FMS Team
+
+# Add Pandora FMS agent installer
+ADD unix /tmp/pandora_agent/unix
+
+# Install dependencies
+RUN yum -y install \
+ epel-release \
+ unzip \
+ perl \
+ sed \
+ "perl(Sys::Syslog)"
+
+# Install Pandora FMS agent
+RUN cd /tmp/pandora_agent/unix \
+ && chmod +x pandora_agent_installer \
+ && ./pandora_agent_installer --install
+
+# Set default variables
+ENV SERVER_IP '127.0.0.1'
+ENV REMOTE_CONFIG '0'
+ENV GROUP 'Servers'
+ENV DEBUG '0'
+ENV AGENT_NAME 'agent_docker'
+ENV AGENT_ALIAS 'agent_docker'
+ENV TIMEZONE 'UTC'
+ENV SECONDARY_GROUPS ''
+
+# Create the entrypoint script.
+RUN echo -e '#/bin/bash\n \
+sed -i "s/^server_ip.*$/server_ip $SERVER_IP/g" /etc/pandora/pandora_agent.conf\n \
+sed -i "s/^remote_config.*$/remote_config $REMOTE_CONFIG/g" /etc/pandora/pandora_agent.conf\n \
+sed -i "s/^group.*$/group $GROUP/g" /etc/pandora/pandora_agent.conf\n \
+sed -i "s/^debug.*$/debug $DEBUG/g" /etc/pandora/pandora_agent.conf\n \
+sed -i "s/^#agent_name.*$/agent_name $AGENT_NAME/g" /etc/pandora/pandora_agent.conf\n \
+sed -i "s/^#agent_alias.*$/agent_alias $AGENT_ALIAS/g" /etc/pandora/pandora_agent.conf\n \
+sed -i "s/^# secondary_groups.*$/secondary_groups $SECONDARY_GROUPS/g" /etc/pandora/pandora_agent.conf\n \
+if [ $TIMEZONE != "" ]; then\n \
+\tln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime\n \
+fi\n \
+/etc/init.d/pandora_agent_daemon start\n \
+rm -f $0\n \
+tail -f /var/log/pandora/pandora_agent.log' \
+>> /entrypoint.sh && \
+chmod +x /entrypoint.sh
+
+# Entrypoint + CMD
+ENTRYPOINT ["bash"]
+CMD ["/entrypoint.sh"]
\ No newline at end of file
diff --git a/pandora_agents/build_agent_docker.sh b/pandora_agents/build_agent_docker.sh
new file mode 100644
index 0000000000..0ebf8ac7a0
--- /dev/null
+++ b/pandora_agents/build_agent_docker.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+source /root/code/pandorafms/extras/build_vars.sh
+
+# Set tag for docker build
+if [ "$1" == "nightly" ]; then
+ LOCAL_VERSION="latest"
+else
+ LOCAL_VERSION=$VERSION
+fi
+
+# Build image with code
+docker build --rm=true --pull --no-cache -t pandorafms/pandorafms-agent:$LOCAL_VERSION -f $CODEHOME/pandora_agents/Dockerfile $CODEHOME/pandora_agents/
+
+# Push image
+docker push pandorafms/pandorafms-agent:$LOCAL_VERSION
+
+# Delete local image
+docker image rm -f pandorafms/pandorafms-agent:$LOCAL_VERSION
\ No newline at end of file
diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf
index 0ff67a62d3..f3657d3a7a 100644
--- a/pandora_agents/pc/AIX/pandora_agent.conf
+++ b/pandora_agents/pc/AIX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, AIX version
+# Version 7.0NG.740, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf
index c7c6fdd493..95fd1090ad 100644
--- a/pandora_agents/pc/FreeBSD/pandora_agent.conf
+++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, FreeBSD Version
+# Version 7.0NG.740, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf
index 1a349583dc..04122feb30 100644
--- a/pandora_agents/pc/HP-UX/pandora_agent.conf
+++ b/pandora_agents/pc/HP-UX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, HP-UX Version
+# Version 7.0NG.740, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf
index dc172b7e2f..b083e7f3aa 100644
--- a/pandora_agents/pc/Linux/pandora_agent.conf
+++ b/pandora_agents/pc/Linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf
index 3d76832397..4bb88c5b4e 100644
--- a/pandora_agents/pc/NT4/pandora_agent.conf
+++ b/pandora_agents/pc/NT4/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf
index 9b088eae51..a90b7227ca 100644
--- a/pandora_agents/pc/SunOS/pandora_agent.conf
+++ b/pandora_agents/pc/SunOS/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, Solaris Version
+# Version 7.0NG.740, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf
index e2c442a520..d750898b70 100644
--- a/pandora_agents/pc/Win32/pandora_agent.conf
+++ b/pandora_agents/pc/Win32/pandora_agent.conf
@@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
-# Version 7.0NG.735
+# Version 7.0NG.740
# 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
diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf
index fea0cb56db..6a663d6331 100644
--- a/pandora_agents/shellscript/aix/pandora_agent.conf
+++ b/pandora_agents/shellscript/aix/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.735, AIX version
+# Version 7.0NG.740, AIX version
# General Parameters
# ==================
diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
index f0ce5b2519..99e4c62462 100644
--- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
+++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.735
+# Version 7.0NG.740
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena
diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf
index 20cdfeff99..7a9d2c4347 100644
--- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf
+++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.735, HPUX Version
+# Version 7.0NG.740, HPUX Version
# General Parameters
# ==================
diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf
index e8ba9653ce..a55d96a952 100644
--- a/pandora_agents/shellscript/linux/pandora_agent.conf
+++ b/pandora_agents/shellscript/linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735
+# Version 7.0NG.740
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf
index 29d13ff75c..a24a24d16e 100644
--- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf
+++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735
+# Version 7.0NG.740
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf
index 8ef8a6fdc1..74d515cb4e 100644
--- a/pandora_agents/shellscript/openWRT/pandora_agent.conf
+++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735
+# Version 7.0NG.740
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net
diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf
index 1ace947818..dc915ef18e 100644
--- a/pandora_agents/shellscript/solaris/pandora_agent.conf
+++ b/pandora_agents/shellscript/solaris/pandora_agent.conf
@@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
-# Version 7.0NG.735, Solaris version
+# Version 7.0NG.740, Solaris version
# General Parameters
# ==================
diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf
index c67f64d16c..de7e97911b 100644
--- a/pandora_agents/unix/AIX/pandora_agent.conf
+++ b/pandora_agents/unix/AIX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, AIX version
+# Version 7.0NG.740, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index df1ed8c960..e5cccf6c23 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-agent-unix
-Version: 7.0NG.735-190621
+Version: 7.0NG.740-191121
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 5290897e5b..b77eaa48c4 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.735-190621"
+pandora_version="7.0NG.740-191121"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf
index d7ee481255..34dd1bf4fc 100644
--- a/pandora_agents/unix/Darwin/pandora_agent.conf
+++ b/pandora_agents/unix/Darwin/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf
index b02b379470..e4ad74ffe7 100644
--- a/pandora_agents/unix/FreeBSD/pandora_agent.conf
+++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, FreeBSD Version
+# Version 7.0NG.740, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf
index 57e35c0a03..e55445fe13 100644
--- a/pandora_agents/unix/HP-UX/pandora_agent.conf
+++ b/pandora_agents/unix/HP-UX/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, HP-UX Version
+# Version 7.0NG.740, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf
index db07876f12..54ace6a811 100644
--- a/pandora_agents/unix/Linux/pandora_agent.conf
+++ b/pandora_agents/unix/Linux/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf
index 8cda0f8fe0..94e32e8056 100644
--- a/pandora_agents/unix/NT4/pandora_agent.conf
+++ b/pandora_agents/unix/NT4/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, GNU/Linux
+# Version 7.0NG.740, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf
index 629fe6a6fb..71e7d14192 100644
--- a/pandora_agents/unix/NetBSD/pandora_agent.conf
+++ b/pandora_agents/unix/NetBSD/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, NetBSD Version
+# Version 7.0NG.740, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf
index 8ff3c52de5..cc89dee501 100644
--- a/pandora_agents/unix/SunOS/pandora_agent.conf
+++ b/pandora_agents/unix/SunOS/pandora_agent.conf
@@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
-# Version 7.0NG.735, Solaris Version
+# Version 7.0NG.740, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index bb13d57ee6..9625518306 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
-use constant AGENT_VERSION => '7.0NG.735';
-use constant AGENT_BUILD => '190621';
+use constant AGENT_VERSION => '7.0NG.740';
+use constant AGENT_BUILD => '191121';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@@ -239,6 +239,15 @@ my $tentacle_pid = undef;
# PID of udp_server
my $udp_server_pid = undef;
+# BrokerFlag
+my $BrokerFlag = 0;
+
+# Global loop counter.
+my $LoopCounter = 0;
+
+# Define a max value for loopCounter to avoid overflow.
+use constant MAX_LOOP_COUNTER => 1000000000;
+
################################################################################
# Print usage information and exit.
################################################################################
@@ -1385,6 +1394,7 @@ sub sleep_agent {
exit (0);
}
+ $LoopCounter = ($LoopCounter + 1) % MAX_LOOP_COUNTER;
return $iter_base_time;
}
@@ -1699,6 +1709,14 @@ sub exec_module {
}
# Check module interval
+ if ($BrokerFlag > 0) {
+ if ($LoopCounter == 0) {
+ $module->{'counter'} = $module->{'intensive_interval'};
+ } else {
+ $module->{'counter'} = (($LoopCounter -1 ) % $module->{'intensive_interval'});
+ }
+ }
+
if (++($module->{'counter'}) < $module->{'intensive_interval'}) {
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
return;
@@ -2985,7 +3003,6 @@ while (1) {
@BrokerPid = ();
my @broker_agents = read_config ('broker_agent');
foreach my $broker_agent (@broker_agents) {
-
# Create broker conf file if it does not exist
if (! -e "$ConfDir/${broker_agent}.conf") {
write_broker_conf($broker_agent);
@@ -2995,7 +3012,9 @@ while (1) {
# Broker agent
if ($main_agent == 0) {
-
+ # Mark broker flag.
+ $BrokerFlag = 1;
+
# Set the configuration file
$ConfFile = "${broker_agent}.conf";
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index c606d1d811..a308bf9350 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
-%define version 7.0NG.735
-%define release 190621
+%define version 7.0NG.740
+%define release 191121
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index fca14e0a1c..6f71dee5b5 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
-%define version 7.0NG.735
-%define release 190621
+%define version 7.0NG.740
+%define release 191121
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 67e49267c6..099ed7b6ca 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
-PI_VERSION="7.0NG.735"
-PI_BUILD="190621"
+PI_VERSION="7.0NG.740"
+PI_BUILD="191121"
OS_NAME=`uname -s`
FORCE=0
@@ -162,7 +162,15 @@ uninstall () {
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null
rm -Rf $PANDORA_BASE$PANDORA_REVENT_BIN 2> /dev/null
rm -f $DESTDIR/etc/logrotate.d/pandora_agent
-
+
+ # Remove systemd service if exists
+ if [ $(systemctl --v | grep systemd | wc -l) != 0 ]
+ then
+ PANDORA_AGENT_SERVICE="/etc/systemd/system/pandora_agent_daemon.service"
+ rm -f $PANDORA_AGENT_SERVICE
+ systemctl reset-failed
+ fi
+
#Test if exist Pandora Server in this machine
if [ -d $PANDORA_BASE$PANDORA_TEMP/data_in ]
then
@@ -465,6 +473,22 @@ install () {
else
RCDIRS="/etc/rc2.d /etc/rc3.d"
fi
+
+ # Create systemd service
+ if [ $(systemctl --v | grep systemd | wc -l) != 0 ]
+ then
+ echo "Creating systemd service for pandora_agent_daemon"
+
+ PANDORA_AGENT_SERVICE="/etc/systemd/system/pandora_agent_daemon.service"
+ EXEC_START='ExecStart='$PANDORA_BASE$PANDORA_BIN' '$PANDORA_BASE$PANDORA_CFG
+
+ rm -f $PANDORA_AGENT_SERVICE
+ cp pandora_agent_daemon.service $PANDORA_AGENT_SERVICE
+
+ sed -i "s|^ExecStart=.*$|$EXEC_START|g" $PANDORA_AGENT_SERVICE
+
+ systemctl daemon-reload
+ fi
fi
[ "$RCDIRS" ] && for RCDIR in $RCDIRS
do
diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf
index 518cd3df0e..79660e5b5d 100644
--- a/pandora_agents/win32/bin/pandora_agent.conf
+++ b/pandora_agents/win32/bin/pandora_agent.conf
@@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
-# Version 7.0NG.735
+# Version 7.0NG.740
# 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
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index cb4764278a..1bedee5bc5 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
-{Pandora FMS Windows Agent v7.0NG.735}
+{Pandora FMS Windows Agent v7.0NG.740}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{190621}
+{191121}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc
index e7c751d367..7cbde21ca7 100644
--- a/pandora_agents/win32/modules/pandora_module.cc
+++ b/pandora_agents/win32/modules/pandora_module.cc
@@ -1422,48 +1422,48 @@ Pandora_Module::evaluatePreconditions () {
buffer[read] = '\0';
output += (char *) buffer;
}
-
- try {
- double_output = Pandora_Strutils::strtodouble (output);
- } catch (Pandora_Strutils::Invalid_Conversion e) {
- double_output = 0;
+
+ try {
+ double_output = Pandora_Strutils::strtodouble (output);
+ } catch (Pandora_Strutils::Invalid_Conversion e) {
+ double_output = 0;
+ }
+
+ if (dwRet == WAIT_OBJECT_0) {
+ break;
+ } else if(this->getTimeout() < GetTickCount() - tickbase) {
+ /* STILL_ACTIVE */
+ TerminateProcess(pi.hThread, STILL_ACTIVE);
+ pandoraLog ("evaluatePreconditions: %s timed out (retcode: %d)", this->module_name.c_str (), STILL_ACTIVE);
+ break;
+ }
}
- if (dwRet == WAIT_OBJECT_0) {
- break;
- } else if(this->getTimeout() < GetTickCount() - tickbase) {
- /* STILL_ACTIVE */
- TerminateProcess(pi.hThread, STILL_ACTIVE);
- pandoraLog ("evaluatePreconditions: %s timed out (retcode: %d)", this->module_name.c_str (), STILL_ACTIVE);
- break;
+ GetExitCodeProcess (pi.hProcess, &retval);
+
+ if (retval != 0) {
+ if (! TerminateJobObject (job, 0)) {
+ pandoraLog ("evaluatePreconditions: TerminateJobObject failed. (error %d)",
+ GetLastError ());
+ }
+ if (retval != STILL_ACTIVE) {
+ pandoraLog ("evaluatePreconditions: %s did not executed well (retcode: %d)",
+ this->module_name.c_str (), retval);
+ }
+ /* Close job, process and thread handles. */
+ CloseHandle (job);
+ CloseHandle (pi.hProcess);
+ CloseHandle (pi.hThread);
+ CloseHandle (new_stdout);
+ CloseHandle (out_read);
+ return 0;
}
- }
-
- GetExitCodeProcess (pi.hProcess, &retval);
-
- if (retval != 0) {
- if (! TerminateJobObject (job, 0)) {
- pandoraLog ("evaluatePreconditions: TerminateJobObject failed. (error %d)",
- GetLastError ());
- }
- if (retval != STILL_ACTIVE) {
- pandoraLog ("evaluatePreconditions: %s did not executed well (retcode: %d)",
- this->module_name.c_str (), retval);
- }
+
/* Close job, process and thread handles. */
CloseHandle (job);
CloseHandle (pi.hProcess);
CloseHandle (pi.hThread);
- CloseHandle (new_stdout);
- CloseHandle (out_read);
- return 0;
}
-
- /* Close job, process and thread handles. */
- CloseHandle (job);
- CloseHandle (pi.hProcess);
- CloseHandle (pi.hThread);
- }
CloseHandle (new_stdout);
CloseHandle (out_read);
@@ -1693,4 +1693,18 @@ Pandora_Module::getAsync () {
return this->async;
}
+/**
+ * Get current exections
+ */
+long
+Pandora_Module::getExecutions () {
+ return this->executions;
+}
+/**
+ * Set current execution (global) used for brokers.
+ */
+void
+Pandora_Module::setExecutions (long executions) {
+ this->executions = executions;
+}
diff --git a/pandora_agents/win32/modules/pandora_module.h b/pandora_agents/win32/modules/pandora_module.h
index c766766950..3b9d6c15a4 100644
--- a/pandora_agents/win32/modules/pandora_module.h
+++ b/pandora_agents/win32/modules/pandora_module.h
@@ -234,6 +234,8 @@ namespace Pandora_Modules {
int getTimeout ();
string getSave ();
bool getAsync ();
+ void setExecutions(long executions=0);
+ long getExecutions();
virtual string getXml ();
diff --git a/pandora_agents/win32/modules/pandora_module_factory.cc b/pandora_agents/win32/modules/pandora_module_factory.cc
index a4d9553c20..4c84910ac5 100644
--- a/pandora_agents/win32/modules/pandora_module_factory.cc
+++ b/pandora_agents/win32/modules/pandora_module_factory.cc
@@ -1214,7 +1214,8 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
module_source,
module_eventtype,
module_eventcode,
- module_pattern);
+ module_pattern,
+ module_application);
} else if (module_wmiquery != "") {
module = new Pandora_Module_WMIQuery (module_name,
module_wmiquery, module_wmicolumn);
diff --git a/pandora_agents/win32/modules/pandora_module_logchannel.cc b/pandora_agents/win32/modules/pandora_module_logchannel.cc
index 4ec72df63c..3c1c4666dd 100755
--- a/pandora_agents/win32/modules/pandora_module_logchannel.cc
+++ b/pandora_agents/win32/modules/pandora_module_logchannel.cc
@@ -53,7 +53,7 @@ static EvtUpdateBookmarkT EvtUpdateBookmarkF = NULL;
* @param name Module name.
* @param service_name Service internal name to check.
*/
-Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern)
+Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern, string application)
: Pandora_Module (name) {
int i;
vector query;
@@ -93,6 +93,13 @@ Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source
query.push_back(ss.str());
}
+ // Set the application
+ if (application != "") {
+ wstringstream ss;
+ ss << L"*[System/Provider[@Name='" << application.c_str() << L"']]";
+ query.push_back(ss.str());
+ }
+
// Fill the filter
if (query.size() == 0) {
this->filter = L"*";
@@ -579,4 +586,4 @@ Pandora_Module_Logchannel::GetMessageString(EVT_HANDLE hMetadata, EVT_HANDLE hEv
}
return pBuffer;
-}
\ No newline at end of file
+}
diff --git a/pandora_agents/win32/modules/pandora_module_logchannel.h b/pandora_agents/win32/modules/pandora_module_logchannel.h
index 19cde78b93..c008c0aac1 100755
--- a/pandora_agents/win32/modules/pandora_module_logchannel.h
+++ b/pandora_agents/win32/modules/pandora_module_logchannel.h
@@ -75,7 +75,7 @@ namespace Pandora_Modules {
LPWSTR GetMessageString(EVT_HANDLE hMetadata, EVT_HANDLE hEvent, EVT_FORMAT_MESSAGE_FLAGS FormatId);
public:
- Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern);
+ Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern, string application);
void run ();
};
}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 9ca3c1b610..607cbf8e5a 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.735(Build 190621)")
+#define PANDORA_VERSION ("7.0NG.740(Build 191121)")
string pandora_path;
string pandora_dir;
diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc
index 275ee60724..b62fc1f70d 100644
--- a/pandora_agents/win32/pandora_windows_service.cc
+++ b/pandora_agents/win32/pandora_windows_service.cc
@@ -1849,7 +1849,7 @@ Pandora_Windows_Service::sendBufferedXml (string path) {
}
void
-Pandora_Windows_Service::pandora_run_broker (string config) {
+Pandora_Windows_Service::pandora_run_broker (string config, long executions) {
Pandora_Agent_Conf *conf = NULL;
string server_addr;
unsigned char data_flag = 0;
@@ -1876,7 +1876,10 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
Pandora_Module *module;
module = this->broker_modules->getCurrentValue ();
-
+
+ /* Keep executions matching main agent */
+ module->setExecutions(executions);
+
/* Check preconditions */
if (module->evaluatePreconditions () == 0) {
pandoraDebug ("Preconditions not matched for module %s", module->getName ().c_str ());
@@ -2074,7 +2077,7 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
check_broker_agents(all_conf);
for (i=0;i";
html_print_input_hidden('db_status_execute', 1);
- html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub"');
+ html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub next"');
echo '';
echo '';
diff --git a/pandora_console/extensions/files_repo/files_repo_form.php b/pandora_console/extensions/files_repo/files_repo_form.php
index 2035cfbd1a..b8e6a084b9 100644
--- a/pandora_console/extensions/files_repo/files_repo_form.php
+++ b/pandora_console/extensions/files_repo/files_repo_form.php
@@ -44,24 +44,16 @@ $groups = groups_get_all();
// Add the All group to the beginning to be always the first
// Use this instead array_unshift to keep the array keys
$groups = ([0 => __('All')] + $groups);
-$html = '';
-$style = 'style="padding: 2px 10px; display: inline-block;"';
+$groups_selected = [];
foreach ($groups as $id => $name) {
- $checked = in_array($id, $file['groups']);
- $all_checked = false;
- if ($id === 0) {
- $checkbox = html_print_checkbox_extended('groups[]', $id, $checked, false, '', 'class="chkb_all"', true);
- $all_checked = $checked;
- } else {
- $checkbox = html_print_checkbox_extended('groups[]', $id, $checked, $all_checked, '', 'class="chkb_group"', true);
+ if (in_array($id, $file['groups'])) {
+ $groups_selected[] = $id;
}
-
- $html .= "
$name $checkbox
";
}
$row = [];
$row[0] = __('Groups');
-$row[1] = $html;
+$row[1] = html_print_select($groups, 'groups[]', $groups_selected, '', '', '', true, true, '', '', '');
$table->data[] = $row;
$table->colspan[][1] = 3;
diff --git a/pandora_console/extensions/files_repo/functions_files_repo.php b/pandora_console/extensions/files_repo/functions_files_repo.php
index 3d9bdccd38..32ce4c216c 100644
--- a/pandora_console/extensions/files_repo/functions_files_repo.php
+++ b/pandora_console/extensions/files_repo/functions_files_repo.php
@@ -193,7 +193,7 @@ function files_repo_add_file($file_input_name='upfile', $description='', $groups
global $config;
$attachment_path = io_safe_output($config['attachment_store']);
- $files_repo_path = $attachment_path.'/'.'files_repo';
+ $files_repo_path = $attachment_path.'/files_repo';
$result = [];
$result['status'] = false;
diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php
index d9843f9860..35519e144d 100644
--- a/pandora_console/extensions/module_groups.php
+++ b/pandora_console/extensions/module_groups.php
@@ -30,6 +30,15 @@
global $config;
check_login();
+// ACL Check
+if (!check_acl($config['id_user'], 0, 'AR')) {
+ db_pandora_audit(
+ 'ACL Violation',
+ 'Trying to access Module Groups view'
+ );
+ include 'general/noaccess.php';
+ exit;
+}
if (is_ajax()) {
$get_info_alert_module_group = (bool) get_parameter('get_info_alert_module_group');
@@ -82,6 +91,16 @@ function mainModuleGroups()
$agent_group_search = get_parameter('agent_group_search', '');
$module_group_search = get_parameter('module_group_search', '');
+ // Check the user's group permissions.
+ $user_groups = users_get_groups($config['user'], 'AR');
+ $info = array_filter(
+ $info,
+ function ($v, $k) use ($user_groups) {
+ return $user_groups[$v['id']] != null;
+ },
+ ARRAY_FILTER_USE_BOTH
+ );
+
$info = array_filter(
$info,
function ($v, $k) use ($agent_group_search) {
@@ -265,11 +284,17 @@ function mainModuleGroups()
text-align: center;
';
- if (true) {
+ if ($info && $array_module_group) {
$table = new StdClass();
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
$table->width = '100%';
+ if ($config['style'] === 'pandora_black') {
+ $background_color = '#333';
+ } else {
+ $background_color = '#fff';
+ }
+
$head[0] = __('Groups');
$headstyle[0] = 'width: 20%; font-weight: bolder;';
foreach ($array_module_group as $key => $value) {
@@ -290,22 +315,22 @@ function mainModuleGroups()
$url = 'index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&ag_group='.$key.'&modulegroup='.$k;
if ($array_data[$key][$k]['alerts_module_count'] != 0) {
- $color = '#FFA631';
+ $color = COL_ALERTFIRED;
// Orange when the cell for this model group and agent has at least one alert fired.
} else if ($array_data[$key][$k]['critical_module_count'] != 0) {
- $color = '#e63c52';
+ $color = COL_CRITICAL;
// Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
} else if ($array_data[$key][$k]['warning_module_count'] != 0) {
- $color = '#f3b200';
+ $color = COL_WARNING;
// Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
} else if ($array_data[$key][$k]['unknown_module_count'] != 0) {
- $color = '#B2B2B2 ';
+ $color = COL_UNKNOWN;
// Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
} else if ($array_data[$key][$k]['normal_module_count'] != 0) {
- $color = '#82b92e';
+ $color = COL_NORMAL;
// Green when the cell for this model group and agent has OK state all modules.
} else if ($array_data[$key][$k]['notInit_module_count'] != 0) {
- $color = '#5BB6E5';
+ $color = COL_NOTINIT;
// Blue when the cell for this module group and all modules have not init value.
}
@@ -314,7 +339,7 @@ function mainModuleGroups()
$data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '';
} else {
- $data[$i][$j] = "
';
- echo "';
-
- $operation = get_parameter('operation', 0);
- $community = get_parameter('community', 'public');
- $ip = get_parameter('select_ips');
-
if (!validate_address($ip)) {
- ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
+ ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
} else {
switch ($operation) {
case 1:
@@ -175,7 +147,7 @@ function main_net_tools()
} else {
echo '
';
-
- render_row($attachment_total_files, 'Total files in the attached folder');
- render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
-
- echo "
".__(' Information from the tagente_datos table').'
';
-
- render_row($tagente_datos_size, 'Total data in tagente_datos table');
- render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status');
- render_row(execution_time(), 'Execution time degradation when executing a count');
-
- echo "
".__(' Pandora FMS server threads').'
';
-
- render_row($total_server_threads, 'Total server threads');
- render_row($percentage_threads_ram.'%', 'Percentage of threads used by the RAM');
- render_row($percentage_threads_cpu.'%', 'Percentage of threads used by the CPU');
-
- echo "
".__(' Graphs modules that represent the self-monitoring system').'
';
- }
-
- echo "";
-
- echo ''.__(
- '(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to
- keep the database up-to-date to get the best performance and results in Pandora'
- ).'
';
+// remove file.
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index 2ccdcf423c..3a73d8b02c 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -60,6 +60,10 @@ ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_next` bigint(20) NOT NULL def
ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+ALTER TABLE `tlocal_component` MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0',
+ MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0';
+
-- -----------------------------------------------------
-- Table `tpolicy_modules`
-- -----------------------------------------------------
@@ -138,6 +142,10 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` (
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+ALTER TABLE `tpolicy_modules` MODIFY COLUMN `ip_target` varchar(100) NULL DEFAULT '',
+ MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0',
+ MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `tpolicies`
@@ -187,6 +195,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` (
ALTER TABLE `tpolicy_agents` ADD COLUMN `id_node` int(10) NOT NULL DEFAULT '0';
ALTER TABLE `tpolicy_agents` ADD UNIQUE(`id_policy`, `id_agent`, `id_node`);
+ALTER TABLE `tpolicy_agents` DROP INDEX `id_policy`, ADD UNIQUE INDEX `id_policy` (`id_policy`, `id_agent`, `id_node`), DROP INDEX `id_policy_2`;
-- -----------------------------------------------------
-- Table `tpolicy_groups`
@@ -219,14 +228,17 @@ CREATE TABLE IF NOT EXISTS `tdashboard` (
-- Table `tdatabase`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tdatabase` (
- `id` int(10) unsigned NOT NULL auto_increment,
- `host` varchar(100) default '',
- `os_port` int(4) unsigned default '22',
- `os_user` varchar(100) default '',
- `db_port` int(4) unsigned default '3306',
+ `id` INT(10) unsigned NOT NULL auto_increment,
+ `host` VARCHAR(255) default '',
+ `label` VARCHAR(255) default '',
+ `os_port` INT UNSIGNED NOT NULL DEFAULT 22,
+ `os_user` VARCHAR(255) default '',
+ `db_port` INT UNSIGNED NOT NULL DEFAULT 3306,
`status` tinyint(1) unsigned default '0',
`action` tinyint(1) unsigned default '0',
- `last_error` varchar(255) default '',
+ `ssh_key` TEXT,
+ `ssh_pubkey` TEXT,
+ `last_error` TEXT,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
@@ -374,6 +386,12 @@ ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbhost` text;
ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbport` text;
ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbname` text;
+ALTER TABLE `tmetaconsole_setup` MODIFY COLUMN `meta_dbuser` text NULL,
+ MODIFY COLUMN `meta_dbpass` text NULL,
+ MODIFY COLUMN `meta_dbhost` text NULL,
+ MODIFY COLUMN `meta_dbport` text NULL,
+ MODIFY COLUMN `meta_dbname` text NULL;
+
-- ---------------------------------------------------------------------
-- Table `tprofile_view`
-- ---------------------------------------------------------------------
@@ -724,7 +742,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`type` varchar(30) default 'simple_graph',
`period` int(11) NOT NULL default 0,
`order` int (11) NOT NULL default 0,
- `description` mediumtext,
+ `description` mediumtext,
`text_agent` text,
`text` TEXT,
`external_source` Text,
@@ -761,23 +779,6 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
--- ----------------------------------------------------------------------
--- Table `tnews`
--- ----------------------------------------------------------------------
-CREATE TABLE IF NOT EXISTS `tnews` (
- `id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
- `author` varchar(255) NOT NULL DEFAULT '',
- `subject` varchar(255) NOT NULL DEFAULT '',
- `text` TEXT NOT NULL,
- `timestamp` DATETIME NOT NULL DEFAULT 0,
- `id_group` int(10) NOT NULL default 0,
- `modal` tinyint(1) DEFAULT 0,
- `expire` tinyint(1) DEFAULT 0,
- `expire_timestamp` DATETIME NOT NULL DEFAULT 0,
- PRIMARY KEY(`id_news`)
-) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-
-
ALTER TABLE treport_content_template ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300';
@@ -796,6 +797,29 @@ ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DE
ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
+ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300',
+ MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0';
+
+-- ----------------------------------------------------------------------
+-- Table `tnews`
+-- ----------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tnews` (
+ `id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
+ `author` varchar(255) NOT NULL DEFAULT '',
+ `subject` varchar(255) NOT NULL DEFAULT '',
+ `text` TEXT NOT NULL,
+ `timestamp` DATETIME NOT NULL DEFAULT 0,
+ `id_group` int(10) NOT NULL default 0,
+ `modal` tinyint(1) DEFAULT 0,
+ `expire` tinyint(1) DEFAULT 0,
+ `expire_timestamp` DATETIME NOT NULL DEFAULT 0,
+ PRIMARY KEY(`id_news`)
+) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@@ -1007,10 +1031,12 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`agent_version` varchar(100) default '',
`ultimo_contacto_remoto` datetime default '1970-01-01 00:00:00',
`disabled` tinyint(2) NOT NULL default '0',
+ `remote` tinyint(1) NOT NULL default '0',
`id_parent` int(10) unsigned default '0',
`custom_id` varchar(255) default '',
`server_name` varchar(100) default '',
`cascade_protection` tinyint(2) NOT NULL default '0',
+ `cascade_protection_module` int(10) unsigned default '0',
`timezone_offset` TINYINT(2) NULL DEFAULT '0' COMMENT 'number of hours of diference with the server timezone' ,
`icon_path` VARCHAR(127) NULL DEFAULT NULL COMMENT 'path in the server to the image of the icon representing the agent' ,
`update_gis_data` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and do not update it' ,
@@ -1025,18 +1051,28 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`fired_count` bigint(20) NOT NULL default '0',
`update_module_count` tinyint(1) NOT NULL default '0',
`update_alert_count` tinyint(1) NOT NULL default '0',
+ `update_secondary_groups` tinyint(1) NOT NULL default '0',
+ `transactional_agent` tinyint(1) NOT NULL default '0',
+ `alias` varchar(600) BINARY NOT NULL default '',
+ `alias_as_name` tinyint(2) NOT NULL default '0',
+ `safe_mode_module` int(10) unsigned NOT NULL default '0',
+ `cps` int NOT NULL default 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),
+ KEY `id_tagente_idx` (`id_tagente`),
KEY `disabled` (`disabled`),
KEY `id_grupo` (`id_grupo`),
FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-ALTER TABLE tmetaconsole_agent ADD COLUMN `remote` tinyint(1) NOT NULL default '0';
-ALTER TABLE tmetaconsole_agent ADD COLUMN `cascade_protection_module` int(10) default '0';
-ALTER TABLE tmetaconsole_agent ADD COLUMN `transactional_agent` tinyint(1) NOT NULL default '0';
-ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT '';
+ALTER TABLE `tmetaconsole_agent` ADD COLUMN `remote` tinyint(1) NOT NULL DEFAULT '0',
+ ADD COLUMN `cascade_protection_module` int(10) unsigned NULL DEFAULT '0',
+ ADD COLUMN `transactional_agent` tinyint(1) NOT NULL DEFAULT '0',
+ ADD COLUMN `alias` varchar(600) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ MODIFY COLUMN `update_secondary_groups` tinyint(1) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0',
+ ADD INDEX `id_tagente_idx` (`id_tagente`);
-- ---------------------------------------------------------------------
-- Table `ttransaction`
@@ -1093,6 +1129,8 @@ CREATE TABLE IF NOT EXISTS `titem` (
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
+ALTER TABLE `titem` MODIFY COLUMN `source_data` varchar(250) NULL DEFAULT '';
+
-- ---------------------------------------------------------------------
-- Table `tmap`
-- ---------------------------------------------------------------------
@@ -1119,7 +1157,6 @@ CREATE TABLE IF NOT EXISTS `tmap` (
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-
-- ---------------------------------------------------------------------
-- Table `trel_item`
-- ---------------------------------------------------------------------
@@ -1137,6 +1174,10 @@ CREATE TABLE IF NOT EXISTS `trel_item` (
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
+ALTER TABLE `trel_item` MODIFY COLUMN `id_map` int(10) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `id_parent_source_data` int(10) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `id_child_source_data` int(10) unsigned NOT NULL DEFAULT '0';
+
-- ---------------------------------------------------------------------
-- Table `talert_templates`
-- ---------------------------------------------------------------------
@@ -1160,6 +1201,11 @@ 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 "";
+ALTER TABLE `talert_snmp` MODIFY COLUMN `al_field11` text NOT NULL,
+ MODIFY COLUMN `al_field12` text NOT NULL,
+ MODIFY COLUMN `al_field13` text NOT NULL,
+ MODIFY COLUMN `al_field14` text NOT NULL,
+ MODIFY COLUMN `al_field15` text NOT NULL;
-- ---------------------------------------------------------------------
-- Table `talert_snmp_action`
@@ -1174,6 +1220,7 @@ 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;
+ALTER TABLE `tserver` MODIFY COLUMN `server_keepalive` int(11) NOT NULL DEFAULT '0';
-- ----------------------------------------------------------------------
-- Table `tagente_estado`
@@ -1185,6 +1232,11 @@ ALTER TABLE tagente_estado ADD COLUMN last_unknown_update bigint(20) NOT NULL de
ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0';
ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0';
ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0';
+ALTER TABLE `tagente_estado` MODIFY COLUMN `datos` mediumtext NOT NULL,
+ MODIFY COLUMN `known_status` tinyint(4) NULL DEFAULT '0',
+ MODIFY COLUMN `last_known_status` tinyint(4) NULL DEFAULT '0',
+ MODIFY COLUMN `last_dynamic_update` bigint(20) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `last_unknown_update` bigint(20) NOT NULL DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `talert_actions`
@@ -1208,6 +1260,11 @@ 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 "";
+ALTER TABLE `talert_actions` MODIFY COLUMN `field11` text NOT NULL,
+ MODIFY COLUMN `field12` text NOT NULL,
+ MODIFY COLUMN `field13` text NOT NULL,
+ MODIFY COLUMN `field14` text NOT NULL,
+ MODIFY COLUMN `field15` text NOT NULL;
-- ---------------------------------------------------------------------
-- Table `talert_commands`
@@ -1219,15 +1276,14 @@ ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
+DELETE FROM `talert_commands` WHERE `id` = 11;
+
+ALTER TABLE `talert_commands` MODIFY COLUMN `id_group` mediumint(8) unsigned NULL DEFAULT '0';
+
-- ---------------------------------------------------------------------
-- Table `tmap`
-- ---------------------------------------------------------------------
-ALTER TABLE tmap MODIFY `id_user` varchar(128);
-
--- ---------------------------------------------------------------------
--- Table `titem`
--- ---------------------------------------------------------------------
-ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
+ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT '';
-- ---------------------------------------------------------------------
-- Table `tconfig`
@@ -1235,14 +1291,39 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 28);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 32);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '735');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '739');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
+UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
+DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
+DELETE FROM `tconfig` WHERE `token` LIKE 'integria_inventory';
+DELETE FROM `tconfig` WHERE `token` LIKE 'integria_url';
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_user', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_pass', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_hostname', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_api_pass', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_req_timeout', 5);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_group', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_criticity', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_creator', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('default_owner', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_type', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_status', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_title', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('incident_content', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_group', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_criticity', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_creator', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_default_owner', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_type', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_status', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_title', '');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('cr_incident_content', '');
-- ---------------------------------------------------------------------
-- Table `tconfig_os`
@@ -1278,6 +1359,8 @@ ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN id_source_event int(10);
+ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL;
+
-- ---------------------------------------------------------------------
-- Table `tusuario`
-- ---------------------------------------------------------------------
@@ -1292,7 +1375,11 @@ ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL de
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_user` VARCHAR(60);
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_pass` VARCHAR(45);
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_enabled` TINYINT(1);
-
+ALTER TABLE `tusuario` MODIFY COLUMN `default_event_filter` int(10) unsigned NOT NULL DEFAULT '0',
+ ADD INDEX `fk_filter_id` (`id_filter`),
+ ADD CONSTRAINT `fk_filter_id` FOREIGN KEY `fk_filter_id` (`id_filter`) REFERENCES `tevent_filter` (`id_filter`) ON DELETE SET NULL ON UPDATE RESTRICT,
+ DROP FOREIGN KEY `fk_id_filter`,
+ DROP INDEX `fk_id_filter`;
-- ---------------------------------------------------------------------
@@ -1303,14 +1390,23 @@ ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned d
ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0;
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0';
-ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0';
-ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0';
+ALTER TABLE `tagente_modulo` DROP COLUMN `ff_normal`,
+ DROP COLUMN `ff_warning`,
+ DROP COLUMN `ff_critical`,
+ MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0',
+ MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `tagente_datos`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_datos MODIFY `datos` double(22,5);
+ALTER TABLE `tagente_datos` DROP INDEX `data_index1`, ADD INDEX `data_index1` (`id_agente_modulo`, `utimestamp`);
+
+-- ---------------------------------------------------------------------
+-- Table `tagente_datos_string`
+-- ---------------------------------------------------------------------
+ALTER TABLE `tagente_datos_string` MODIFY COLUMN `datos` mediumtext NOT NULL, DROP INDEX `data_string_index_1`, ADD INDEX `data_string_index_1` (`id_agente_modulo`, `utimestamp`);
-- ---------------------------------------------------------------------
-- Table `tagente_datos_inc`
@@ -1326,6 +1422,7 @@ 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';
ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
+ALTER TABLE `tnetwork_component` MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `tagente`
@@ -1340,6 +1437,12 @@ ALTER TABLE `tagente` ADD COLUMN `cps` int NOT NULL default 0;
UPDATE tagente SET tagente.alias = tagente.nombre;
+ALTER TABLE `tagente` MODIFY COLUMN `remote` tinyint(1) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `cascade_protection_module` int(10) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `update_secondary_groups` tinyint(1) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `alias` varchar(600) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0';
+
-- ---------------------------------------------------------------------
-- Table `tservice`
-- ---------------------------------------------------------------------
@@ -1359,6 +1462,8 @@ ALTER TABLE tlayout MODIFY `name` varchar(600) NOT NULL;
UPDATE tlayout SET is_favourite = 1 WHERE name REGEXP '^(' OR name REGEXP '^\\[';
+ALTER TABLE `tlayout` MODIFY COLUMN `is_favourite` int(10) unsigned NOT NULL DEFAULT '0';
+
-- ---------------------------------------------------------------------
-- Table `tlayout_data`
-- ---------------------------------------------------------------------
@@ -1377,6 +1482,13 @@ ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_warning`
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_node_id` INT(10) NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
+ALTER TABLE `tlayout_data` MODIFY COLUMN `type_graph` varchar(50) NOT NULL DEFAULT 'area',
+ MODIFY COLUMN `label_position` varchar(50) NOT NULL DEFAULT 'down',
+ MODIFY COLUMN `linked_layout_node_id` int(10) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `linked_layout_status_type` enum('default','weight','service') NULL DEFAULT 'default',
+ MODIFY COLUMN `element_group` int(10) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `linked_layout_status_as_service_warning` float(20,3) NOT NULL DEFAULT '0.000',
+ MODIFY COLUMN `linked_layout_status_as_service_critical` float(20,3) NOT NULL DEFAULT '0.000';
-- ---------------------------------------------------------------------
-- Table `tagent_custom_fields`
@@ -1398,6 +1510,7 @@ ALTER TABLE tgraph ADD COLUMN `summatory_series` tinyint(1) UNSIGNED NOT NULL de
ALTER TABLE tgraph ADD COLUMN `average_series` tinyint(1) UNSIGNED NOT NULL default '0';
ALTER TABLE tgraph ADD COLUMN `modules_series` tinyint(1) UNSIGNED NOT NULL default '0';
ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '0';
+ALTER TABLE `tgraph` MODIFY COLUMN `percentil` tinyint(1) unsigned NOT NULL DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
@@ -1439,11 +1552,23 @@ ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1'
ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
+ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
+ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
+ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
+ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300',
+ MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ MODIFY COLUMN `failover_mode` tinyint(1) NULL DEFAULT '1',
+ MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1';
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
-- ---------------------------------------------------------------------
ALTER TABLE tmodule_relationship ADD COLUMN `id_server` varchar(100) NOT NULL DEFAULT '';
+ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
+ALTER TABLE `tmodule_relationship` MODIFY COLUMN `id_server` varchar(100) NOT NULL DEFAULT '';
-- ---------------------------------------------------------------------
-- Table `tpolicy_module`
@@ -1474,6 +1599,14 @@ ALTER TABLE trecon_task ADD `wmi_enabled` tinyint(1) unsigned DEFAULT '0';
ALTER TABLE trecon_task ADD `auth_strings` text;
ALTER TABLE trecon_task ADD `autoconfiguration_enabled` tinyint(1) unsigned default '0';
ALTER TABLE trecon_task ADD `summary` text;
+ALTER TABLE `trecon_task` ADD COLUMN `type` int(11) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `snmp_enabled` tinyint(1) unsigned NULL DEFAULT '0',
+ MODIFY COLUMN `vlan_enabled` tinyint(1) unsigned NULL DEFAULT '0',
+ MODIFY COLUMN `wmi_enabled` tinyint(1) unsigned NULL DEFAULT '0',
+ MODIFY COLUMN `auth_strings` text NULL,
+ MODIFY COLUMN `autoconfiguration_enabled` tinyint(1) unsigned NULL DEFAULT '0',
+ MODIFY COLUMN `summary` text NULL;
-- ---------------------------------------------------------------------
-- Table `twidget` AND Table `twidget_dashboard`
@@ -1586,12 +1719,14 @@ ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default ''
ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default 0;
ALTER TABLE tgraph_source ADD COLUMN `field_order` int(10) NOT NULL default 0;
+ALTER TABLE `tgraph_source` MODIFY COLUMN `id_server` int(11) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `field_order` int(10) NULL DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `tserver_export_data`
-- ---------------------------------------------------------------------
-ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) BINARY NOT NULL default '';
+ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) NOT NULL default '';
-- ---------------------------------------------------------------------
-- Table `tserver`
@@ -1613,7 +1748,12 @@ INSERT INTO tmodule VALUES (8, 'Wux module');
-- Table `ttipo_modulo`
-- ---------------------------------------------------------------------
-INSERT INTO ttipo_modulo VALUES (25,'web_analysis', 8, 'Web analysis data', 'module-wux.png');
+INSERT INTO `ttipo_modulo` VALUES
+(25,'web_analysis', 8, 'Web analysis data', 'module-wux.png'),
+(34,'remote_cmd', 10, 'Remote execution, numeric data', 'mod_remote_cmd.png'),
+(35,'remote_cmd_proc', 10, 'Remote execution, boolean data', 'mod_remote_cmd_proc.png'),
+(36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'),
+(37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png');
-- ---------------------------------------------------------------------
-- Table `tdashboard`
@@ -1866,10 +2006,16 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
`linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0,
`linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0,
`linked_layout_node_id` INT(10) NOT NULL default 0,
+ `cache_expiration` INTEGER UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id`),
FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
+ALTER TABLE `tlayout_template_data` MODIFY COLUMN `linked_layout_node_id` int(10) NOT NULL DEFAULT '0',
+ MODIFY COLUMN `linked_layout_status_type` enum('default','weight','service') NULL DEFAULT 'default',
+ MODIFY COLUMN `linked_layout_status_as_service_warning` float(20,3) NOT NULL DEFAULT '0.000',
+ MODIFY COLUMN `linked_layout_status_as_service_critical` float(20,3) NOT NULL DEFAULT '0.000';
+
-- ---------------------------------------------------------------------
-- Table `tlog_graph_models`
-- ---------------------------------------------------------------------
@@ -1915,6 +2061,7 @@ INSERT INTO tlog_graph_models VALUES (7, 'Users login',
ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `treport` ADD COLUMN `orientation` varchar(25) NOT NULL default 'vertical';
+ALTER TABLE `treport` MODIFY COLUMN `hidden` tinyint(1) NULL DEFAULT '0' AFTER `non_interactive`;
ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1';
ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default '';
@@ -2051,7 +2198,8 @@ ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0';
ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL;
ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT '';
ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-
+ALTER TABLE `tmensajes` DROP COLUMN `id_usuario_destino`,
+ ADD UNIQUE INDEX `id_mensaje` (`id_mensaje`);
-- ----------------------------------------------------------------------
-- Table `tnotification_user`
@@ -2153,7 +2301,7 @@ ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT
-- Add column in table `tnetflow_filter`
-- ----------------------------------------------------------------------
ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
-
+ALTER TABLE `tnetflow_filter` MODIFY COLUMN `router_ip` text NOT NULL;
-- ----------------------------------------------------------------------
-- Update table `tuser_task`
@@ -2172,6 +2320,17 @@ INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
+ALTER TABLE `talert_templates` MODIFY COLUMN `field11` text NOT NULL,
+ MODIFY COLUMN `field12` text NOT NULL,
+ MODIFY COLUMN `field13` text NOT NULL,
+ MODIFY COLUMN `field14` text NOT NULL,
+ MODIFY COLUMN `field15` text NOT NULL,
+ MODIFY COLUMN `field11_recovery` text NOT NULL,
+ MODIFY COLUMN `field12_recovery` text NOT NULL,
+ MODIFY COLUMN `field13_recovery` text NOT NULL,
+ MODIFY COLUMN `field14_recovery` text NOT NULL,
+ MODIFY COLUMN `field15_recovery` text NOT NULL;
+
-- ---------------------------------------------------------------------
-- Table `tvisual_console_items_cache`
-- ---------------------------------------------------------------------
@@ -2193,3 +2352,82 @@ CREATE TABLE `tvisual_console_elements_cache` (
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8;
+-- ---------------------------------------------------------------------
+-- Table `tcredential_store`
+-- ---------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS `tcredential_store` (
+ `identifier` varchar(100) NOT NULL,
+ `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
+ `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM',
+ `username` text,
+ `password` text,
+ `extra_1` text,
+ `extra_2` text,
+ PRIMARY KEY (`identifier`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `treport_content_sla_combined`
+-- ---------------------------------------------------------------------
+ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
+
+-- ---------------------------------------------------------------------
+-- Table `tagent_repository`
+-- ---------------------------------------------------------------------
+CREATE TABLE `tagent_repository` (
+ `id` SERIAL,
+ `id_os` INT(10) UNSIGNED DEFAULT 0,
+ `arch` ENUM('x64', 'x86') DEFAULT 'x64',
+ `version` VARCHAR(10) DEFAULT '',
+ `path` text,
+ `uploaded_by` VARCHAR(100) DEFAULT '',
+ `uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded",
+ `last_err` text,
+ PRIMARY KEY (`id`),
+ FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
+ ON UPDATE CASCADE ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ----------------------------------------------------------------------
+-- Table `tdeployment_hosts`
+-- ----------------------------------------------------------------------
+CREATE TABLE `tdeployment_hosts` (
+ `id` SERIAL,
+ `id_cs` VARCHAR(100),
+ `ip` VARCHAR(100) NOT NULL UNIQUE,
+ `id_os` INT(10) UNSIGNED DEFAULT 0,
+ `os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format",
+ `arch` ENUM('x64', 'x86') DEFAULT 'x64',
+ `current_agent_version` VARCHAR(100) DEFAULT '' COMMENT "String latest installed agent",
+ `target_agent_version_id` BIGINT UNSIGNED,
+ `deployed` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was deployed",
+ `server_ip` varchar(100) default NULL COMMENT "Where to point target agent",
+ `last_err` text,
+ PRIMARY KEY (`id`),
+ FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store`(`identifier`)
+ ON UPDATE CASCADE ON DELETE SET NULL,
+ FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`)
+ ON UPDATE CASCADE ON DELETE CASCADE,
+ FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`)
+ ON UPDATE CASCADE ON DELETE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `trecon_script`
+-- ---------------------------------------------------------------------
+ALTER TABLE `trecon_script` ADD COLUMN `type` int(11) NOT NULL DEFAULT '0';
+
+-- ---------------------------------------------------------------------
+-- Table `tusuario_perfil`
+-- ---------------------------------------------------------------------
+ALTER TABLE `tusuario_perfil` MODIFY COLUMN `no_hierarchy` tinyint(1) NOT NULL DEFAULT '0';
+
+
+-- Extra tnetwork_component
+INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | find /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
+INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace[0] * 100 /$obj.Size[0]','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
+INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux uptime','System uptime',43,36,0,0,300,0,'uptime |sed s/us\.*$//g | sed s/,\.*$//g','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
+INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux processes','Running processes',43,34,0,0,300,0,'ps elf | wc -l','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
+INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux system load','Current load (5 min)',43,34,0,0,300,0,'uptime | awk '{print $(NF-1)}' | tr -d ','','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
+INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available memory percent','Available memory %',43,34,0,0,300,0,'free | grep Mem | awk '{print $NF/$2 * 100}'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
+INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
diff --git a/pandora_console/general/alert_enterprise.php b/pandora_console/general/alert_enterprise.php
index 69a09d2998..4cb4a29740 100644
--- a/pandora_console/general/alert_enterprise.php
+++ b/pandora_console/general/alert_enterprise.php
@@ -105,7 +105,7 @@ if (check_login()) {
echo __(
"This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.
- Download the official documentation",
+ Download the official documentation",
get_product_name(),
get_product_name(),
get_product_name(),
diff --git a/pandora_console/general/firts_task/HA_cluster_builder.php b/pandora_console/general/firts_task/HA_cluster_builder.php
index fa85e28381..6d82d94ad0 100644
--- a/pandora_console/general/firts_task/HA_cluster_builder.php
+++ b/pandora_console/general/firts_task/HA_cluster_builder.php
@@ -1,15 +1,25 @@
- true, 'message' => __('There are no HA clusters defined yet.') ]);
?>
@@ -44,8 +52,9 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus
";
+ echo "";
?>
true, 'message' => __('There are no HA clus
?>
-
diff --git a/pandora_console/general/firts_task/planned_downtime.php b/pandora_console/general/firts_task/planned_downtime.php
index dcd98fdebb..21bfb4b083 100644
--- a/pandora_console/general/firts_task/planned_downtime.php
+++ b/pandora_console/general/firts_task/planned_downtime.php
@@ -33,7 +33,7 @@ ui_require_css_file('firts_task');
);
?>
-
diff --git a/pandora_console/general/firts_task/recon_view.php b/pandora_console/general/firts_task/recon_view.php
index 282a6b75be..8c59b23f64 100755
--- a/pandora_console/general/firts_task/recon_view.php
+++ b/pandora_console/general/firts_task/recon_view.php
@@ -35,6 +35,7 @@ ui_require_css_file('firts_task');
diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php
index a093596b2b..368accd39b 100644
--- a/pandora_console/general/header.php
+++ b/pandora_console/general/header.php
@@ -328,22 +328,40 @@ if ($config['menu_type'] == 'classic') {
$header_autorefresh_counter .= $autorefresh_additional;
$header_autorefresh_counter .= '';
+ // Button for feedback pandora.
+ if (enterprise_installed()) {
+ $header_feedback = '
+ ';
+ echo __('Please make sure you have SAML authentication properly configured. For more information the error to access this page are recorded in security logs of %s System Database', get_product_name());
+ ?>
+
+
+
+
+ OK
+
+
+
+
+
+
+
+
+
+
diff --git a/pandora_console/general/register.php b/pandora_console/general/register.php
index e6a26bb250..e7097b994e 100644
--- a/pandora_console/general/register.php
+++ b/pandora_console/general/register.php
@@ -30,6 +30,7 @@
global $config;
require_once $config['homedir'].'/include/functions_update_manager.php';
+require_once $config['homedir'].'/include/class/WelcomeWindow.class.php';
if (is_ajax()) {
@@ -123,6 +124,7 @@ if (is_ajax()) {
}
+
ui_require_css_file('register');
$initial = isset($config['initial_wizard']) !== true
@@ -150,25 +152,36 @@ if ($initial && users_is_admin()) {
);
}
-if ($registration && users_is_admin()) {
- // Prepare registration wizard, not launch. leave control to flow.
- registration_wiz_modal(
- false,
- // Launch only if not being launch from 'initial'.
- !$initial,
- (($show_newsletter === true) ? 'force_run_newsletter()' : null)
- );
-} else {
- if ($show_newsletter) {
- // Show newsletter wizard for current user.
- newsletter_wiz_modal(
+if (!$config['disabled_newsletter']) {
+ if ($registration && users_is_admin()) {
+ // Prepare registration wizard, not launch. leave control to flow.
+ registration_wiz_modal(
false,
- // Launch only if not being call from 'registration'.
- !$registration && !$initial
+ // Launch only if not being launch from 'initial'.
+ !$initial,
+ (($show_newsletter === true) ? 'force_run_newsletter()' : null)
);
+ } else {
+ if ($show_newsletter) {
+ // Show newsletter wizard for current user.
+ newsletter_wiz_modal(
+ false,
+ // Launch only if not being call from 'registration'.
+ !$registration && !$initial
+ );
+ }
}
}
+$welcome = !$registration && !$show_newsletter && !$initial;
+try {
+ $welcome_window = new WelcomeWindow($welcome);
+ if ($welcome_window !== null) {
+ $welcome_window->run();
+ }
+} catch (Exception $e) {
+ $welcome = false;
+}
$newsletter = null;
diff --git a/pandora_console/general/subselect_data_module.php b/pandora_console/general/subselect_data_module.php
index 416897ea15..fca56c692c 100644
--- a/pandora_console/general/subselect_data_module.php
+++ b/pandora_console/general/subselect_data_module.php
@@ -13,7 +13,8 @@ switch ($_GET['module']) {
$sql = sprintf(
'SELECT id_tipo, descripcion
FROM ttipo_modulo
- WHERE categoria between 3 and 5 '
+ WHERE categoria between 3 and 5
+ OR categoria = 10 '
);
break;
diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php
index 7c6a3ab03b..2516e0c5f8 100644
--- a/pandora_console/godmode/agentes/agent_manager.php
+++ b/pandora_console/godmode/agentes/agent_manager.php
@@ -77,6 +77,7 @@ if (is_ajax()) {
}
$get_modules_json_for_multiple_snmp = (bool) get_parameter('get_modules_json_for_multiple_snmp', 0);
+ $get_common_modules = (bool) get_parameter('get_common_modules', 1);
if ($get_modules_json_for_multiple_snmp) {
include_once 'include/graphs/functions_utils.php';
@@ -100,7 +101,16 @@ if (is_ajax()) {
if ($out === false) {
$out = $oid_snmp;
} else {
- $out = array_intersect($out, $oid_snmp);
+ $commons = array_intersect($out, $oid_snmp);
+ if ($get_common_modules) {
+ // Common modules is selected (default)
+ $out = $commons;
+ } else {
+ // All modules is selected
+ $array1 = array_diff($out, $oid_snmp);
+ $array2 = array_diff($oid_snmp, $out);
+ $out = array_merge($commons, $array1, $array2);
+ }
}
$oid_snmp = [];
@@ -201,7 +211,7 @@ if (!$new_agent && $alias != '') {
$table_agent_name .= '