zabbix搭建
centos 5.9- Final+zabbix
系統環境
操作系統
centos 5.9- Final
IP地址
10.0.1.240
zabbix版本
zabbix-2.4.6
LAMP環境搭建
mysql
yum -y install mod_auth_mysql MySQL-python apr-util-mysql freeradius2-mysql libdbi-dbd-mysql mysql-bench mysql-connector-odbc64 mysql-connector-odbc mysql-test perl-DBD-MySQL php-pdo rsyslog rsyslog-mysql
chkconfig mysqld on
httpd
yum -y install mod_ssl system-config-httpd httpd httpd-manual
chkconfig httpd on
php
yum -y install php53 php53-bcmath php53-cli php53-common php53-dba php53-devel php53-gd php53-imap php53-intl php53-ldap php53-mbstring php53-mysql php53-odbc php53-pdo php53-process php53-pspell php53-snmp php53-soap php53-xml php53-xmlrpc
測試
編寫php測試腳本
vim /var/www/html/phpinfo.php
???????? <?php
??????? ???????? phpinfo();
?>
本機測試
curl http://127.0.0.1
網頁測試
http://10.0.1.240
zabbix安裝配置
zabbix安裝
tar xzf /tmp/zabbix-2.4.6.tar.gz -C /usr/src/
?
groupadd zabbix
useradd -g zabbix -s /sbin/nologin -M zabbix
?
yum -y install libxml2-devel
yum -y install net-snmp net-snmp-devel net-snmp-libs
yum -y install unixODBC unixODBC-devel
yum -y install OpenIPMI OpenIPMI-devel
yum -y install curl-devel
?
yum -y install java-1.7.0-openjdk java-1.7.0-openjdk-devel java-1.7.0-openjdk-src java-1.7.0-openjdk-javadoc
#JAVA
export JAVA_HOME=/usr/lib/jvm/java-1.7.0
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
?
cd /usr/src/zabbix-2.4.6/
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-java --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-unixodbc
make && make install
?
mysql配置
mysql
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql>? grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix_1.240';
mysql> flush privileges;
mysql> quit
?
導入zabbix數據庫
mysql -uzabbix -p zabbix < database/mysql/schema.sql
mysql -uzabbix -p zabbix < database/mysql/images.sql
mysql -uzabbix -p zabbix < database/mysql/data.sql
zabbix_server.conf配置
vim /usr/local/zabbix/etc/zabbix_server.conf
???????? DBHost=localhost
???????? DBName=zabbix
???????? DBUser=zabbix
???????? DBPassword=zabbix_1.240
php.ini配置
vim /etc/php.ini
???????? max_execution_time 300
memory_limit 128M
post_max_size 16M
upload_max_filesize 2M
max_input_time 300
???????? date.timezone Asia/Shanghai
web訪問設置
cp -r frontends/php/* /var/www/html/
http://10.0.1.240
zabbix第三方插件
zatree
下載地址
???????? https://github.com/spide4k/zatree
安裝
cd /var/www/
mv html html-bk
cp -fr /usr/src/zatree-master/zabbix-2.4.5/zatree-zabbix-2.4.5/* html/
cp html-bk/conf/zabbix.conf.php html/conf/
vim html/zatree/zabbix_config.php
???????? $zabbix_api_config=array(
???????????????? 'api_url'=>'api_jsonrpc.php',
'user'=>'Admin',
???????????????? 'password'=>'zabbix',
???????????????? 'graph_url'=>'zabbix_chart.php',
???????????????? 'http_user'=>'',
???????????????? 'http_password'=>''
);
?
vim /var/www/html/zatree/graph.php
???????? 刪除如下文字
?
vim /var/www/html/zatree/echart_zabbix.php
刪除如下文字
?
vim /var/www/html/zatree/peckvalue_zabbix.php
刪除如下文字
?
轉載于:https://www.cnblogs.com/lmgsanm/p/5368180.html
總結
- 上一篇: 关键词匹配(Ac自动机模板题)
- 下一篇: 删除已有的 HTML 元素