1. Add Zabbix and MySQL Repository rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpmrpm -ivh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpmyum clean metadatayum clean dbcacheyum makecache
2. Install MySQL rpm -e --nodeps mysql-libs-5.1.66-2.el6_3.x86_64yum install -y mysql-community-client mysql-community-common mysql-community-devel mysql-community-libs mysql-community-libs-compat mysql-community-server mysql-utilities mysql-connector-odbcchkconfig mysqld on
3. Install Apache yum install -y httpdchkconfig httpd on
4. Install PHP yum install -y php php-gd php-bcmath php-xml php-mbstring php-mysql php-common php-cli
5. Install Dependencies yum install -y OpenIPMI OpenIPMI-devel libssh2 libssh2-devel libcurl libcurl-devel net-snmp net-snmp-devel fping iksemel iksemel-devel libxml2 libxml2-devel openldap openldap-devel unixODBC unixODBC-devel
6. Download Zabbix Source cd /root/Downloadswget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.6/zabbix-2.2.6.tar.gz
7. Create User Account of Zabbix groupadd zabbix
useradd -g zabbix zabbix
8. Create Zabbix Database tar xvzf zabbix-2.2.6.tar.gzservice mysqld startcd /root/Downloads/zabbix-2.2.6/database/mysql/mysql -urootcreate database zabbix character set utf8 collate utf8_bin;grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';FLUSH PRIVILEGES;quitmysql -uroot zabbix < schema.sqlmysql -uroot zabbix < images.sqlmysql -uroot zabbix < data.sql
9. Configure Zabbix Source cd /root/Downloads/zabbix-2.2.6./configure --enable-server --enable-agent --enable-java --enable-ipv6 --with-mysql --with-jabber --with-libxml2 --with-unixodbc --with-net-snmp --with-ssh2 --with-openipmi --with-ldap --with-libcurl--with-iconv --with-iconv-include --with-iconv-lib
10. Make Install Zabbix make installNote: Running make install will by default install the daemon binaries (zabbix_server, zabbix_agentd, zabbix_proxy) in /usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in/usr/local/bin.
11. Install Zabbix Server/Agent As Service gedit /etc/init.d/zabbix-server#!/bin/sh
#
# chkconfig: - 85 15
# description: Zabbix server daemon
# config: /etc/zabbix/zabbix_server.conf
#
### BEGIN INIT INFO
# Provides: zabbix
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Start and stop Zabbix server
# Description: Zabbix server
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
if [ -x /usr/local/sbin/zabbix_server ]; then
exec=/usr/local/sbin/zabbix_server
else
exit 5
fi
prog=${exec##*/}
conf=/usr/local/etc/zabbix_server.conf
if [ -f /etc/sysconfig/zabbix-server ]; then
. /etc/sysconfig/zabbix-server
fi
lockfile=/var/lock/subsys/zabbix-server
start()
{
echo -n $"Starting Zabbix server: "
daemon $exec -c $conf
rv=$?
echo
[ $rv -eq 0 ] && touch $lockfile
return $rv
}
stop()
{
echo -n $"Shutting down Zabbix server: "
killproc $prog
rv=$?
echo
[ $rv -eq 0 ] && rm -f $lockfile
return $rv
}
restart()
{
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
force-reload)
restart
;;
status)
status $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
;;
esac
chkconfig zabbix-server onchmod 755 /etc/init.d/zabbix-server
gedit /etc/init.d/zabbix-agent#!/bin/sh
#
# chkconfig: - 86 14
# description: Zabbix agent daemon
# processname: zabbix_agentd
# config: /etc/zabbix/zabbix_agentd.conf
#
### BEGIN INIT INFO
# Provides: zabbix-agent
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start: zabbix zabbix-proxy
# Should-Stop: zabbix zabbix-proxy
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Start and stop Zabbix agent
# Description: Zabbix agent
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
if [ -x /usr/local/sbin/zabbix_agentd ]; then
exec=/usr/local/sbin/zabbix_agentd
else
exit 5
fi
prog=${exec##*/}
conf=/usr/local/etc/zabbix_agentd.conf
if [ -f /etc/sysconfig/zabbix-agent ]; then
. /etc/sysconfig/zabbix-agent
fi
lockfile=/var/lock/subsys/zabbix-agent
start()
{
echo -n $"Starting Zabbix agent: "
daemon $exec -c $conf
rv=$?
echo
[ $rv -eq 0 ] && touch $lockfile
return $rv
}
stop()
{
echo -n $"Shutting down Zabbix agent: "
killproc $prog
rv=$?
echo
[ $rv -eq 0 ] && rm -f $lockfile
return $rv
}
restart()
{
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
force-reload)
restart
;;
status)
status $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
;;
esac
chkconfig zabbix-agent onchmod 755 /etc/init.d/zabbix-agent
12. Setup Zabbix Server gedit /usr/local/etc/zabbix_server.confSetup parameters as following:
DBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbix
13. Install Zabbix Frontend mkdir /var/www/html/zabbixcp -a /root/Downloads/zabbix-2.2.6/frontends/php/* /var/www/html/zabbix/chown -R apache.apache /var/www/html/zabbix
14. Setup PHP gedit /etc/php.iniSetup parameters as following:
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Shanghai
15. Setup unixODBC ln -s /usr/lib64/libmyodbc5w.so /usr/lib64/libmyodbc5.so
gedit /etc/odbcinst.ini[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/psqlodbc.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbc.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
[MySQL ODBC 5.3 Unicode Driver]
Driver = /usr/lib64/libmyodbc5w.so
UsageCount = 1
[MySQL ODBC 5.3 ANSI Driver]
Driver = /usr/lib64/libmyodbc5a.so
UsageCount = 1
gedit /etc/odbc.ini[test]
Description = MySQL test database
Driver = MySQL
Server = 127.0.0.1
User = zabbix
Password = zabbix
Port = 3306
Database = zabbix
16. Test ODBC Configuration isql -v testThe output message are shown below:
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
16. Start Related Service service zabbix-server startservice zabbix-agent startservice httpd start
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com