server环境安装
yum install httpd php* mysql*-y
yum -y install gcc gcc-c++autoconf php-mysql httpd-manual mod_ssl mod_perl
mod_auth_mysqlphp-gd php-xml php-mbstring php-ldapphp-pear php-xmlrpc
php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysqlnet-snmp-devel curl-devel
mod_auth_mysqlphp-gd php-xml php-mbstring php-ldapphp-pear php-xmlrpc
php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysqlnet-snmp-devel curl-devel
#!/bin/bash
path=`pwd`
server()
{
wget zabbix-2.2.6.tar.gz
./configure --prefix=/usr/local/zabbix-2.2.6/ --enable-server --enable-agent
--with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2
--with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2
make && make install
useradd zabbix -s /sbin/nologin
mysql -e "create database zabbix"
mysql -e "grant all on zabbix.* to zabbix@localhost identified by 'zabbix';"
mysql -uzabbix -pzabbix zabbix < database/mysql/schema.sql
mysql -uzabbix -pzabbix zabbix < database/mysql/images.sql
mysql -uzabbix -pzabbix zabbix < database/mysql/data.sql
#制作启动脚本
cp misc/init.d/tru64/zabbix_server /etc/init.d/zabbix_server
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix_agentd
#编辑启动脚本,将DAEMON变量指向/usr/local/zabbix-2.2.5/sbin/目录下
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
cp -rp frontends/php/* /var/www/html/
}
agent()
{
./configure --prefix=/usr/local/zabbix-2.2.6/ --enable-agent
make && make install
useradd zabbix -s /sbin/nologin
mkdir /usr/local/zabbix-2.2.6/log && chown zabbix:zabbix /usr/local/zabbix-2.2.6/log
cp -f misc/etc/zabbix_agentd.conf /usr/local/zabbix-2.2.6/etc/
cp -f misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix_agentd
chmod +x /etc/init.d/zabbix_agentd
/etc/init.d/zabbix_agentd start
}
wget zabbix-2.2.6.tar.gz
tar zxvf zabbix-2.2.6.tar.gz
cd zabbix-2.2.6
case "$1" in
server)
server;;
agent)
agent;;
*)
echo $"Usage: $0 {server|agent|proxy}"
exit 1
esac
|
客户端开放zabbix端口 10050,安装完毕后去server服务器web页面添加监控信息即可