如图:
查看zabbix_server的进程:
[root@localhost ~]# ps aux | grep zabbix zabbix 7907 0.0 0.3 261556 3728 ? S 13:10 0:00 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf root 8006 0.0 0.0 112720 980 pts/1 R+ 13:15 0:00 grep --color=auto zabbix
查看zabbix_server的端口(默认10051):
[root@localhost ~]# netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 669/rpcbind tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1391/dnsmasq tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1113/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1111/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1372/master tcp6 0 0 :::3306 :::* LISTEN 2240/mysqld tcp6 0 0 :::111 :::* LISTEN 669/rpcbind tcp6 0 0 :::80 :::* LISTEN 2014/httpd tcp6 0 0 :::22 :::* LISTEN 1113/sshd tcp6 0 0 ::1:631 :::* LISTEN 1111/cupsd tcp6 0 0 ::1:25 :::* LISTEN 1372/master
发现没有10051端口,说明没有开启zabbix_server进程,接着编辑zabbix_server.conf:
vi /etc/zabbix/zabbix_server.conf # 找到DBHost并把localhost改为127.0.0.1 ... ### Option: DBHost # Database host name. # If set to localhost, socket is used for MySQL. # If set to empty string, socket is used for PostgreSQL. # # Mandatory: no # Default: DBHost=127.0.0.1 ...
重启zabbix-server服务:
[root@localhost ~]# systemctl restart zabbix-server.service
再次查看进程,发现多了好多zabbix相关的进程:
[root@localhost ~]# ps aux | grep zabbix zabbix 8246 0.0 0.4 261660 4236 ? S 13:25 0:00 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf zabbix 8248 0.0 0.2 261660 2528 ? S 13:25 0:00 /usr/sbin/zabbix_server: configuration syncer [waiting 60 sec for processes] zabbix 8249 0.0 0.2 261660 2528 ? S 13:25 0:00 /usr/sbin/zabbix_server: alerter #1 started zabbix 8250 0.0 0.2 261660 2528 ? S 13:25 0:00 /usr/sbin/zabbix_server: alerter #2 started zabbix 8251 0.0 0.2 261660 2528 ? S 13:25 0:00 /usr/sbin/zabbix_server: alerter #3 started zabbix 8252 0.0 0.2 261660 2528 ? S 13:25 0:00 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes] zabbix 8253 0.0 0.3 261808 3252 ? S 13:25 0:00 /usr/sbin/zabbix_server: timer #1 [processed 1 triggers, 0 events in 0.001601 sec, 0 maintenances in 0.000894 sec, idle 30 sec] ...
再次查看端口,发现10051端口已开启:
[root@localhost ~]# netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 8246/zabbix_server tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 669/rpcbind tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1391/dnsmasq tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1113/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1111/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1372/master tcp6 0 0 :::10051 :::* LISTEN 8246/zabbix_server tcp6 0 0 :::3306 :::* LISTEN 2240/mysqld tcp6 0 0 :::111 :::* LISTEN 669/rpcbind tcp6 0 0 :::80 :::* LISTEN 2014/httpd tcp6 0 0 :::22 :::* LISTEN 1113/sshd tcp6 0 0 ::1:631 :::* LISTEN 1111/cupsd tcp6 0 0 ::1:25 :::* LISTEN 1372/master
查看zabbix的web界面: