标签:row stop 代理服务 erp logs 登录 anywhere 端口 name
zabbix-server-mysql
zabbix-frontend-php
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:10051 0.0.0.0:*
users:(("zabbix_server",pid=3991,fd=4),("zabbix_server",pid=3990,fd=4),("zabbix_server",pid=3989,fd=4)……
……
LISTEN 0 80 192.168.1.14:3306 0.0.0.0:*
users:(("mysqld",pid=1461,fd=20))
……
LISTEN 0 128 *:80 *:*
users:(("apache2",pid=4105,fd=4),("apache2",pid=4100,fd=4),("apache2",pid=4091,fd=4),("apache2",pid=3904,fd=4),
("apache2",pid=3900,fd=4),("apache2",pid=3801,fd=4),("apache2",pid=3576,fd=4),("apache2",pid=3501,fd=4),("apache2",
pid=3404,fd=4),("apache2",pid=1620,fd=4),("apache2",pid=1587,fd=4))
……
MariaDB [(none)]> create database zabbix_proxy_active character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix_proxy_active.* to zabbix_proxy_active@192.168.1.20 identified by ‘zabbix_proxy_active‘;
zabbix-proxy-mysql
root@ubuntu1804:/etc/zabbix# grep ‘^[a-Z]‘ /etc/zabbix/zabbix_proxy.conf
ProxyMode=0 #主动模式
Server=192.168.1.14
Hostname=zabbix_proxy_active
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
EnableRemoteCommands=1 #开启允许远程命令
LogRemoteCommands=1
PidFile=/var/run/zabbix/zabbix_proxy.pid
SocketDir=/var/run/zabbix
DBHost=192.168.1.14
DBName=zabbix_proxy_active
DBUser=zabbix_proxy_active
DBPassword=zabbix_proxy_active
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=30
ExternalScripts=/usr/lib/zabbix/externalscripts
FpingLocation=/usr/bin/fping
Fping6Location=/usr/bin/fping6
LogSlowQueries=3000
root@ubuntu1804:~# mysql -uzabbix_proxy_active -pzabbix_proxy_active -h192.168.1.14
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 6951
Server version: 10.1.40-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
MariaDB [(none)]> show databases;
+---------------------+
| Database |
+---------------------+
| information_schema |
| zabbix_proxy_active |
+---------------------+
2 rows in set (0.00 sec)
zcat /usr/share/doc/zabbix-proxy-mysql/schema.sql.gz | mysql -uzabbix_proxy_active -pzabbix_proxy_active
-h192.168.1.14 zabbix_proxy_active
root@ubuntu1804:~# systemctl restart zabbix-proxy
root@ubuntu1804:~# systemctl enable zabbix-proxy
root@ubuntu1804:~# ss -tnlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:10051 0.0.0.0:*
users:(("zabbix_proxy",pid=3559,fd=4),("zabbix_proxy",pid=3558,fd=4),("zabbix_proxy",pid=3557,fd=4),("zabbix_proxy",pid=3556,fd=4),("zabbix_proxy",pid=3555,fd=4),("zabbix_proxy",pid=3554,fd=4),("zabbix_proxy",pid=3553,fd=4),("zabbix_proxy",pid=3552,fd=4),("zabbix_proxy",pid=3551,fd=4),("zabbix_proxy",pid=3550,fd=4),("zabbix_proxy",pid=3549,fd=4),("zabbix_proxy",pid=3548,fd=4),("zabbix_proxy",pid=3547,fd=4),("zabbix_proxy",pid=3546,fd=4),("zabbix_proxy",pid=3545,fd=4),("zabbix_proxy",pid=3544,fd=4),("zabbix_proxy",pid=3543,fd=4),("zabbix_proxy",pid=3542,fd=4),("zabbix_proxy",pid=3541,fd=4),("zabbix_proxy",pid=3540,fd=4),("zabbix_proxy",pid=3539,fd=4),("zabbix_proxy",pid=3538,fd=4),("zabbix_proxy",pid=3537,fd=4),("zabbix_proxy",pid=3536,fd=4),("zabbix_proxy",pid=3525,fd=4))
LISTEN 0 80 0.0.0.0:3306 0.0.0.0:*
users:(("mysqld",pid=4094,fd=17))
……
zabbix-agent
nginx
[root@nginx zabbix_agentd.d]# grep ‘^[a-Z]‘ /etc/zabbix/zabbix_agentd.conf
EnableRemoteCommands=1 #一定要开启,否则导致无法执行远程命令
Server=192.168.1.14,192.168.1.20 #同时指定server端和proxy代理端
ServerActive=192.168.1.20 #指定主动模式的proxy代理端
Hostname=192.168.1.16 #给本机指定一个主机名,web端上天添加的主机名必须和此处主机名相同,否则会导致数据采集失败
Timeout=30
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UnsafeUserParameters=1 #支持远程命令传输的特殊字符,也必须开启
[root@nginx ~]# systemctl restart zabbix-agent
[root@nginx ~]# systemctl enable zabbix-agent
[root@nginx ~]# systemctl start nginx
[root@nginx ~]# systemctl enable nginx
[root@nginx ~]# ss -tnlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 511 *:8080 *:*
users:(("nginx",pid=50295,fd=6),("nginx",pid=50294,fd=6),("nginx",pid=50293,fd=6),("nginx",pid=50292,fd=6),
("nginx",pid=50291,fd=6))
LISTEN 0 128 *:10050 *:*
……
users:(("zabbix_agentd",pid=43802,fd=4),("zabbix_agentd",pid=43801,fd=4),("zabbix_agentd",pid=43800,fd=4),
("zabbix_agentd",pid=43799,fd=4),("zabbix_agentd",pid=43798,fd=4),("zabbix_agentd",pid=43797,fd=4))
……
[root@nginx ~]# vim /etc/sudoers
#Defaults requiretty #一定要注释掉此行,会导致sudo超级用户无法执行远程命令
……
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
zabbix ALL=(ALL) NOPASSWD: ALL
……
选择admin账户
[root@nginx zabbix_agentd.d]# systemctl stop nginx
[root@nginx ~]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: inactive (dead)
[root@nginx zabbix_agentd.d]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2019-07-19 16:43:10 CST; 12min ago
Process: 50272 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 50245 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 50243 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
……
标签:row stop 代理服务 erp logs 登录 anywhere 端口 name
原文地址:https://blog.51cto.com/14234542/2421845