diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 758ee6811a..622cc7270c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.730-190116 +Version: 7.0NG.730-190117 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 4e5706c7cf..a72de2c8c4 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.730-190116" +pandora_version="7.0NG.730-190117" 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/pandora_agent b/pandora_agents/unix/pandora_agent index 9646cee020..f6989c43ca 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.730'; -use constant AGENT_BUILD => '190116'; +use constant AGENT_BUILD => '190117'; # 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 bd1b569af4..c2a9a68636 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.730 -%define release 190116 +%define release 190117 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 1156c6297a..4a83112001 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.730 -%define release 190116 +%define release 190117 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 b4c3b66bab..85826b4ba3 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190116" +PI_BUILD="190117" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3c639031de..3139d0cccd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190116} +{190117} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 87cec0dbac..c12964790f 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.730(Build 190116)") +#define PANDORA_VERSION ("7.0NG.730(Build 190117)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 91df373d23..537951418e 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.730(Build 190116))" + VALUE "ProductVersion", "(7.0NG.730(Build 190117))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d7e1669bf6..bab938db18 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.730-190116 +Version: 7.0NG.730-190117 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 af3a24ea27..305f752fbe 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.730-190116" +pandora_version="7.0NG.730-190117" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 280aba46a5..f805ec33d8 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190116'; +$build_version = 'PC190117'; $pandora_version = 'v7.0NG.730'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index f2056f058e..e8130b6e4d 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3435,4 +3435,60 @@ function pandora_xhprof_display_result($key = "", $method = "link") { } } + +/** + * From a network with a mask remove the smallest ip and the highest + * + * @param string address to identify the network. + * @param string mask to identify the mask network + * @return array or false with smallest ip and highest ip + */ +function range_ips_for_network($address, $mask) { + if(!isset($address) || !isset($mask)){ + return false; + } + + //convert ip addresses to long form + $address_long = ip2long($address); + $mask_long = ip2long($mask); + + //caculate first usable address + $ip_host_first = ((~$mask_long) & $address_long); + $ip_first = ($address_long ^ $ip_host_first) + 1; + + //caculate last usable address + $ip_broadcast_invert = ~$mask_long; + $ip_last = ($address_long | $ip_broadcast_invert) - 1; + + $range = array( + 'first' => long2ip($ip_first), + 'last' => long2ip($ip_last) + ); + + return $range; +} + +/** + * from two ips find out if there is such an ip + * + * @param string ip ip wont validate + * @param string ip_lower + * @param string ip_upper + * @return bool true or false if the ip is between the two ips + */ +function is_in_network ($ip, $ip_lower, $ip_upper) { + if(!isset($ip) || !isset($ip_lower) || !isset($ip_upper)){ + return false; + } + + $ip = (float)sprintf("%u",ip2long($ip)); + $ip_lower = (float)sprintf("%u",ip2long($ip_lower)); + $ip_upper = (float)sprintf("%u",ip2long($ip_upper)); + + if ($ip >= $ip_lower && $ip <= $ip_upper){ + return true; + } else { + return false; + } +} ?> diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index 29728984e1..f33a3b5e68 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -1332,7 +1332,7 @@ function print_phases_donut (recipient, phases) { var svg = d3.select(recipient) .append("svg") .attr("width", 800) - .attr("height", 400) + .attr("height", 500) .append("g"); svg.append("g") @@ -1361,7 +1361,7 @@ function print_phases_donut (recipient, phases) { .outerRadius(radius * 0.9); width = 800; - height = 400; + height = 500; svg.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); var key = function(d){ return d.data.label; }; @@ -1440,6 +1440,8 @@ function print_phases_donut (recipient, phases) { return d.startAngle + (d.endAngle - d.startAngle)/2; } + var ex = 1; + var sum = 0; text.transition().duration(0) .attrTween("transform", function(d) { this._current = this._current || d; @@ -1447,8 +1449,26 @@ function print_phases_donut (recipient, phases) { this._current = interpolate(0); return function(t) { var d2 = interpolate(t); - var pos = outerArc.centroid(d2); - pos[0] = radius * (midAngle(d2) < Math.PI ? 1 : -1); + + //fix for labels of a very small portion increase the + //height of the label so that they do not overlap + if( ( d2.endAngle - d2.startAngle ) < 0.1){ + var pos = outerArc.centroid(d2); + if (ex%2==0){ + pos[0] = 150; + } + else{ + pos[0] = -150; + sum++; + } + pos[1] = pos[1] - (35*sum); + ex++; + } + else{ + var pos = outerArc.centroid(d2); + pos[0] = radius * (midAngle(d2) < Math.PI ? 1 : -1); + } + return "translate("+ pos +")"; }; }) @@ -1458,6 +1478,17 @@ function print_phases_donut (recipient, phases) { this._current = interpolate(0); return function(t) { var d2 = interpolate(t); + + //fix for labels of a very small portion increase the + //height of the label so that they do not overlap + if( ( d2.endAngle - d2.startAngle ) < 0.1){ + if (ex%2==0){ + return "start"; + } + else{ + return "end"; + } + } return midAngle(d2) < Math.PI ? "start":"end"; }; }); @@ -1468,10 +1499,12 @@ function print_phases_donut (recipient, phases) { /* ------- SLICE TO TEXT POLYLINES -------*/ var polyline = svg.select(".lines").selectAll("polyline") .data(pie(data), key); - + polyline.enter() .append("polyline"); + var ex2 = 1; + var sum2 = 0; polyline.transition().duration(0) .attrTween("points", function(d){ this._current = this._current || d; @@ -1479,16 +1512,33 @@ function print_phases_donut (recipient, phases) { this._current = interpolate(0); return function(t) { var d2 = interpolate(t); - var pos = outerArc.centroid(d2); - pos[0] = radius * 0.95 * (midAngle(d2) < Math.PI ? 1 : -1); + + //fix for labels of a very small portion increase the + //height of the label so that they do not overlap + if( ( d2.endAngle - d2.startAngle ) < 0.1){ + var pos = outerArc.centroid(d2); + if (ex2%2==0){ + pos[0] = 150 * 0.95; + } + else{ + pos[0] = -150 * 0.95; + sum2++; + } + pos[1] = pos[1] - (30*sum2); + ex2++; + } + else{ + var pos = outerArc.centroid(d2); + pos[0] = radius * 0.95 * (midAngle(d2) < Math.PI ? 1 : -1); + } return [arc.centroid(d2), outerArc.centroid(d2), pos]; - }; + }; }) .style("stroke", "black") .style("opacity", ".3") .style("stroke-width", "2px") .style("fill", "none"); - + polyline.exit() .remove(); } @@ -2331,4 +2381,4 @@ var digitPattern = [ setTimeout(tick, 1000 - now % 1000); })(); -} \ No newline at end of file +} diff --git a/pandora_console/install.php b/pandora_console/install.php index a82dfc4ca6..f3e5073da0 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -116,7 +116,7 @@