• ZABBIX一键安装


    yum -y install wget vim tree gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp net-snmp-devel curl-devel
    service httpd start;service mysqld start;chkconfig httpd on;chkconfig mysqld on
    sed -i "s@;date.timezone =@date.timezone = Asia/Shanghai@g" /etc/php.ini
    sed -i "s@max_execution_time = 30@max_execution_time = 300@g" /etc/php.ini
    sed -i "s@post_max_size = 8M@post_max_size = 32M@g" /etc/php.ini
    sed -i "s@max_input_time = 60@max_input_time = 300@g" /etc/php.ini
    sed -i "s@memory_limit = 128M@memory_limit = 128M@g" /etc/php.ini
    sed -i "s@;mbstring.func_overload = 0@ambstring.func_overload = 2@g" /etc/php.ini
    echo "ServerName localhost:80" >>/etc/httpd/conf/httpd.conf
    /etc/init.d/httpd restart
    wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.5/zabbix-2.4.5.tar.gz
    groupadd -g 201 zabbix
    useradd -g zabbix -u 201 -s /sbin/nologin zabbix
    tar xf zabbix-2.4.5.tar.gz
    cd zabbix-2.4.5
     ./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl
     make && make install
     mysql -e "create database zabbix default charset utf8;"
     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
     mkdir /var/log/zabbix
     chown zabbix.zabbix /var/log/zabbix
     ln -s /usr/local/zabbix/etc/ /etc/zabbix
     ln -s /usr/local/zabbix/bin/* /usr/bin/
     ln -s /usr/local/zabbix/sbin/* /usr/sbin/
     cp /root/zabbix-2.4.5/misc/init.d/fedora/core/zabbix_* /etc/init.d
     chmod 755 /etc/init.d/zabbix_*
     sed -i "s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g" /etc/init.d/zabbix_server
     sed -i "s@BASEDIR=/usr/local@BASEDIR=/usr/local/zabbix@g" /etc/init.d/zabbix_agentd
     sed -i "s@DBUser=root@DBUser=zabbix@g" /etc/zabbix/zabbix_server.conf
     sed -i "s@#DBPassword=@DBPassword=zabbix@g" /etc/zabbix/zabbix_server.conf
     sed -i "s@# DBPassword=@DBPassword=zabbix@g" /etc/zabbix/zabbix_server.conf
     sed -i "s@Server=127.0.0.1@Server=127.0.0.1,192.168.3.28@g" /etc/zabbix/zabbix_agentd.conf
     sed -i "s@ServerActive=127.0.0.1@ServerActive=$IP:10051@g" /etc/zabbix/zabbix_agentd.conf
     sed -i "s@tmp/zabbix_agentd.log@var/log/zabbix/zabbix_agentd.log@g" /etc/zabbix/zabbix_agentd.conf
     sed -i "s@^# UnsafeUserParameters=0@UnsafeUserParameters=1\n@g" /etc/zabbix/zabbix_agentd.conf
     cp -r /root/zabbix-2.4.5/frontends/php/ /var/www/html/zabbix/
     chown -R apache.apache /var/www/html/zabbix/
    chkconfig zabbix_server on
    chkconfig zabbix_agentd on
    service zabbix_server restart
    service zabbix_agentd restart
    wget --limit-rate 500k http://www.fping.org/dist/fping-3.8.tar.gz
    tar zxvf fping-3.8.tar.gz && cd fping-3.8
    ./configure && make && make install
    chown root:root /usr/local/sbin/fping
    chmod u+s /usr/local/sbin/fping 
  • 相关阅读:
    堆排序
    我花了一年时间来学机器学习
    一个由进程内存布局异常引起的问题
    老曹眼中的Linux基础
    Select模型原理
    socket编程的select模型
    [插件] 如何在一个页面中使用多个SWFUpload对象上传文件
    [算法] 拖动排序
    [算法] 应用版本更新逻辑
    [oracle] 如何使用myBatis在数据库中插入数据并返回主键
  • 原文地址:https://www.cnblogs.com/Mahavairocana/p/6286634.html
Copyright © 2020-2023  润新知