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/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 30fb45624c..fbea6eb404 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.736, AIX version +# Version 7.0NG.738, 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 fc704fb87b..ded3ec4b9c 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.736, FreeBSD Version +# Version 7.0NG.738, 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 46789e8bea..0d3e20d05e 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.736, HP-UX Version +# Version 7.0NG.738, 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 ce69b462a5..5d951d984d 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.736, GNU/Linux +# Version 7.0NG.738, 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 904015a997..1c73d12fc9 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.736, GNU/Linux +# Version 7.0NG.738, 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 d2d0661065..fc59e308e4 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.736, Solaris Version +# Version 7.0NG.738, 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 d0593ebcc9..f12cb5089c 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.736 +# Version 7.0NG.738 # 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 74c397dc94..863ab92907 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.736, AIX version +# Version 7.0NG.738, 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 b7a30f962e..f56402fbcc 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.736 +# Version 7.0NG.738 # 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 9114cd7348..55576e58fd 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.736, HPUX Version +# Version 7.0NG.738, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index 8eb9c0bbc8..a584a597cb 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.736 +# Version 7.0NG.738 # 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 24d44d51fc..18db7a174f 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.736 +# Version 7.0NG.738 # 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 a940b58a89..d3266f091d 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.736 +# Version 7.0NG.738 # 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 13611f36c0..aa59a262c4 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.736, Solaris version +# Version 7.0NG.738, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 6a826afd8b..dedf2c366f 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.736, AIX version +# Version 7.0NG.738, 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 b6ecacb2b4..1a4e8a2121 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.736-190712 +Version: 7.0NG.738-190916 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 c7f4f3334e..5ebc768ca9 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.736-190712" +pandora_version="7.0NG.738-190916" 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 35a24de477..4624a5ceff 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.736, GNU/Linux +# Version 7.0NG.738, 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 fba8f9fa24..0895974d7b 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.736, FreeBSD Version +# Version 7.0NG.738, 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 36164100be..bfd0612672 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.736, HP-UX Version +# Version 7.0NG.738, 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 6012f59705..e1a83ed6e5 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.736, GNU/Linux +# Version 7.0NG.738, 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 300c03a3f5..b0841bd0f7 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.736, GNU/Linux +# Version 7.0NG.738, 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 e899eed824..4d96ba223d 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.736, NetBSD Version +# Version 7.0NG.738, 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 be7904794d..c4a4c578d9 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.736, Solaris Version +# Version 7.0NG.738, 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 1298d9c2f9..42a6fb38d8 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.736'; -use constant AGENT_BUILD => '190712'; +use constant AGENT_VERSION => '7.0NG.738'; +use constant AGENT_BUILD => '190916'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 5fdc516b68..8cf4666656 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.736 -%define release 190712 +%define version 7.0NG.738 +%define release 190916 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 891b2769f1..6af72cc966 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.736 -%define release 190712 +%define version 7.0NG.738 +%define release 190916 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 01d573fb70..e51d9cb3d1 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.736" -PI_BUILD="190712" +PI_VERSION="7.0NG.738" +PI_BUILD="190916" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 9c2fe6d01d..c74dadfff6 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.736 +# Version 7.0NG.738 # 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 d20217c6a0..e01ce765e0 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.736} +{Pandora FMS Windows Agent v7.0NG.738} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190712} +{190916} ViewReadme {Yes} 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 51c386db55..88a69124af 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.736(Build 190712)") +#define PANDORA_VERSION ("7.0NG.738(Build 190916)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index feb8e814e1..f67a031fae 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.736(Build 190712))" + VALUE "ProductVersion", "(7.0NG.738(Build 190916))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 901b426196..c6757cd683 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.736-190712 +Version: 7.0NG.738-190916 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 98935e7bf9..8bd5474f4e 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/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.736-190712" +pandora_version="7.0NG.738-190916" package_pear=0 package_pandora=1 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/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt new file mode 100644 index 0000000000..c0d8f0a9db --- /dev/null +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -0,0 +1 @@ +operation/servers/recon_view.php \ No newline at end of file diff --git a/pandora_console/extras/mr/30.sql b/pandora_console/extras/mr/30.sql index eeb3b8d797..84e5adfa3e 100644 --- a/pandora_console/extras/mr/30.sql +++ b/pandora_console/extras/mr/30.sql @@ -10,4 +10,42 @@ ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEF ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct'; -COMMIT; \ No newline at end of file +ALTER TABLE `treport_content` MODIFY COLUMN `name` varchar(300) NULL; + +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; + +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; + + +COMMIT; diff --git a/pandora_console/extras/mr/31.sql b/pandora_console/extras/mr/31.sql new file mode 100644 index 0000000000..3e527bff53 --- /dev/null +++ b/pandora_console/extras/mr/31.sql @@ -0,0 +1,12 @@ +START TRANSACTION; + +UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; + +DELETE FROM `talert_commands` WHERE `id` = 11; + +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_enabled'; +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'; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/mr/32.sql b/pandora_console/extras/mr/32.sql new file mode 100644 index 0000000000..3100d73092 --- /dev/null +++ b/pandora_console/extras/mr/32.sql @@ -0,0 +1,7 @@ +START TRANSACTION; + +UPDATE `tlayout_data` SET `height` = 70 , `width` = 70 WHERE `height` = 0 && `width` = 0 && image NOT LIKE '%dot%' && ((`type` IN (0,5)) || +(`type` = 10 && `image` IS NOT NULL && `image` != '' && `image` != 'none') || +(`type` = 11 && `image` IS NOT NULL && `image` != '' && `image` != 'none' && `show_statistics` = 0)); + +COMMIT; \ No newline at end of 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 60e19998e8..704ab61d74 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 @@ -724,7 +724,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, @@ -1225,6 +1225,8 @@ 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; + -- --------------------------------------------------------------------- -- Table `tmap` -- --------------------------------------------------------------------- @@ -1241,7 +1243,7 @@ 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', 30); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 31); 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'); @@ -1249,6 +1251,11 @@ UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.ph DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '737'); 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_enabled'; +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'; -- --------------------------------------------------------------------- -- Table `tconfig_os` @@ -1446,6 +1453,7 @@ 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; -- --------------------------------------------------------------------- -- Table `tmodule_relationship` @@ -2219,3 +2227,44 @@ CREATE TABLE IF NOT EXISTS `tcredential_store` ( -- 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; diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index a093596b2b..99bb38cc21 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -670,21 +670,49 @@ if ($config['menu_type'] == 'classic') { + + var autorefresh_draw = ''; $("#header_autorefresh").css('padding-right', '5px'); - var refr_time = ; - var t = new Date(); - t.setTime (t.getTime () + parseInt()); - $("#refrcounter").countdown ({ - until: t, - layout: '%M%nn%M:%S%nn%S', - labels: ['', '', '', '', '', '', ''], - onExpiry: function () { + if(autorefresh_draw == true) { + var refresh_interval = parseInt(''); + var until_time=''; + + function events_refresh() { + until_time = new Date(); + until_time.setTime (until_time.getTime () + parseInt()); + + $("#refrcounter").countdown ({ + until: until_time, + layout: '%M%nn%M:%S%nn%S', + labels: ['', '', '', '', '', '', ''], + onExpiry: function () { + dt_events.draw(false); + } + }); + } + // Start the countdown when page is loaded (first time). + events_refresh(); + // Repeat countdown according to refresh_interval. + setInterval(events_refresh, refresh_interval); + } else { + var refr_time = ; + var t = new Date(); + t.setTime (t.getTime () + parseInt()); + $("#refrcounter").countdown ({ + until: t, + layout: '%M%nn%M:%S%nn%S', + labels: ['', '', '', '', '', '', ''], + onExpiry: function () { href = $("a.autorefresh").attr ("href"); href = href + refr_time; $(document).attr ("location", href); } }); + } @@ -694,8 +722,38 @@ if ($config['menu_type'] == 'classic') { $("#combo_refr").toggle (); $("select#ref").change (function () { href = $("a.autorefresh").attr ("href"); - $(document).attr ("location", href + this.value); - }); + + if(autorefresh_draw == true){ + inputs = $("#events_form :input"); + values = {}; + inputs.each(function() { + values[this.name] = $(this).val(); + }) + + var newValue = btoa(JSON.stringify(values)); + + var fb64 = ''; + // Check if the filters have changed. + if(fb64 !== newValue){ + href = href.replace(fb64, newValue); + } + + $(document).attr("location", href+ '&refr=' + this.value); + + $(document).attr("location", href+'&fb64=' + newValue + '&refr=' + this.value); + + } else { + $(document).attr ("location", href + this.value); + } + }); return false; }); diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 4fbdf93140..5aecfcc92c 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -376,6 +376,9 @@ if (isset($correct_reset_pass_process)) { } if (isset($login_failed)) { + $nick = get_parameter_post('nick'); + $fails = db_get_value('failed_attempt', 'tusuario', 'id_user', $nick); + $attemps = ($config['number_attempts'] - $fails); echo '
'; echo '
'; echo '
'; @@ -386,6 +389,12 @@ if (isset($login_failed)) { echo '

'.__('ERROR').'

'; echo '

'.$config['auth_error'].'

'; echo '
'; + if ($config['enable_pass_policy']) { + echo '
'; + echo '

Remaining attempts: '.$attemps.'

'; + echo '
'; + } + echo '
'; html_print_submit_button('Ok', 'hide-login-error', false); echo '
'; @@ -680,5 +689,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', ' $("#final_process_correct").dialog('close'); }); }); + /* ]]> */ diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index a02f6c11ac..cdbc09c9f9 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -172,6 +172,7 @@ unset($table); echo '