Ubuntu 下 Zabbix配置与使用

1.https://www.zabbix.com/下载zabbix

2.安装apache,php,mysql,参考http://blog.csdn.net/bobui/article/details/12091433

3.创建用户,组

groupadd zabbix
useradd -g zabbix zabbix
4.创建数据库,表,数据

shell> mysql -u<username> -p<password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> quit;
shell> mysql -u<username> -p<password> zabbix < database/mysql/schema.sql
# stop here if you are creating database for Zabbix proxy
shell> mysql -u<username> -p<password> zabbix < database/mysql/images.sql
shell> mysql -u<username> -p<password> zabbix < database/mysql/data.sql

5.配置编译

When configuring the sources for a Zabbix server or proxy, you must specify the database type to be used. Only one database type can be compiled with a server or proxy process at a time.

To see all of the supported configuration options, inside the extracted Zabbix source directory run:

./configure --help

To configure the sources for a Zabbix server and agent, you may run something like:

./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl

To configure the sources for a Zabbix server (with PostgreSQL etc.), you may run:

./configure --enable-server --with-postgresql --with-net-snmp

To configure the sources for a Zabbix proxy (with SQLite etc.), you may run:

./configure --prefix=/usr --enable-proxy --with-net-snmp --with-sqlite3 --with-ssh2

To configure the sources for a Zabbix agent, you may run:

./configure --enable-agent

你可能遇到以下几个问题

安装zabbix时遇到问题的解决方法

安装zabbix进行configure时会遇到以下4个主要问题

./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-jabber --with-libcurl

1 configure: error: MySQL library not found the problem is not installed mysql-devel #apt-get install  libghc6-hsql-mysql-dev (ubuntu )

2 configure: error: Jabber library not found the problem is not installed jabber lib #apt-get install libphp-jabber #apt-get install libnet-jabber-loudmouth-perl #apt-get install jabber-dev #apt-get install libiksemel-dev  (* this packet important)

3 configure: error: Not found curl Library the problem is not installed libcurl4-openssl-dev #apt-get install libcurl4-openssl-dev

4 configure: error : Not found NET-SNMP library #apt-get install libsnmp-dev #apt-get install snmp

遇到以上问题时,你安装时可能又面临其他库冲突的问题(ubuntu13.4) 注意,把冲突的库版本降低就可以

6.

make install


7.服务端口定义

/etc/sevices增加

# Local services
zabbix-agent 10050/tcp #Zabbix Agent
zabbix-agent 10050/udp #Zabbix Agent
zabbix-trapper 10051/tcp #ZabbixTrapper
zabbix-trapper 10051/udp #Zabbix Trapper

8.修改配置文件


  • edit the Zabbix agent configuration file /usr/local/etc/zabbix_agentd.conf

You need to configure this file for every host with zabbix_agentd installed.

You must specify the Zabbix server IP address in the file. Connections from other hosts will be denied.

  • edit the Zabbix server configuration file /usr/local/etc/zabbix_server.conf

You must specify the database name, user and password (if using any).

With SQLite the full path to database file must be specified; DB user and password are not required.

The rest of the parameters will suit you with their defaults if you have a small installation (up to ten monitored hosts). You should change the default parameters if you want to maximize the performance of Zabbix server (or proxy) though. See the [Performance tuning] section for more details.

  • if you have installed a Zabbix proxy, edit the proxy configuration file /usr/local/etc/zabbix_proxy.conf

You must specify the server IP address and proxy hostname (must be known to the server), as well as the database name, user and password (if using any).

With SQLite the full path to database file must be specified; DB user and password are not required.


9.启动$ zabbix_server 

可能遇到错误:
zabbix_server: /usr/local/lib/libcurl.so.4: no version information available (required by zabbix_server)

解决方案

sudo ln -fs /usr/local/lib/libcurl.so.4 /usr/local/lib/

10.把PHP文件拷贝到apache下面

mkdir <htdocs>/zabbix
cd frontends/php
cp -a . <htdocs>/zabbix
<htdocs>为web服务器的文件主目录


11.安装php监控

http://localhost/zabbix/

安装好之后默认用户名:Admin密码:zabbix


祝贺你,成功安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值