日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > php >内容正文

php

freebsd 手工安装zabbix2.0 php,zabbix 服务端,子客户端安装配置日志

發(fā)布時(shí)間:2024/7/19 php 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 freebsd 手工安装zabbix2.0 php,zabbix 服务端,子客户端安装配置日志 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

針對(duì)已經(jīng)有mysql nginx php 的linux環(huán)境 ,zabbix2.4.8對(duì)不同版本的mysql會(huì)報(bào)不同的錯(cuò),php也一樣。

這只是針對(duì)本人的環(huán)境下的安裝部署,mysql是5.6.4rmp安裝,php7+。

服務(wù)端#創(chuàng)建數(shù)據(jù)庫(kù)

create database zabbix character set utf8;

grant all privileges on zabbix.* to zabbix_user@'127.0.0.1' identified by '123456';

grant all privileges on zabbix.* to zabbix_user@'localhost' identified by '123456';

flush privileges;

#添加用戶

useradd -s /sbin/nologin -M zabbix

#本站blog已下載一個(gè)

wget --no-check-certificate https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.8/zabbix-2.4.8.tar.gz

tar -zxvf zabbix-2.4.8.tar.gz

cd zabbix-2.4.8

cd database

cd mysql

mysql -h 127.0.0.1 -uzabbix_user -p zabbix< schema.sql

mysql -h 127.0.0.1 -uzabbix_user -p zabbix < images.sql

mysql -h 127.0.0.1 -uzabbix_user -p zabbix < data.sql

cd ../../

yum -y install net-snmp

yum -y install net-snmp-devel

./configure --prefix=/usr/local/zabbix --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-proxy

#報(bào)錯(cuò) 僅僅以于已經(jīng)重裝rpm安裝新版mysql 5.6.45的情況

#https://www.isres.com/database/274.html

[root@zabbix-2.4.8]# find / -name libmysqlclient.a

/usr/lib64/mysql/libmysqlclient.a

cp /usr/lib64/mysql/libmysqlclient.a /usr/local/lib

#再編譯后即可進(jìn)行安裝

make && make install

#報(bào)錯(cuò) 僅僅以于已經(jīng)重裝rpm安裝新版mysql 5.6.45 mysql的情況

#undefined reference to `operator new[](unsigned long)'

rpm -ivh MySQL-shared-5.6.45-1.el6.x86_64.rpm

ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/

ln -s /usr/local/zabbix/bin/* /usr/local/bin/

cp /usr/tmp/zabbix-2.4.8/misc/init.d/fedora/core/zabbix_server /etc/rc.d/init.d/zabbix_server

chmod +x /etc/rc.d/init.d/zabbix_server

chkconfig zabbix_server on

sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/rc.d/init.d/zabbix_server

echo "zabbix-trapper 10051/tcp # Zabbix Trapper" >> /etc/services

echo "zabbix-trapper 10051/udp # Zabbix Trapper" >> /etc/services

sed -i 's/DBUser=root/DBUser=zabbix_user/g' /usr/local/zabbix/etc/zabbix_server.conf

sed -i 's/DBUser=root/DBUser=zabbix_user/g' /usr/local/zabbix/etc/zabbix_server.conf

sed -i 's/# ListenPort=10051/ListenPort=10051/g' /usr/local/zabbix/etc/zabbix_server.conf

sed -i 's/# ListenIP=0.0.0.0/ListenIP=0.0.0.0/g' /usr/local/zabbix/etc/zabbix_server.conf

#修改php.ini 逐條運(yùn)行

sed -i 's/post_max_size = 8M/post_max_size = 16M/g' /usr/local/php/etc/php.ini

sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /usr/local/php/etc/php.ini

sed -i 's/max_input_time = 60/max_input_time = 300/g' /usr/local/php/etc/php.ini

sed -i 's/\;date.timezone =/date.timezone = "Asia\/Shanghai"/g' /usr/local/php/etc/php.ini

service php-fpm restart

#僅于對(duì)使用本站一件安裝lnp腳本的情況,web目錄在/home/public_html

mkdir -p /home/public_html/zabbix

chown www:www /home/public_html/zabbix

cp -r frontends/php/* /home/public_html/zabbix/

vim /home/public_html/zabbix/include/classes/setup/CFrontendSetup.php

添加 $current = -1;

public function checkPhpAlwaysPopulateRawPostData() {

$current = ini_get('always_populate_raw_post_data');

$current = -1;

return array(

'name' => _('PHP always_populate_raw_post_data'),

'current' => ($current != -1) ? _('on') : _('off'),

'required' => _('off'),

'result' => ($current != -1) ? self::CHECK_FATAL : self::CHECK_OK,

'error' => _('PHP always_populate_raw_post_data must be set to -1.')

);

}

service zabbix_server start

cd /usr/local/nginx/conf/vhost/

cp default.conf zabbix.conf

vim zabbix.conf

server {

listen 8384;

server_name localhost;

access_log /home/public_html/zabbix/access.log;

location / {

root /home/public_html/zabbix/;

index index.php index.html index.htm;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root /usr/local/nginx/html;

}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.php$ {

root /home/public_html/zabbix/;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

location ~ /\.ht {

deny all;

}

}

chown -R www:www /home/public_html/zabbix/

service nginx restart

iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 8384 -j ACCEPT

/etc/rc.d/init.d/iptables save

service iptables restart

http://xxx.10.81.xxx:8384/ 訪問通過了

帳號(hào)admin 密碼zabbix

#登錄局部后報(bào)了A non well formed numeric value encountered [dashboard.php:140 → 原因php版本高對(duì)類型有要求

vim /home/public_html/zabbix/include/func.inc.php 換掉$val *= 1024;

function str2mem($val) {

$val = trim($val);

$last = strtolower(substr($val, -1));

switch ($last) {

case 'g':

#$val *= 1024;

$val = intval($val)*1024;

/* falls through */

case 'm':

#$val *= 1024;

$val = intval($val)*1024;

/* falls through */

case 'k':

#$val *= 1024;

$val = intval($val)*1024;

}

return $val;

}

替換監(jiān)控圖像上系統(tǒng)默認(rèn)的字體 #默認(rèn)字體不支持中文,如果不替換,圖像上會(huì)顯示亂碼

在Windows系統(tǒng)中的C:WindowsFonts目錄中復(fù)制出一個(gè)中文字體文件,例如msyh.ttf

把字體文件msyh.ttf上傳到zabbix站點(diǎn)根目錄下fonts文件夾中

例如:/usr/local/nginx/html/zabbix/fonts

備份默認(rèn)的字體文件:DejaVusSans.ttf-bak

修改msyh.ttf名稱為DejaVusSans.ttf

客戶端部署在另一臺(tái),完成后需要做iptables對(duì)服務(wù)端的開放useradd -s /sbin/nologin -M zabbix

wget https://www.isres.com/file/zabbix-2.4.8.tar.gz

tar -zxvf zabbix-2.4.8.tar.gz

cd zabbix-2.4.8

./configure --prefix=/usr/local/zabbix --with-libcurl --enable-agent

make && make install

ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/

ln -s /usr/local/zabbix/bin/* /usr/local/bin/

cp /usr/tmp/zabbix-2.4.8/misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd

chmod +x /etc/rc.d/init.d/zabbix_agentd

chkconfig zabbix_agentd on

sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/rc.d/init.d/zabbix_agentd

echo "zabbix-agent 10050/tcp # Zabbix Agent" >> /etc/services

echo "zabbix-agent 10050/tcp # Zabbix Agent" >> /etc/services

sed -i 's/# PidFile=\/tmp\/zabbix_agentd.pid/PidFile=\/tmp\/zabbix_agentd.pid/g' /usr/local/zabbix/etc/zabbix_agentd.conf

sed -i 's/Server=127.0.0.1/Server=192.168.10.55/g' /usr/local/zabbix/etc/zabbix_agentd.conf

service zabbix_agentd restart

centos6

iptables -I INPUT -s 192.168.10.55 -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT

/etc/rc.d/init.d/iptables save

service iptables restart

centos7

firewall-cmd --permanent --add-rich-rule 'rule family=ipv4 source address=192.168.10.55/32 port port=10050 protocol=tcp accept'

systemctl restart firewalld.service

非特殊說(shuō)明,本博所有文章均為博主原創(chuàng)。

最新文章

總結(jié)

以上是生活随笔為你收集整理的freebsd 手工安装zabbix2.0 php,zabbix 服务端,子客户端安装配置日志的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。