网站建设资讯

NEWS

网站建设资讯

Zabbix安装配置

环境centos: nginx + php 5.3以上 + mysql

成都创新互联是一家集网站建设,南山企业网站建设,南山品牌网站建设,网站定制,南山网站建设报价,网络营销,网络优化,南山网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。

环境就不安装了, LNMP是非常简单的事情, php注意添加--with-freetype-dir=/usr/include/freetype2/和--with-gettext

1, 安装Zabbix依赖包

[root@Zabbix~]#yuminstallnet-snmpnet-snmp-develcurlcurl-develperl-DBI [root@Zabbix~]#groupaddzabbix [root@Zabbix~]#useradd-gzabbix-s/sbin/nologinzabbix [root@Zabbix~]#wgethttp://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.0.5/zabbix-2.0.5.tar.gz [root@Zabbix~]#tarzxvfzabbix-2.0.5.tar.gz&&cdzabbix-2.0.5

2,创建数据库

mysql>createdatabasezabbixcharactersetutf8; mysql>grantallonzabbix.*tozabbix@localhostidentifiedby\'password\'; mysql>flushprivileges;

3,导入数据库

[root@Zabbixzabbix-2.0.5]#mysql-hlocahost-uroot-pzabbix

4, 编译安装

[root@Zabbixzabbix-2.0.5]#./configure--prefix=/usr/local/zabbix--enable-server--enable-proxy--enable-agent--with-mysql=/usr/local/mysql/bin/mysql_config--with-net-snmp--with-libcurl make&&makeinstall

5,修改 zabbix server 配置文件

[root@Zabbixzabbix]#cd/usr/local/zabbix/ [root@Zabbixzabbix]#vi./etc/zabbix_server.conf ListenPort=10051 SourceIP=192.168.199.105 LogFile=/tmp/zabbix_server.log DBHost=192.168.199.105 DBName=Zabbix DBUser=root DBPassword=123456 DBPort=3306

6,安装启动脚本,添加可执行权限

注意,在源码目录cp cpmisc/init.d/fedora/core/zabbix_*/etc/init.d/ sed-i\'s#/usr/local/sbin#/usr/local/zabbix/sbin#g\'/etc/init.d/zabbix_server sed-i\'s#/usr/local/sbin#/usr/local/zabbix/sbin#g\'/etc/init.d/zabbix_agentd chmod+x/etc/init.d/zabbix_server chmod+x/etc/init.d/zabbix_agentd

7, 启动Zabbix服务

/etc/init.d/zabbix-serverstart /etc/init.d/zabbix-agentstart netstat-npl|grepzabbix tcp000.0.0.0:100500.0.0.0:*LISTEN32238/zabbix_agentd tcp000.0.0.0:100510.0.0.0:*LISTEN32168/zabbix_server

8,web安装,复制网站文件到web目录

mkdir/web/zabbix cp-pafrontends/php/*/web/zabbix

9, 添加nginx虚拟主机

server{ listen80; server_name192.168.199.105; location/{ root/web/zabbix; indexindex.phpindex.htmlindex.htm; if(-f$request_filename){ expires5d; break; } if(!-e$request_filename){ rewrite^(.+)$/index.phplast; } location~.php${ fastcgi_pass127.0.0.1:9000; fastcgi_indexindex.php; fastcgi_paramSCRIPT_NAME$fastcgi_script_name; fastcgi_paramSCRIPT_FILENAME/web/zabbix$fastcgi_script_name; includefastcgi_params; if($fastcgi_script_name~..*/.*php){ return403; } } } }

10, 在游览器直接访问ip及可访问,默认用户admin/zabbix

11, 客户端安装

groupaddzabbix useradd-gzabbixzabbix tarzxvfzabbix-2.0.4.tar.gz cdzabbix-2.0.4/ ./configure--prefix=/usr/local/zabbix--enable-agent make makeinstall cpmisc/init.d/fedora/core/zabbix_agentd/etc/init.d/ sed-i\'s#/usr/local/sbin#/usr/local/zabbix/sbin#g\'/etc/init.d/zabbix_agentd chmod+x/etc/init.d/zabbix_agentd

12, 配置文件zabbix_agentd.conf

LogFile=/tmp/zabbix_agentd.log EnableRemoteCommands=1 LogRemoteCommands=1 Server=192.168.199.105 ListenPort=10050 ListenIP=0.0.0.0 StartAgents=3 ServerActive=192.168.199.105 Hostname=zabbix-client01 RefreshActiveChecks=60 BufferSend=60 AllowRoot=0 Timeout=3


分享标题:Zabbix安装配置
网页地址:http://cdweb.net/article/cjigjs.html