码迷,mamicode.com
首页 > 其他好文 > 详细

Zabbix的启动管理方式

时间:2017-11-02 11:31:37      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:rsyslog   restore   ast   network   postfix   两种   store   box   ddr   

1)一般启动方式

启动:[root@zabbix ~]# /usr/local/zabbix-3.2.6/sbin/zabbix_server

[root@zabbix core5]# netstat -tulpn
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:22 0.0.0.0:* LISTEN 1221/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1079/master
tcp 0 0 0.0.0.0:8027 0.0.0.0:* LISTEN 35705/nginx
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 35530/php-fpm
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 10391/mysqld
tcp 0 0 :::22 :::* LISTEN 1221/sshd
tcp 0 0 ::1:25 :::* LISTEN 1079/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 898/dhclient
[root@zabbix core5]# netstat -tulpn
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:22 0.0.0.0:* LISTEN 1221/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1079/master
tcp 0 0 0.0.0.0:8027 0.0.0.0:* LISTEN 35705/nginx
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 101277/zabbix_serve
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 35530/php-fpm
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 10391/mysqld
tcp 0 0 :::22 :::* LISTEN 1221/sshd
tcp 0 0 ::1:25 :::* LISTEN 1079/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 898/dhclient

关闭:[root@zabbix ~]# pkill -9 zabbix    

此时,再观察端口的变化。

 

2)利用脚本启动方式

[root@zabbix ~]# find / -name zabbix_server
/usr/local/src/zabbix-3.2.6/src/zabbix_server
/usr/local/src/zabbix-3.2.6/src/zabbix_server/zabbix_server
/usr/local/src/zabbix-3.2.6/misc/init.d/tru64/zabbix_server
/usr/local/src/zabbix-3.2.6/misc/init.d/freebsd/zabbix_server
/usr/local/src/zabbix-3.2.6/misc/init.d/fedora/core5/zabbix_server
/usr/local/src/zabbix-3.2.6/misc/init.d/fedora/core/zabbix_server
/usr/local/src/zabbix-3.2.6/misc/init.d/suse/9.3/zabbix_server
/usr/local/src/zabbix-3.2.6/misc/init.d/suse/9.1/zabbix_server
/usr/local/src/zabbix-3.2.6/misc/init.d/suse/9.2/zabbix_server
/usr/local/zabbix-3.2.6/sbin/zabbix_server

[root@zabbix ~]# cd /usr/local/src/zabbix-3.2.6/misc/init.d/fedora/core5/
[root@zabbix core5]# ls
zabbix_agentd zabbix_server
[root@zabbix core5]#vim zabbix_server

ZABBIX_BIN="/usr/local/zabbix-3.2.6/sbin/zabbix_server"   修改安装路径。

[root@zabbix core5]# ./zabbix_server start
正在启动 Zabbix Server: [确定]
[root@zabbix core5]# ./zabbix_server stop
停止 Zabbix Server: [确定]
[root@zabbix core5]# ./zabbix_server restart
停止 Zabbix Server: [失败]
正在启动 Zabbix Server: [确定]

为了符合常规操作习惯,做一下调整:

[root@zabbix core5]# cp zabbix_server /etc/init.d/zabbix_server
[root@zabbix core5]# ll
总用量 8
-rwxr-xr-x. 1 1000 1000 1355 5月 5 22:50 zabbix_agentd
-rwxr-xr-x. 1 1000 1000 1415 9月 27 22:39 zabbix_server
[root@zabbix core5]# cd -
/etc/init.d
[root@zabbix init.d]# ls
auditd functions ip6tables killall mysqld netfs postfix restorecond sandbox single udev-post
crond halt iptables messagebus netconsole network rdisc rsyslog saslauthd sshd zabbix_server
[root@zabbix init.d]# /etc/init.d/zabbix_server restart
停止 Zabbix Server: [确定]
正在启动 Zabbix Server: [确定]
[root@zabbix init.d]#

3)两种启动管理方式的比较

第一种启动方式每次要跟上绝对路径,感觉比较麻烦(可以尝试用软链接来启动),关闭要用pkill 来执行,如果需要重启zabbix服务,这种方式就比较繁琐

第二种是我比较喜欢的方式,每次启动关闭,重启都比较方便,调整后,也比较符合常规操作习惯。推荐~

Zabbix的启动管理方式

标签:rsyslog   restore   ast   network   postfix   两种   store   box   ddr   

原文地址:http://www.cnblogs.com/biezz/p/7770705.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!