安裝 zabbix server 4.4 - 初體驗

https://cloud.tencent.com/developer/article/1552272

ZABBIX SERVER

安装软件包
yum install epel-release -y
yum install git -y 
yum install wget git -y 
yum install tcpdump wget git -y 
yum install htop -y 
yum install net-snmp-utils -y 
yum install tree -y 
yum install net-tools -y 
yum install traceroute  -y 
yum install sysstat -y 




timescale db 部署
https://docs.timescale.com/latest/getting-started/installation
https://wiki.postgresql.org/wiki/YUM_Installation




yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm  -y
yum list postgresql*
yum install postgresql11-server -y
ls -la /var/lib/pgsql/11/data
/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl enable postgresql-11 
systemctl start postgresql-11


Add TimescaleDB's third party repository 

tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/7/\$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL


yum update -y
yum install timescaledb-postgresql-11 -y 

vi /etc/profile
export PATH=${PATH}:/usr/pgsql-11/bin
systemctl  restart  postgresql-11

su - postgres

alter user postgres WITH PASSWORD 'thank2you';

as root
vi /var/lib/pgsql/11/data/postgresql.conf
listen_addresses = '*'
port = 5432 
  
vi /var/lib/pgsql/11/data/pg_hba.conf
host    all             all             0.0.0.0/0               md5

systemctl stop postgresql-11
systemctl start postgresql-11

----------------------------------------------------------
su - postgres
psql
create user zabbix with password 'thank2you';
create database zabbix owner zabbix;
grant all privileges on database zabbix to zabbix;

数据库创建
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE
\q



注意:ZABBIX Server支持TimescaleDB,Zabbix Proxy不支持TimescaleDB。


### client 

yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm  -y
yum list postgresql*
yum install postgresql11 -y

psql -d zabbix -U zabbix -h 192.168.11.233
\q


配置ZABBIX官方yum数据源(zabbix 4.4 集成nginx rpm 包)

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm

yum install zabbix-nginx-conf.noarch -y
yum install nginx php  php-fpm  php-mysql -y

systemctl  stop nginx 
systemctl  start nginx 
systemctl enable nginx


为了使Zabbix前端正常工作,必须取消注释和设置listen和server_name指令
vi /etc/nginx/conf.d/zabbix.conf
systemctl  stop nginx 
systemctl  start nginx 
systemctl start php-fpm 
systemctl enable  php-fpm

vi /etc/nginx/nginx.conf

        # listen       80 default_server;
        # listen       [::]:80 default_server;
        listen       8080 default_server;
        listen       [::]:8080 default_server;
        
systemctl  restart  nginx 

netstat  -auntlp |grep -w 80

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum install zabbix-server-pgsql zabbix-web-pgsql -y
yum install zabbix-get -y

egrep -v "*#|^$" /etc/zabbix/zabbix_server.conf |grep DB
DBHost=192.168.99.221
DBName=zabbix
DBUser=zabbix
DBPassword=zabbixpwd123
DBPort=5432

systemctl start zabbix-server 
systemctl enable zabbix-server


psql --help
zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz       | psql -d zabbix -U zabbix -h 192.168.11.233
zcat /usr/share/doc/zabbix-server-pgsql*/timescaledb.sql.gz  | psql -d zabbix -U zabbix -h 192.168.11.233

vi /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai

systemctl stop zabbix-server 
systemctl start zabbix-server 
systemctl restart php-fpm

vim /etc/selinux/config
SELINUX=disabled
setenforce 0
reboot


tail -100f /var/log/zabbix/zabbix_server.log


===================
zabbix忘记admin登录密码重置密码 

psql -d zabbix -U zabbix -h 192.168.11.233
thank2you

select userid,alias,passwd from users;

echo -n  admin  | openssl md5
(stdin)= 21232f297a57a5a743894a0e4a801fc3

update users set  passwd='21232f297a57a5a743894a0e4a801fc3' where userid = '1';




https://cloud.tencent.com/developer/article/1552272
http://www.hmjblog.com/network/7011.html
https://blog.csdn.net/qq_40907977/article/details/103329970
https://blog.51cto.com/12328206/2428106









最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 第一次全程戴著口罩,舉行招聘的海選會。原本關注「人臉」就得耗費心神的招聘,加上了2/3的覆蓋面積,只能從「眼睛」挖...
    如識我聞阅读 274评论 0 2
  • 今天分享一下在台灣醫院做全身體檢的體驗。體檢內容涵蓋基礎的全身體檢(血常規、尿常規、身高體重體脂肪、胸透、關鍵部位...
    罗安妮annie阅读 803评论 1 1
  • 人總要記錄一下生活的,在有幸過上生活的時候,畢竟大部分時間都在為生存而奮鬥。 入行四年第一次出差,居然如此休閑。慢...
    卓明杰Alan阅读 224评论 0 0
  • 参加香港臨床心理學家、註冊藝術治療師、心理創傷專家及培訓師、澳洲創造性藝術治療協會(ACATA)亞洲區代表黃曉紅博...
    秋韵无声阅读 2,393评论 0 2
  • 肉體到意志肌肉到精神;汗水流進心臟呼吸融入靈魂;感受舒暢与堅韌。
    JoJoJoJoey阅读 277评论 0 0