当前位置: 首页 > news >正文

宁波建设网站公众号关注新建wordpress模板

宁波建设网站公众号关注,新建wordpress模板,近五年网站开发参考文献,wordpress怎么关闭网站目录 1、rpm安装zabbix_agentd服务 2、编写zabbix_agentd.conf文件 3、编写模板文件 4、创建mysql用户并赋权限 5、创建.my.cnf文件 6、将规则添加到SELinux策略中 注意: 若模板无法读取.my.cnf 信息,从而导致监控报错,可以尝试修改模…

目录

1、rpm安装zabbix_agentd服务

2、编写zabbix_agentd.conf文件

3、编写模板文件

4、创建mysql用户并赋权限

5、创建.my.cnf文件

6、将规则添加到SELinux策略中

注意:

若模板无法读取.my.cnf 信息,从而导致监控报错,可以尝试修改模板配置配置文件:


1、rpm安装zabbix_agentd服务

​
rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/7/x86_64/zabbix-release-6.4-1.el7.noarch.rpm
yum clean all# b. Install Zabbix agent
yum install zabbix-agent
# c. Start Zabbix agent process
# Start Zabbix agent process and make it start at system boot.sudo systemctl stop zabbix-agent
systemctl restart zabbix-agent
systemctl enable zabbix-agent

2、编写zabbix_agentd.conf文件

cd /etc/zabbix
vim zabbix_agentd.confPidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd_1.log
LogFileSize=0
Server=192.168.3.246
ServerActive=192.168.3.246
Hostname=192.168.3.244
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UnsafeUserParameters=1

3、编写模板文件

​
vim /etc/zabbix/zabbix_agentd.d/template_db_mysql.conf#template_db_mysql.conf created by Zabbix for "Template DB MySQL" and Zabbix 4.2
#For OS Linux: You need create .my.cnf in zabbix-agent home directory (/var/lib/zabbix by default) 
#For OS Windows: You need add PATH to mysql and mysqladmin and create my.cnf in %WINDIR%\my.cnf,C:\my.cnf,BASEDIR\my.cnf https://dev.mysql.com/doc/refman/5.7/en/option-files.html
#The file must have three strings:
#[client]
#user='zbx_monitor'
#password='<password>'
#
UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping
UserParameter=mysql.get_status_variables[*], mysql -h"$1" -P"$2" -sNX -e "show global status"
UserParameter=mysql.version[*], mysqladmin -s -h"$1" -P"$2" version
UserParameter=mysql.db.discovery[*], mysql -h"$1" -P"$2" -sN -e "show databases"
UserParameter=mysql.dbsize[*], mysql -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'"
UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
UserParameter=mysql.slave_status[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"​

4、创建mysql用户并赋权限

CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '123456';
GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';

5、创建.my.cnf文件

mkdir -p /var/lib/zabbix
vim /var/lib/zabbix/.my.cnf[client]
user='zbx_monitor'
password='123456'

6、将规则添加到SELinux策略中

systemctl edit zabbix-agent.service# cat <<EOF > zabbix_home.te
module zabbix_home 1.0;require {type zabbix_agent_t;type zabbix_var_lib_t;type mysqld_etc_t;type mysqld_port_t;type mysqld_var_run_t;class file { open read };class tcp_socket name_connect;class sock_file write;
}#============= zabbix_agent_t ==============allow zabbix_agent_t zabbix_var_lib_t:file read;
allow zabbix_agent_t zabbix_var_lib_t:file open;
allow zabbix_agent_t mysqld_etc_t:file read;
allow zabbix_agent_t mysqld_port_t:tcp_socket name_connect;
allow zabbix_agent_t mysqld_var_run_t:sock_file write;
EOF
# checkmodule -M -m -o zabbix_home.mod zabbix_home.te
# semodule_package -o zabbix_home.pp -m zabbix_home.mod
# semodule -i zabbix_home.pp
# restorecon -R /var/lib/zabbix

注意:

若模板无法读取.my.cnf 信息,从而导致监控报错,可以尝试修改模板配置配置文件:

#template_db_mysql.conf created by Zabbix for "Template DB MySQL" and Zabbix 4.2
#For OS Linux: You need create .my.cnf in zabbix-agent home directory (/var/lib/zabbix by default) 
#For OS Windows: You need add PATH to mysql and mysqladmin and create my.cnf in %WINDIR%\\my.cnf,C:\\my.cnf,BASEDIR\\my.cnf <https://dev.mysql.com/doc/refman/5.7/en/option-files.html>
#The file must have three strings:
#[client]
#user='zbx_monitor'
#password='<password>'
#
UserParameter=mysql.ping[*], mysqladmin --defaults-extra-file='/var/lib/zabbix/.my.cnf' -h"$1" -P"$2" ping
UserParameter=mysql.get_status_variables[*], mysql --defaults-extra-file='/var/lib/zabbix/.my.cnf' -h"$1" -P"$2" -sNX -e "show global status"
UserParameter=mysql.version[*], mysqladmin --defaults-extra-file='/var/lib/zabbix/.my.cnf' -h"$1" -P"$2" version
UserParameter=mysql.db.discovery[*], mysql --defaults-extra-file='/var/lib/zabbix/.my.cnf' -h"$1" -P"$2" -sN -e "show databases"
UserParameter=mysql.dbsize[*], mysql --defaults-extra-file='/var/lib/zabbix/.my.cnf' -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'"
UserParameter=mysql.replication.discovery[*], mysql --defaults-extra-file='/var/lib/zabbix/.my.cnf' -h"$1" -P"$2" -sNX -e "show slave status"
UserParameter=mysql.slave_status[*], mysql --defaults-extra-file='/var/lib/zabbix/.my.cnf' -h"$1" -P"$2" -sNX -e "show slave status"

http://www.yayakq.cn/news/997640/

相关文章:

  • 值得买网站模板免费发布信息网站大全
  • 大连网站建设仟亿科技婚纱摄影网站策划书
  • 沈阳做网站有名公司揭阳百度推广优化
  • 沈阳seo网站推广网站设计师薪资
  • 做资料分享网站无锡装修公司做网站
  • 网站 稳定性购物商城网站建设公司
  • 免费完整版的网站模板图片外链工具
  • 哪里找做网站的wordpress saharan
  • 手机上自己如何做网站上海广告公司电话
  • 山东网站策划怎么做网络舆情参考
  • 做cpa用单页网站好还是昆明网站的建设
  • 哪个网站推荐做挖机事的9元包邮网站怎么做
  • 长春住房和城乡建设部官方网站app营销策略模板
  • 如何使用微信公众号做网站ae免费模板网站
  • 保山网站建设报价百度景安空间网站
  • 石家庄网站定制模板建站wordpress上传数据
  • 网站建设人员工资山东网站建设费用
  • 我对网站开发的反思网页设计与制作项目教程答案
  • 四川和住房城乡建设厅网站首页下载关键词推广软件
  • 百度网盘做存储网站网络营销推广目的
  • 云南建个网站哪家便宜wordpress微信公众平台开发
  • 衣服商业网站建设策划书tp做网站
  • 做外贸没有网站可以吗id怎样转wordpress
  • 国际物流网站建设各大网站的网址
  • 最新电子产品网站模板朝阳住房和城乡建设厅网站
  • 网站建设分解结构网站开发规划
  • 做阿里巴巴好还是网站好原创文字的网站
  • app和网站开发区别移动端数据可视化
  • 福州哪家网站制作设计高端还实惠画册设计公司网站
  • 成都网站建设门户做自己的网站流量怎么