zabbix-server:192.168.1.63
zabbix-agent:192.168.1.61
服務器端:
1.yum 源
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
2. 安裝服務器端:
yum install zabbix-server-mysql zabbix-web-mysql
3. 安裝agent端
yum install zabbix-agent
4. 配置數據庫:
mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> exit
導庫
cd /usr/share/doc/zabbix-server-mysql-2.2.0/create
mysql -uroot zabbix < schema.sql
mysql -uroot zabbix < images.sql
mysql -uroot zabbix < data.sql
5. 修改zabbix文件關於數據庫的設置
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
6. 啓動zabbix服務器端
service zabbix-server start
7. 修改php的設置
vim /etc/httpd/conf.d/zabbix.conf.
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value date.timezone Asia/Shanghai 這個現在設置,後面頁面就不會報錯了。
8. 啓動http服務
service httpd restart
9. 配置agent
Server=127.0.0.1 這個ip如果寫本機的ip的話,網頁上會報錯(Received empty response from Zabbix Agent at [127.0.0.1]. Assuming that agent dropped connection)
Hostname=jboss1.com
BufferSize=1024
StartAgents=3
DebugLevel=2
PidFile=/tmp/zabbix_agentd.pid
LogFile=/tmp/zabbix_agentd.log
LogFileSize=10
EnableRemoteCommands=1
UserParameter=viewESTABLISHED,viewESTABLISHED
UserParameter=viewTIME_WAIT,viewTIME_WAIT
UserParameter=viewLISTEN,viewLISTEN
UserParameter=user.login[*],who|grep $1 &>/dev/null;echo $?
10. 啓動agent
/usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf