Switch to upstream SRPM and update to 5.0.3

tags/zabbix-5.0.3-1
Daniel Berteaud 4 years ago
parent dd40939ea6
commit 98de2f16c6
  1. 54
      config.patch
  2. 39
      fping3-sourceip-option.patch
  3. BIN
      zabbix-4.2.8.tar.gz
  4. BIN
      zabbix-5.0.3.tar.gz
  5. 110
      zabbix-agent.init
  6. 20
      zabbix-agent.service
  7. 4
      zabbix-agent.sysconfig
  8. 97
      zabbix-agent2.init
  9. 20
      zabbix-agent2.service
  10. 4
      zabbix-agent2.sysconfig
  11. 134
      zabbix-java-gateway.init
  12. 16
      zabbix-java-gateway.service
  13. 6
      zabbix-logrotate.in
  14. 56
      zabbix-nginx.conf
  15. 24
      zabbix-php-fpm.conf
  16. 101
      zabbix-proxy.init
  17. 37
      zabbix-proxy.service
  18. 30
      zabbix-proxy.te
  19. 99
      zabbix-server.init
  20. 35
      zabbix-server.service
  21. 34
      zabbix-server.te
  22. 1
      zabbix-tmpfile.conf
  23. 1
      zabbix-tmpfiles.conf
  24. 35
      zabbix-web-fcgi.conf
  25. 39
      zabbix-web.conf
  26. 59
      zabbix-web22.conf
  27. 38
      zabbix-web24.conf
  28. 2190
      zabbix.spec
  29. 85
      zabbix_java_gateway-sysd
  30. 12
      zabbix_proxy
  31. 12
      zabbix_server

@ -0,0 +1,54 @@
diff -urN 4.0.1.orig/ui/include/classes/core/CConfigFile.php 4.0.1/ui/include/classes/core/CConfigFile.php
--- 4.0.1.orig/ui/include/classes/core/CConfigFile.php 2018-10-29 19:00:25.270221980 +0200
+++ 4.0.1/ui/include/classes/core/CConfigFile.php 2018-10-29 19:00:54.666586770 +0200
@@ -24,7 +24,7 @@
const CONFIG_NOT_FOUND = 1;
const CONFIG_ERROR = 2;
- const CONFIG_FILE_PATH = '/conf/zabbix.conf.php';
+ const CONFIG_FILE_PATH = '/etc/zabbix/web/zabbix.conf.php';
private static $supported_db_types = [
ZBX_DB_MYSQL => true,
diff -urN 4.0.1.orig/ui/include/classes/core/ZBase.php 4.0.1/ui/include/classes/core/ZBase.php
--- 4.0.1.orig/ui/include/classes/core/ZBase.php 2018-10-29 19:00:25.270221980 +0200
+++ 4.0.1/ui/include/classes/core/ZBase.php 2018-10-29 19:00:36.450360730 +0200
@@ -320,7 +320,7 @@
* @throws Exception
*/
protected function setMaintenanceMode() {
- require_once 'conf/maintenance.inc.php';
+ require_once '/etc/zabbix/web/maintenance.inc.php';
if (defined('ZBX_DENY_GUI_ACCESS')) {
if (!isset($ZBX_GUI_ACCESS_IP_RANGE) || !in_array(CWebUser::getIp(), $ZBX_GUI_ACCESS_IP_RANGE)) {
@@ -289,7 +289,7 @@
* Load zabbix config file.
*/
protected function loadConfigFile() {
- $configFile = $this->getRootDir().CConfigFile::CONFIG_FILE_PATH;
+ $configFile = CConfigFile::CONFIG_FILE_PATH;
$config = new CConfigFile($configFile);
$this->config = $config->load();
}
diff -urN 4.0.1.orig/ui/include/classes/setup/CSetupWizard.php 4.0.1/ui/include/classes/setup/CSetupWizard.php
--- 4.0.1.orig/ui/include/classes/setup/CSetupWizard.php 2018-10-29 19:00:25.274222030 +0200
+++ 4.0.1/ui/include/classes/setup/CSetupWizard.php 2018-10-29 19:00:36.450360730 +0200
@@ -336,7 +336,7 @@
function stage5() {
$this->setConfig('ZBX_CONFIG_FILE_CORRECT', true);
- $config_file_name = APP::getInstance()->getRootDir().CConfigFile::CONFIG_FILE_PATH;
+ $config_file_name = CConfigFile::CONFIG_FILE_PATH;
$config = new CConfigFile($config_file_name);
$config->config = [
'DB' => [
@@ -507,7 +507,7 @@
// make zabbix.conf.php downloadable
header('Content-Type: application/x-httpd-php');
header('Content-Disposition: attachment; filename="'.basename(CConfigFile::CONFIG_FILE_PATH).'"');
- $config = new CConfigFile(APP::getInstance()->getRootDir().CConfigFile::CONFIG_FILE_PATH);
+ $config = new CConfigFile(CConfigFile::CONFIG_FILE_PATH);
$config->config = [
'DB' => [
'TYPE' => $this->getConfig('DB_TYPE'),

@ -0,0 +1,39 @@
diff -Nru zabbix-3.0.2.orig/src/libs/zbxicmpping/icmpping.c zabbix-3.0.2/src/libs/zbxicmpping/icmpping.c
--- zabbix-3.0.2.orig/src/libs/zbxicmpping/icmpping.c 2016-04-20 18:51:21.000000000 +0900
+++ zabbix-3.0.2/src/libs/zbxicmpping/icmpping.c 2016-04-20 22:28:59.000000000 +0900
@@ -42,34 +42,7 @@
static void get_source_ip_option(const char *fping, const char **option, unsigned char *checked)
{
- FILE *f;
- char *p, tmp[MAX_STRING_LEN];
-
- zbx_snprintf(tmp, sizeof(tmp), "%s -h 2>&1", fping);
-
- if (NULL == (f = popen(tmp, "r")))
- return;
-
- while (NULL != fgets(tmp, sizeof(tmp), f))
- {
- for (p = tmp; isspace(*p); p++)
- ;
-
- if ('-' == p[0] && 'I' == p[1] && (isspace(p[2]) || ',' == p[2]))
- {
- *option = "-I";
- continue;
- }
-
- if ('-' == p[0] && 'S' == p[1] && (isspace(p[2]) || ',' == p[2]))
- {
- *option = "-S";
- break;
- }
- }
-
- pclose(f);
-
+ *option = "-S";
*checked = 1;
}

BIN
zabbix-4.2.8.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
zabbix-5.0.3.tar.gz (Stored with Git LFS)

Binary file not shown.

@ -1,67 +1,97 @@
#! /bin/sh
#!/bin/sh
#
# chkconfig: - 85 15
# description: zabbix agent daemon
# chkconfig: - 86 14
# description: Zabbix agent daemon
# processname: zabbix_agentd
# config: /etc/zabbix/zabbix_agentd.conf
#
### BEGIN INIT INFO
# Provides: zabbix-agent
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start: zabbix zabbix-proxy
# Should-Stop: zabbix zabbix-proxy
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop zabbix agent
# Description: Zabbix Agent
# Short-Description: Start and stop Zabbix agent
# Description: Zabbix agent
### END INIT INFO
# zabbix details
ZABBIX_AGENTD=/usr/sbin/zabbix_agentd
CONF=/etc/zabbix/zabbix_agentd.conf
PIDFILE=/var/run/zabbix-agent.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
if [ -x /usr/sbin/zabbix_agentd ]; then
exec=/usr/sbin/zabbix_agentd
else
exit 5
fi
prog=${exec##*/}
conf=/etc/zabbix/zabbix_agentd.conf
pidfile=$(grep -e "^PidFile=.*$" $conf | cut -d= -f2 | tr -d '\r')
timeout=10
if [ -f /etc/sysconfig/zabbix-agent ]; then
. /etc/sysconfig/zabbix-agent
fi
if [ -n "$ZABBIX_AGENT_USER" ]; then
user_conf="--user=$ZABBIX_AGENT_USER"
else
user_conf=''
fi
lockfile=/var/lock/subsys/zabbix-agent
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
start()
{
echo -n $"Starting Zabbix agent: "
daemon $user_conf $exec -c $conf
rv=$?
echo
[ $rv -eq 0 ] && touch $lockfile
return $rv
}
[ -x $ZABBIX_AGENTD ] || exit 5
[ -e $CONF ] || exit 6
stop()
{
echo -n $"Shutting down Zabbix agent: "
killproc -p $pidfile -d $timeout $prog
rv=$?
echo
[ $rv -eq 0 ] && rm -f $lockfile
return $rv
}
RETVAL=0
restart()
{
stop
start
}
case "$1" in
start)
echo -n "Starting Zabbix Agent: "
daemon $ZABBIX_AGENTD -c $CONF
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix-agent
start|stop|restart)
$1
;;
stop)
echo -n "Shutting down Zabbix Agent: "
killproc zabbix_agentd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix-agent
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
force-reload)
restart
;;
status)
status zabbix_agentd
RETVAL=$?
status -p $pidfile $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
;;
esac
exit $RETVAL

@ -1,16 +1,20 @@
[Unit]
Description=Zabbix Monitoring Agent
After=syslog.target network.target
Description=Zabbix Agent
After=syslog.target
After=network.target
[Service]
Type=simple
ExecStart=/usr/sbin/zabbix_agentd --config /etc/zabbix/zabbix_agentd.conf --foreground
Restart=always
Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent
Type=forking
Restart=on-failure
PIDFile=/run/zabbix/zabbix_agentd.pid
KillMode=control-group
ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
User=zabbix
Group=zabbix
CPUShares=512
MemoryLimit=150M
BlockIOWeight=500
[Install]
WantedBy=multi-user.target

@ -0,0 +1,4 @@
# Configuration file for /etc/init.d/zabbix-agent service
# User to run zabbix agent as
ZABBIX_AGENT_USER=zabbix

@ -0,0 +1,97 @@
#!/bin/sh
#
# chkconfig: - 86 14
# description: Zabbix agent 2 daemon
# processname: zabbix_agent2
# config: /etc/zabbix/zabbix_agent2.conf
#
### BEGIN INIT INFO
# Provides: zabbix-agent2
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start: zabbix zabbix-proxy
# Should-Stop: zabbix zabbix-proxy
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Start and stop Zabbix agent 2
# Description: Zabbix agent 2
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
if [ -x /usr/sbin/zabbix_agent2 ]; then
exec=/usr/sbin/zabbix_agent2
else
exit 5
fi
prog=${exec##*/}
conf=/etc/zabbix/zabbix_agent2.conf
pidfile=$(grep -e "^PidFile=.*$" $conf | cut -d= -f2 | tr -d '\r')
timeout=10
if [ -f /etc/sysconfig/zabbix-agent2 ]; then
. /etc/sysconfig/zabbix-agent2
fi
if [ -n "$ZABBIX_AGENT_USER" ]; then
user_conf="--user=$ZABBIX_AGENT_USER"
else
user_conf=''
fi
lockfile=/var/lock/subsys/zabbix-agent2
start()
{
echo -n $"Starting Zabbix agent 2: "
daemon $user_conf $exec -c $conf &
rv=$?
echo
[ $rv -eq 0 ] && touch $lockfile
return $rv
}
stop()
{
echo -n $"Shutting down Zabbix agent 2: "
killproc -p $pidfile -d $timeout $prog
rv=$?
echo
[ $rv -eq 0 ] && rm -f $lockfile
return $rv
}
restart()
{
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
force-reload)
restart
;;
status)
status -p $pidfile $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
;;
esac

@ -0,0 +1,20 @@
[Unit]
Description=Zabbix Agent 2
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_agent2.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent2
Type=simple
Restart=on-failure
PIDFile=/run/zabbix/zabbix_agent2.pid
KillMode=control-group
ExecStart=/usr/sbin/zabbix_agent2 -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target

@ -0,0 +1,4 @@
# Configuration file for /etc/init.d/zabbix-agent2 service
# User to run zabbix agent as
ZABBIX_AGENT_USER=zabbix

@ -0,0 +1,134 @@
#! /bin/sh
#
# chkconfig: - 85 15
# description: zabbix java gateway
#
### BEGIN INIT INFO
# Provides: zabbix
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop zabbix java gateway
# Description: Zabbix Java Gateway
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Source Zabbix Java Gateway configuration
. /etc/zabbix/zabbix_java_gateway.conf
if [ -r "/etc/sysconfig/zabbix-java-gateway" ]; then
. /etc/sysconfig/zabbix-java-gateway
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=0
EXECDIR=/usr/sbin/zabbix_java
case "$1" in
start)
echo -n "Starting zabbix java gateway: "
if [ -n "$PID_FILE" -a -e "$PID_FILE" ]; then
echo "zabbix java gateway is already running"
exit 1
fi
JAVA=${JAVA:-java}
JAVA_OPTIONS="-server $JAVA_OPTIONS"
if [ -z "$PID_FILE" ]; then
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=logback-console.xml"
fi
cd $EXECDIR
CLASSPATH="lib"
for jar in {lib,bin}/*.jar; do
if [[ $jar != *junit* ]]; then
CLASSPATH="$CLASSPATH:$jar"
fi
done
if [ -n "$PID_FILE" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.pidFile=$PID_FILE"
fi
if [ -n "$LISTEN_IP" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenIP=$LISTEN_IP"
fi
if [ -n "$LISTEN_PORT" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenPort=$LISTEN_PORT"
fi
if [ -n "$START_POLLERS" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.startPollers=$START_POLLERS"
fi
if [ -n "$TIMEOUT" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.timeout=$TIMEOUT"
fi
tcp_timeout=${TIMEOUT:=3}000
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dsun.rmi.transport.tcp.responseTimeout=$tcp_timeout"
COMMAND_LINE="$JAVA $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway"
if [ -n "$PID_FILE" ]; then
PID=$(su -s /bin/bash -c "$COMMAND_LINE > /dev/null 2>&1 & echo \$!" zabbix)
if ps -p $PID > /dev/null 2>&1; then
echo $PID > $PID_FILE
else
echo "zabbix java gateway did not start"
exit 1
fi
else
exec $COMMAND_LINE
RETVAL=$?
fi
;;
stop)
echo -n "Shutting down zabbix java gateway: "
if [ -n "$PID_FILE" ]; then
if [ -e "$PID_FILE" ]; then
kill `cat $PID_FILE` && rm $PID_FILE
else
echo "zabbix java gateway is not running"
exit 1
fi
else
echo "zabbix java gateway is not configured as a daemon: variable \$PID_FILE is not set"
exit 1
fi
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
condrestart)
if [ -n "$PID_FILE" -a -e "$PID_FILE" ]; then
$0 stop
$0 start
fi
RETVAL=$?
;;
status)
status -p $PID_FILE $0
RETVAL=$?
exit $RETVAL
;;
*)
echo "Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
;;
esac
[ "$RETVAL" -eq 0 ] && success $"$base startup" || failure $"$base startup"
echo
exit $RETVAL

@ -0,0 +1,16 @@
[Unit]
Description=Zabbix Java Gateway
After=syslog.target
After=network.target
[Service]
Type=forking
KillMode=process
PIDFile=/run/zabbix/zabbix_java.pid
ExecStart=/usr/sbin/zabbix_java_gateway
SuccessExitStatus=143
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target

@ -1,7 +1,9 @@
/var/log/zabbix/zabbix_COMPONENT.log {
weekly
rotate 12
compress
delaycompress
missingok
monthly
notifempty
compress
create 0664 zabbix zabbix
}

@ -0,0 +1,56 @@
server {
# listen 80;
# server_name example.com;
root /usr/share/zabbix;
index index.php;
location = /favicon.ico {
log_not_found off;
}
location / {
try_files $uri $uri/ =404;
}
location /assets {
access_log off;
expires 10d;
}
location ~ /\.ht {
deny all;
}
location ~ /(api\/|conf[^\.]|include|locale) {
deny all;
return 404;
}
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/run/php-fpm/zabbix.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /usr/share/zabbix;
fastcgi_param SCRIPT_FILENAME /usr/share/zabbix$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /usr/share/zabbix$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}

@ -0,0 +1,24 @@
[zabbix]
user = apache
group = apache
listen = /run/php-fpm/zabbix.sock
listen.owner = nginx
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session
php_value[max_execution_time] = 300
php_value[memory_limit] = 128M
php_value[post_max_size] = 16M
php_value[upload_max_filesize] = 2M
php_value[max_input_time] = 300
php_value[max_input_vars] = 10000
; php_value[date.timezone] = Europe/Riga

@ -1,69 +1,88 @@
#! /bin/sh
#!/bin/sh
#
# chkconfig: - 85 15
# description: zabbix proxy daemon
# description: Zabbix proxy daemon
# config: /etc/zabbix/zabbix_proxy.conf
#
### BEGIN INIT INFO
# Provides: zabbix
# Provides: zabbix-proxy
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop zabbix proxy
# Description: Zabbix Proxy
# Short-Description: Start and stop Zabbix proxy
# Description: Zabbix proxy
### END INIT INFO
# zabbix details
if [ -x /usr/sbin/zabbix_proxy_mysql ]; then
ZABBIX_PROXY=zabbix_proxy_mysql
elif [ -x /usr/sbin/zabbix_proxy_pgsql ]; then
ZABBIX_PROXY=zabbix_proxy_pgsql
elif [ -x /usr/sbin/zabbix_proxy_sqlite3 ]; then
ZABBIX_PROXY=zabbix_proxy_sqlite3
# Source function library.
. /etc/rc.d/init.d/functions
if [ -x /usr/sbin/zabbix_proxy ]; then
exec=/usr/sbin/zabbix_proxy
else
exit 5
fi
CONF=/etc/zabbix/zabbix_proxy.conf
PIDFILE=/var/run/zabbix.pid
prog=${exec##*/}
conf=/etc/zabbix/zabbix_proxy.conf
pidfile=$(grep -e "^PidFile=.*$" $conf | cut -d= -f2 | tr -d '\r')
timeout=10
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/zabbix-proxy ]; then
. /etc/sysconfig/zabbix-proxy
fi
[ -e $CONF ] || exit 6
lockfile=/var/lock/subsys/zabbix-proxy
RETVAL=0
start()
{
echo -n $"Starting Zabbix proxy: "
daemon $exec -c $conf
rv=$?
echo
[ $rv -eq 0 ] && touch $lockfile
return $rv
}
stop()
{
echo -n $"Shutting down Zabbix proxy: "
killproc -p $pidfile -d $timeout $prog
rv=$?
echo
[ $rv -eq 0 ] && rm -f $lockfile
return $rv
}
restart()
{
stop
start
}
case "$1" in
start)
echo -n "Starting Zabbix Proxy: "
daemon $ZABBIX_PROXY -c $CONF
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix-proxy
;;
stop)
echo -n "Shutting down Zabbix Proxy: "
killproc $ZABBIX_PROXY
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix-proxy
start|stop|restart)
$1
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
force-reload)
restart
;;
status)
status $ZABBIX_PROXY
RETVAL=$?
status -p $pidfile $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
;;
esac
exit $RETVAL

@ -1,21 +1,30 @@
[Unit]
Description=Zabbix Proxy
After=syslog.target network.target
After=syslog.target
After=network.target
After=mysql.service
After=mysqld.service
After=mariadb.service
After=postgresql.service
After=pgbouncer.service
After=postgresql-9.4.service
After=postgresql-9.5.service
After=postgresql-9.6.service
After=postgresql-10.service
After=postgresql-11.service
After=postgresql-12.service
[Service]
Type=simple
ExecStart=/usr/sbin/zabbix_proxy --config /etc/zabbix/zabbix_proxy.conf --foreground
ExecReload=/usr/sbin/zabbix_proxy -R config_cache_reload
User=zabbix
Group=zabbix
CPUShares=512
MemoryLimit=500M
BlockIOWeight=500
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
Restart=always
Environment="CONFFILE=/etc/zabbix/zabbix_proxy.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-proxy
Type=forking
Restart=on-failure
PIDFile=/run/zabbix/zabbix_proxy.pid
KillMode=control-group
ExecStart=/usr/sbin/zabbix_proxy -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
TimeoutSec=0
[Install]
WantedBy=multi-user.target

@ -1,30 +0,0 @@
module zabbix-proxy 1.4;
require {
type var_lib_t;
type ping_t;
type initrc_t;
type unlabeled_t;
type zabbix_t;
type zabbix_var_run_t;
type zabbix_var_lib_t;
class file { read getattr };
class sem { unix_read unix_write associate destroy };
class shm { unix_read unix_write associate destroy };
class tcp_socket { create getattr accept shutdown read };
class sock_file { create write unlink };
class netlink_route_socket { create bind };
class process setrlimit;
class unix_stream_socket connectto;
}
#============= ping_t ==============
allow ping_t var_lib_t:file { read getattr };
allow ping_t zabbix_var_lib_t:file { read getattr };
allow initrc_t unlabeled_t:sem { unix_read unix_write associate destroy };
allow initrc_t unlabeled_t:shm { unix_read unix_write associate destroy };
allow unlabeled_t self:tcp_socket { create getattr accept shutdown read };
allow unlabeled_t self:netlink_route_socket { create bind };
allow zabbix_t self:process setrlimit;
allow zabbix_t zabbix_var_run_t:sock_file { create write unlink };
allow zabbix_t self:unix_stream_socket connectto;

@ -1,7 +1,8 @@
#! /bin/sh
#!/bin/sh
#
# chkconfig: - 85 15
# description: zabbix server daemon
# description: Zabbix server daemon
# config: /etc/zabbix/zabbix_server.conf
#
### BEGIN INIT INFO
@ -10,60 +11,78 @@
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop zabbix server
# Description: Zabbix Server
# Short-Description: Start and stop Zabbix server
# Description: Zabbix server
### END INIT INFO
# zabbix details
if [ -x /usr/sbin/zabbix_server_mysql ]; then
ZABBIX=zabbix_server_mysql
elif [ -x /usr/sbin/zabbix_server_pgsql ]; then
ZABBIX=zabbix_server_pgsql
elif [ -x /usr/sbin/zabbix_server_sqlite3 ]; then
ZABBIX=zabbix_server_sqlite3
# Source function library.
. /etc/rc.d/init.d/functions
if [ -x /usr/sbin/zabbix_server ]; then
exec=/usr/sbin/zabbix_server
else
exit 5
fi
CONF=/etc/zabbix/zabbix_server.conf
PIDFILE=/var/run/zabbix.pid
prog=${exec##*/}
conf=/etc/zabbix/zabbix_server.conf
pidfile=$(grep -e "^PidFile=.*$" $conf | cut -d= -f2 | tr -d '\r')
timeout=10
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/zabbix-server ]; then
. /etc/sysconfig/zabbix-server
fi
[ -e $CONF ] || exit 6
lockfile=/var/lock/subsys/zabbix-server
RETVAL=0
start()
{
echo -n $"Starting Zabbix server: "
daemon $exec -c $conf
rv=$?
echo
[ $rv -eq 0 ] && touch $lockfile
return $rv
}
stop()
{
echo -n $"Shutting down Zabbix server: "
killproc -p $pidfile -d $timeout $prog
rv=$?
echo
[ $rv -eq 0 ] && rm -f $lockfile
return $rv
}
restart()
{
stop
start
}
case "$1" in
start)
echo -n "Starting Zabbix Server: "
daemon $ZABBIX -c $CONF
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix
;;
stop)
echo -n "Shutting down Zabbix Server: "
killproc $ZABBIX
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix
start|stop|restart)
$1
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
force-reload)
restart
;;
status)
status $ZABBIX
RETVAL=$?
status -p $pidfile $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
;;
esac
exit $RETVAL

@ -1,19 +1,30 @@
[Unit]
Description=Zabbix Server
After=syslog.target network.target
After=syslog.target
After=network.target
After=mysql.service
After=mysqld.service
After=mariadb.service
After=postgresql.service
After=pgbouncer.service
After=postgresql-9.4.service
After=postgresql-9.5.service
After=postgresql-9.6.service
After=postgresql-10.service
After=postgresql-11.service
After=postgresql-12.service
[Service]
Type=simple
ExecStart=/usr/sbin/zabbix_server --config /etc/zabbix/zabbix_server.conf --foreground
ExecReload=/usr/sbin/zabbix_server -R config_cache_reload
User=zabbix
Group=zabbix
MemoryLimit=2048M
BlockIOWeight=500
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
Environment="CONFFILE=/etc/zabbix/zabbix_server.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-server
Type=forking
Restart=on-failure
PIDFile=/run/zabbix/zabbix_server.pid
KillMode=control-group
ExecStart=/usr/sbin/zabbix_server -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
TimeoutSec=0
[Install]
WantedBy=multi-user.target

@ -1,34 +0,0 @@
module zabbix-server 1.4;
require {
type devlog_t;
type zabbix_t;
type ping_t;
type syslogd_t;
type sudo_exec_t;
type zabbix_var_lib_t;
type zabbix_var_run_t;
class process { setrlimit setpgid };
class capability { sys_resource audit_write };
class file { execute read create ioctl execute_no_trans write getattr unlink open };
class netlink_audit_socket { nlmsg_relay create };
class sock_file { create write unlink };
class unix_dgram_socket { create connect sendto };
class dir { write remove_name add_name };
class key write;
class unix_stream_socket connectto;
}
allow ping_t zabbix_var_lib_t:file { read getattr };
allow zabbix_t devlog_t:sock_file write;
allow zabbix_t self:capability { sys_resource audit_write };
allow zabbix_t self:netlink_audit_socket { nlmsg_relay create };
allow zabbix_t self:process { setrlimit setpgid };
allow zabbix_t self:unix_dgram_socket { create connect };
allow zabbix_t self:key write;
allow zabbix_t sudo_exec_t:file { read execute open execute_no_trans };
allow zabbix_t syslogd_t:unix_dgram_socket sendto;
allow zabbix_t zabbix_var_lib_t:dir { write remove_name add_name };
allow zabbix_t zabbix_var_lib_t:file { execute read create getattr execute_no_trans write ioctl unlink open };
allow zabbix_t self:unix_stream_socket connectto;
allow zabbix_t zabbix_var_run_t:sock_file { create write unlink };

@ -1 +0,0 @@
d /run/zabbix 750 zabbix zabbix

@ -0,0 +1 @@
d /run/zabbix 0755 zabbix zabbix - -

@ -0,0 +1,35 @@
#
# Zabbix monitoring system php web frontend
#
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Require all granted
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/run/php-fpm/zabbix.sock|fcgi://localhost"
</FilesMatch>
</Directory>
<Directory "/usr/share/zabbix/conf">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/app">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/include">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/local">
Require all denied
</Directory>

@ -1,39 +0,0 @@
#
# Zabbix monitoring system php web frontend
#
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
<IfModule mod_authz_core.c>
# Apache 2.4
Require ip 127.0.0.1
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from 127.0.0.1
</IfModule>
#php_admin_value post_max_size 16M
#php_admin_value max_execution_time 300
#php_admin_value max_input_time 300
#php_admin_value date.timezone "Europe/Paris"
</Directory>
<Directory ~ "^/usr/share/zabbix/(conf|api|include)/">
<files *.php>
<IfModule mod_authz_core.c>
# Apache 2.4
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</files>
</Directory>

@ -0,0 +1,59 @@
#
# Zabbix monitoring system php web frontend
#
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
<IfModule mod_php5.c>
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value max_input_vars 10000
php_value always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga
</IfModule>
</Directory>
<Directory "/usr/share/zabbix/conf">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>
<Directory "/usr/share/zabbix/app">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>
<Directory "/usr/share/zabbix/include">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>
<Directory "/usr/share/zabbix/local">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>

@ -0,0 +1,38 @@
#
# Zabbix monitoring system php web frontend
#
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Require all granted
<IfModule mod_php5.c>
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value max_input_vars 10000
php_value always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga
</IfModule>
</Directory>
<Directory "/usr/share/zabbix/conf">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/app">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/include">
Require all denied
</Directory>
<Directory "/usr/share/zabbix/local">
Require all denied
</Directory>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,85 @@
#!/bin/bash
if [ -r /etc/zabbix/zabbix_java_gateway.conf ]; then
. /etc/zabbix/zabbix_java_gateway.conf
fi
if [ -z $GATEWAY_HOME ]; then
GATEWAY_HOME="/usr/share/zabbix-java-gateway"
fi
if [ -r "/etc/sysconfig/zabbix-java-gateway" ]; then
. /etc/sysconfig/zabbix-java-gateway
fi
if [ -n "$PID_FILE" -a -f "$PID_FILE" ]; then
PID=`cat "$PID_FILE"`
if ps -p "$PID" > /dev/null 2>&1; then
echo "Zabbix Java Gateway is already running"
exit 1
fi
rm -f "$PID_FILE"
fi
JAVA=${JAVA:-java}
JAVA_OPTIONS="-server $JAVA_OPTIONS"
JAVA_OPTIONS="$JAVA_OPTIONS -Dlogback.configurationFile=/etc/zabbix/zabbix_java_gateway_logback.xml"
cd $GATEWAY_HOME
CLASSPATH="lib"
for jar in lib/*.jar bin/*.jar; do
CLASSPATH="$CLASSPATH:$jar"
done
if [ -n "$PID_FILE" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.pidFile=$PID_FILE"
fi
if [ -n "$LISTEN_IP" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenIP=$LISTEN_IP"
fi
if [ -n "$LISTEN_PORT" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.listenPort=$LISTEN_PORT"
fi
if [ -n "$START_POLLERS" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.startPollers=$START_POLLERS"
fi
if [ -n "$TIMEOUT" ]; then
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dzabbix.timeout=$TIMEOUT"
fi
tcp_timeout=${TIMEOUT:=3}000
ZABBIX_OPTIONS="$ZABBIX_OPTIONS -Dsun.rmi.transport.tcp.responseTimeout=$tcp_timeout"
COMMAND_LINE="$JAVA $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway"
if [ -n "$PID_FILE" ]; then
# check that the PID file can be created
touch "$PID_FILE"
if [ $? -ne 0 ]; then
echo "Zabbix Java Gateway did not start: cannot create PID file"
exit 1
fi
# start the gateway and output pretty errors to the console
STDOUT=`$COMMAND_LINE & echo $! > "$PID_FILE"`
if [ -n "$STDOUT" ]; then
echo "$STDOUT"
fi
# verify that the gateway started successfully
PID=`cat "$PID_FILE"`
ps -p "$PID" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Zabbix Java Gateway did not start"
rm -f "$PID_FILE"
exit 1
fi
else
exec $COMMAND_LINE
fi

@ -1,12 +0,0 @@
#!/bin/sh
exec 2>&1
if [ -x /usr/sbin/zabbix_proxy_mysql ]; then
ZABBIX=/usr/sbin/zabbix_proxy_mysql
elif [ -x /usr/sbin/zabbix_proxy_pgsql ]; then
ZABBIX=/usr/sbin/zabbix_proxy_pgsql
elif [ -x /usr/sbin/zabbix_proxy_sqlite3 ]; then
ZABBIX=/usr/sbin/zabbix_proxy_sqlite3
else
exit 1
fi
$ZABBIX "$@"

@ -1,12 +0,0 @@
#!/bin/sh
exec 2>&1
if [ -x /usr/sbin/zabbix_server_mysql ]; then
ZABBIX=/usr/sbin/zabbix_server_mysql
elif [ -x /usr/sbin/zabbix_server_pgsql ]; then
ZABBIX=/usr/sbin/zabbix_server_pgsql
elif [ -x /usr/sbin/zabbix_server_sqlite3 ]; then
ZABBIX=/usr/sbin/zabbix_server_sqlite3
else
exit 1
fi
$ZABBIX "$@"
Loading…
Cancel
Save