Добавление ebuild из старого оверлея
This commit is contained in:
12
net-analyzer/zabbix-server/files/zabbix-jmx-proxy.conf
Normal file
12
net-analyzer/zabbix-server/files/zabbix-jmx-proxy.conf
Normal file
@@ -0,0 +1,12 @@
|
||||
# Configuration variables for the zabbix jmx proxy
|
||||
|
||||
|
||||
# LISTEN_IP="0.0.0.0"
|
||||
# LISTEN_PORT=10052
|
||||
# START_POLLERS=5
|
||||
# TIMEOUT=3
|
||||
|
||||
# uncomment to enable remote monitoring of the standard JMX objects on the Zabbix Java Gateway itself
|
||||
# JAVA_OPTIONS="$JAVA_OPTIONS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345
|
||||
# -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
|
||||
|
||||
33
net-analyzer/zabbix-server/files/zabbix-jmx-proxy.init
Normal file
33
net-analyzer/zabbix-server/files/zabbix-jmx-proxy.init
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
LISTEN_IP=${LISTEN_IP:-127.0.0.1}
|
||||
LISTEN_PORT=${LISTEN_PORT:-10052}
|
||||
START_POLLERS=${START_POLLERS:-5}
|
||||
TIMEOUT=${TIMEOUT:-3}
|
||||
|
||||
PID_FILE="/run/zabbix-jmx-proxy"
|
||||
|
||||
|
||||
start() {
|
||||
ZABBIX_OPTIONS="-Dzabbix.pidFile=$PID_FILE \
|
||||
-Dzabbix.listenIP=$LISTEN_IP \
|
||||
-Dzabbix.listenPort=$LISTEN_PORT \
|
||||
-Dzabbix.startPollers=$START_POLLERS \
|
||||
-Dzabbix.timeout=$TIMEOUT \
|
||||
-Dsun.rmi.transport.tcp.responseTimeout=${TIMEOUT}000"
|
||||
|
||||
JAVA_OPTIONS="-server $JAVA_OPTIONS -Dlogback.configurationFile=logback-console.xml"
|
||||
|
||||
cd /opt/zabbix_java
|
||||
|
||||
CLASSPATH="lib"
|
||||
for jar in lib/*.jar bin/*.jar; do
|
||||
CLASSPATH="$CLASSPATH:$jar"
|
||||
done
|
||||
|
||||
start-stop-daemon -m --background --pidfile $PID_FILE -- java $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway
|
||||
}
|
||||
|
||||
stop() {
|
||||
start-stop-daemon --stop --pidfile $PID_FILE
|
||||
}
|
||||
20
net-analyzer/zabbix-server/files/zabbix-proxy.init
Normal file
20
net-analyzer/zabbix-server/files/zabbix-proxy.init
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/sbin/zabbix_proxy"
|
||||
command_args="--foreground --config /etc/zabbix/zabbix_proxy.conf"
|
||||
command_background="true"
|
||||
command_user="zabbix:zabbix"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
provide zabbix-proxy
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
|
||||
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
|
||||
}
|
||||
|
||||
1
net-analyzer/zabbix-server/files/zabbix-proxy.tmpfiles
Normal file
1
net-analyzer/zabbix-server/files/zabbix-proxy.tmpfiles
Normal file
@@ -0,0 +1 @@
|
||||
d /run/zabbix 0755 zabbix zabbix -
|
||||
@@ -0,0 +1,17 @@
|
||||
diff --git a/src/libs/zbxdb/db.c b/src/libs/zbxdb/db.c
|
||||
index a65b9c4..e011c51 100644
|
||||
--- a/src/libs/zbxdb/db.c
|
||||
+++ b/src/libs/zbxdb/db.c
|
||||
@@ -285,7 +285,11 @@ int zbx_db_connect(char *host, char *user, char *password, char *dbname, char *d
|
||||
#if defined(HAVE_IBM_DB2)
|
||||
char *connect = NULL;
|
||||
#elif defined(HAVE_MYSQL)
|
||||
- my_bool mysql_reconnect = 1;
|
||||
+#if LIBMYSQL_VERSION_ID >= 80000 /* my_bool type is removed in MySQL 8.0 */
|
||||
+ bool mysql_reconnect = 1;
|
||||
+#else
|
||||
+ my_bool mysql_reconnect = 1;
|
||||
+#endif
|
||||
#elif defined(HAVE_ORACLE)
|
||||
char *connect = NULL;
|
||||
sword err = OCI_SUCCESS;
|
||||
@@ -0,0 +1,49 @@
|
||||
diff --git a/conf/zabbix_agentd.conf b/conf/zabbix_agentd.conf
|
||||
index b73bd45..c10daca 100644
|
||||
--- a/conf/zabbix_agentd.conf
|
||||
+++ b/conf/zabbix_agentd.conf
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
### Option: PidFile
|
||||
# Name of PID file.
|
||||
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
|
||||
#
|
||||
# Mandatory: no
|
||||
# Default:
|
||||
diff --git a/conf/zabbix_proxy.conf b/conf/zabbix_proxy.conf
|
||||
index 082f14e..de0284d 100644
|
||||
--- a/conf/zabbix_proxy.conf
|
||||
+++ b/conf/zabbix_proxy.conf
|
||||
@@ -109,6 +109,7 @@ LogFile=/tmp/zabbix_proxy.log
|
||||
|
||||
### Option: PidFile
|
||||
# Name of PID file.
|
||||
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
|
||||
#
|
||||
# Mandatory: no
|
||||
# Default:
|
||||
diff --git a/conf/zabbix_server.conf b/conf/zabbix_server.conf
|
||||
index 9f754ca..3999196 100644
|
||||
--- a/conf/zabbix_server.conf
|
||||
+++ b/conf/zabbix_server.conf
|
||||
@@ -62,6 +62,7 @@ LogFile=/tmp/zabbix_server.log
|
||||
|
||||
### Option: PidFile
|
||||
# Name of PID file.
|
||||
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
|
||||
#
|
||||
# Mandatory: no
|
||||
# Default:
|
||||
diff --git a/src/libs/zbxnix/pid.c b/src/libs/zbxnix/pid.c
|
||||
index baa8415..04c7e0c 100644
|
||||
--- a/src/libs/zbxnix/pid.c
|
||||
+++ b/src/libs/zbxnix/pid.c
|
||||
@@ -26,6 +26,8 @@ static int fdpid = -1;
|
||||
|
||||
int create_pid_file(const char *pidfile)
|
||||
{
|
||||
+ return SUCCEED;
|
||||
+
|
||||
int fd;
|
||||
zbx_stat_t buf;
|
||||
struct flock fl;
|
||||
@@ -0,0 +1,83 @@
|
||||
diff --git a/frontends/php/include/classes/screens/CScreenUrl.php b/frontends/php/include/classes/screens/CScreenUrl.php
|
||||
index e35c5f1..1df396e 100644
|
||||
--- a/frontends/php/include/classes/screens/CScreenUrl.php
|
||||
+++ b/frontends/php/include/classes/screens/CScreenUrl.php
|
||||
@@ -29,18 +29,10 @@ class CScreenUrl extends CScreenBase {
|
||||
public function get() {
|
||||
// prevent from resolving macros in configuration page
|
||||
if ($this->mode != SCREEN_MODE_PREVIEW && $this->mode != SCREEN_MODE_SLIDESHOW) {
|
||||
- return $this->getOutput(
|
||||
- CHtmlUrlValidator::validate($this->screenitem['url'], false)
|
||||
- ? new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'],
|
||||
- 'auto')
|
||||
- : makeMessageBox(false, [[
|
||||
- 'type' => 'error',
|
||||
- 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
|
||||
- ]]
|
||||
- )
|
||||
- );
|
||||
+ return $this->getOutput($this->prepareElement());
|
||||
}
|
||||
- elseif ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && $this->hostid == 0) {
|
||||
+
|
||||
+ if ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && $this->hostid == 0) {
|
||||
return $this->getOutput((new CTableInfo())->setNoDataMessage(_('No host selected.')));
|
||||
}
|
||||
|
||||
@@ -54,14 +46,28 @@ class CScreenUrl extends CScreenBase {
|
||||
|
||||
$this->screenitem['url'] = $url ? $url : $this->screenitem['url'];
|
||||
|
||||
- return $this->getOutput(
|
||||
- CHtmlUrlValidator::validate($this->screenitem['url'], false)
|
||||
- ? new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'], 'auto')
|
||||
- : makeMessageBox(false, [[
|
||||
- 'type' => 'error',
|
||||
- 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
|
||||
- ]]
|
||||
- )
|
||||
- );
|
||||
+ return $this->getOutput($this->prepareElement());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * @return CTag
|
||||
+ */
|
||||
+ public function prepareElement() {
|
||||
+ if (CHtmlUrlValidator::validate($this->screenitem['url'], false)) {
|
||||
+ $item = new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'],
|
||||
+ 'auto'
|
||||
+ );
|
||||
+
|
||||
+ if (ZBX_IFRAME_SANDBOX !== false) {
|
||||
+ $item->setAttribute('sandbox', ZBX_IFRAME_SANDBOX);
|
||||
+ }
|
||||
+
|
||||
+ return $item;
|
||||
+ }
|
||||
+
|
||||
+ return makeMessageBox(false, [[
|
||||
+ 'type' => 'error',
|
||||
+ 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
|
||||
+ ]]);
|
||||
}
|
||||
}
|
||||
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
|
||||
index a67a625..c6a437c 100644
|
||||
--- a/frontends/php/include/defines.inc.php
|
||||
+++ b/frontends/php/include/defines.inc.php
|
||||
@@ -1284,6 +1284,14 @@ if (function_exists('bcscale')) {
|
||||
bcscale(7);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * The sandbox attribute enables an extra set of restrictions for the content in the iframe. Default is set to empty
|
||||
+ * string, which means all restrictions are applied. To disable, set to FALSE. To set a specific set of restrictions,
|
||||
+ * write a custom string.
|
||||
+ * https://www.w3.org/TR/2010/WD-html5-20100624/the-iframe-element.html#attr-iframe-sandbox
|
||||
+ */
|
||||
+define('ZBX_IFRAME_SANDBOX', '');
|
||||
+
|
||||
// HTTP headers
|
||||
/*
|
||||
* Value of HTTP X-Frame-options header.
|
||||
@@ -0,0 +1,11 @@
|
||||
--- zabbix-4.0.1/configure 2018-10-29 10:36:05.000000000 -0700
|
||||
+++ zfx/configure 2018-11-07 16:59:28.015968345 -0800
|
||||
@@ -12510,7 +12510,7 @@
|
||||
CURL_SSL_CERT_LOCATION="${datadir}/zabbix/ssl/certs"
|
||||
CURL_SSL_KEY_LOCATION="${datadir}/zabbix/ssl/keys"
|
||||
|
||||
-LOAD_MODULE_PATH="${libdir}/modules"
|
||||
+LOAD_MODULE_PATH="${libdir}/zabbix"
|
||||
|
||||
|
||||
|
||||
19
net-analyzer/zabbix-server/files/zabbix-server.init
Normal file
19
net-analyzer/zabbix-server/files/zabbix-server.init
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/sbin/zabbix_server"
|
||||
command_args="--foreground --config /etc/zabbix/zabbix_server.conf"
|
||||
command_background="true"
|
||||
command_user="zabbix:zabbix"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use mysql postgresql
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
|
||||
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
|
||||
}
|
||||
1
net-analyzer/zabbix-server/files/zabbix-server.tmpfiles
Normal file
1
net-analyzer/zabbix-server/files/zabbix-server.tmpfiles
Normal file
@@ -0,0 +1 @@
|
||||
d /run/zabbix 0755 zabbix zabbix -
|
||||
Reference in New Issue
Block a user