Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12608
  • 博文数量: 2
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 17
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-08 16:56
个人简介

神马都是浮云,只有实力才是真理

文章分类

全部博文(2)

文章存档

2014年(2)

我的朋友
最近访客

分类: 系统运维

2014-09-18 11:06:28


  1. yum install make gcc mysql-server mysql-devel libcurl-devel net-snmp-devel php php-gd php-xml php-mysql php-mbstring php-bcmath httpd wget lrzsz telnet lsof -y

  2. groupadd zabbix
  3. useradd zabbix -g zabbix

  4. wget -c http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.3/zabbix-2.2.3.tar.gz
  5. tar zxf zabbix-2.2.3.tar.gz
  6. cd zabbix-2.2.3
  7. ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent \
  8. --with-mysql --with-net-snmp --with-libcurl
  9. make install

  10. service mysqld start;
  11. mysql -e "create database zabbix character set utf8;"
  12. mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';flush privileges;"

  13. mysql -uroot zabbix < database/mysql/schema.sql
  14. mysql -uroot zabbix < database/mysql/images.sql
  15. mysql -uroot zabbix < database/mysql/data.sql

  16. sed -i 's/^DBUser=.*$/DBUser=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf
  17. sed -i 's/^.*DBPassword=.*$/DBPassword=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf
  18. cp -r frontends/php /var/www/html/zabbix
  19. cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
  20. sed -i 's#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g' /etc/init.d/zabbix_server
  21. sed -i 's#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g' /etc/init.d/zabbix_agentd

  22. cat >>/etc/services <<EOF
  23. zabbix-agent 10050/tcp Zabbix Agent
  24. zabbix-agent 10050/udp Zabbix Agent
  25. zabbix-trapper 10051/tcp Zabbix Trapper
  26. zabbix-trapper 10051/udp Zabbix Trapper
  27. EOF



  28. cat >>/etc/php.ini <<EOF
  29. date.timezone = Asia/Shanghai
  30. max_execution_time = 300
  31. max_input_time = 300
  32. post_max_size = 32M
  33. memory_limit = 128M
  34. mbstring.func_overload = 2
  35. EOF


  36. cat >>/etc/httpd/conf/httpd.conf <<EOF
  37. ServerName 127.0.0.1
  38. <VirtualHost *:80>
  39. DocumentRoot "/var/www/html"
  40. ServerName zabbix_server
  41. </VirtualHost>
  42. EOF


  43. cat >/var/www/html/zabbix/conf/zabbix.conf.php <<EOF
  44. <?php
  45. // Zabbix GUI configuration file
  46. global $DB;

  47. $DB['TYPE'] = 'MYSQL';
  48. $DB['SERVER'] = 'localhost';
  49. $DB['PORT'] = '0';
  50. $DB['DATABASE'] = 'zabbix';
  51. $DB['USER'] = 'zabbix';
  52. $DB['PASSWORD'] = 'zabbix';

  53. // SCHEMA is relevant only for IBM_DB2 database
  54. $DB['SCHEMA'] = '';

  55. $ZBX_SERVER = 'localhost';
  56. $ZBX_SERVER_PORT = '10051';
  57. $ZBX_SERVER_NAME = '';

  58. $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
  59. ?>
  60. EOF

  61. service iptables stop
  62. chkconfig --level 345 iptables off
  63. setenforce 0
  64. sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
  65. echo "/etc/init.d/zabbix_server start" >> /etc/rc.local
  66. echo "/etc/init.d/zabbix_agentd start" >> /etc/rc.local
  67. chkconfig --level 345 mysqld on
  68. chkconfig --level 345 httpd on


  69. /etc/init.d/zabbix_server start
  70. /etc/init.d/zabbix_agentd start
  71. /etc/init.d/httpd start

阅读(1195) | 评论(1) | 转发(0) |
0

上一篇:zabbix监控系统客户端安装

下一篇:没有了

给主人留下些什么吧!~~

lkyuang2014-09-18 11:10:50

cp -r frontends/php /var/www/html/zabbix   

拷贝的时候好像有问题,反正我是试了都不能在浏览器里面打开。装好后  我把前面拷贝的都删除了,重新拷贝了就可以在浏览器里面打开。不知道是不是自己哪里操作上是不是有问题。

还有一个地方是SELINUX 这个地方我是进 /etc/selinux/config   里面禁用的。