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

Cento7 Docker安装Zabbix,定制自定义模板

1.先安装docker环境

yum -y install  yum-utils device-mapper-persistent-data lvm2#导入docker安装库
yum-config-manager \--add-repo \https://download.docker.com/linux/centos/docker-ce.repo
#按指定版本安装好docker
yum install docker-ce-20.10.5 docker-ce-cli-20.10.5 docker-ce-rootless-extras-20.10.5 -ysystemctl restart docker.service

2.安装zabbix

拉取相关镜像
docker pull mysql:8.0.28
docker pull zabbix/zabbix-server-mysql:alpine-6.0.6
docker pull zabbix/zabbix-web-nginx-mysql:alpine-6.0.6
docker pull zabbix/zabbix-agent2
docker pull zabbix/zabbix-snmptraps:alpine-6.0.6
建立一个docker网络
docker network create --subnet 172.17.0.0/16 --ip-range 172.17.200.0/24 zabbix-netdocker rm $(docker container ls -aq)docker run --name zabbix-mysql -t -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="zabbix" -e MYSQL_ROOT_PASSWORD="root123" -e TZ="Asia/Shanghai" -e ZBX_DBTLSCONNECT="required" --network=zabbix-net --ip=172.17.201.1 --restart=always --privileged=true -d mysql:8.0.28docker run --name zabbix-server-mysql -v /usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts -t -e DB_SERVER_HOST="zabbix-mysql" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="zabbix" -e MYSQL_ROOT_PASSWORD="root123" -e TZ="Asia/Shanghai" --network=zabbix-net --ip=172.17.201.3 -p 10051:10051 --restart=always --privileged=true -d zabbix/zabbix-server-mysql:alpine-6.0.6docker run --name zabbix-web-nginx-mysql -t -e ZBX_SERVER_HOST="zabbix-server-mysql" -e DB_SERVER_HOST="zabbix-mysql" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="zabbix" -e MYSQL_ROOT_PASSWORD="root123" -e TZ="Asia/Shanghai" -e PHP_TZ="Asia/shanghai" --network=zabbix-net --ip=172.17.201.4 -p 8081:8080 --restart=always --privileged=true -d zabbix/zabbix-web-nginx-mysql:alpine-6.0.6docker run --name zabbix-agent-2 -e ZBX_SERVER_HOST="zabbix-server-mysql" -e ZBX_HOSTNAME="Zabbix server" -e TZ="Asia/Shanghai" --network=zabbix-net --ip=172.17.201.5 -p 10050:10050 --restart=always --privileged=true -d zabbix/zabbix-agent2docker run --name zabbix-snmptraps -e ZBX_SERVER_HOST="zabbix-server-mysql" -e ZBX_HOSTNAME="Zabbix server" -e TZ="Asia/Shanghai" --network=zabbix-net --ip=172.17.201.15 -p 161:161 --restart=always --privileged=true -d zabbix/zabbix-snmptraps:alpine-6.0.6

在这里插入图片描述
这样整个zabbix就运行起来了,然后通过ip访问8081端口。默认用户名:Admin 密码:zabbix
在这里插入图片描述
在这里插入图片描述
通过下面的设置,设置zabbix为中文
在这里插入图片描述
设置完成之后,开始配置需要监控的客户机,在客户机上安装zabbix-agent。

Centos的安装

yum -y install zabbix6.0-agentsystemctl restart zabbix-agent
systemctl enable zabbix-agent

Ubuntu的安装

apt install zabbix-agent
systemctl start zabbix-agent.service###查看状态
systemctl status zabbix-agent.service###重新启动服务
systemctl restart zabbix-agent.service###设置成开机自启动
systemctl enable zabbix-agent.service

修改agent的配置,增加如下选项
vi /etc/zabbix_agentd.conf

Server=192.168.124.141              //zabbixserver
ServerActive=192.168.124.141        //zabbixserver
Hostname=192.168.124.132_LintongCloudServer            //这个Hostname要与zabbix server上的hostname一致。

然后配置zabbix server web服务端主机配置,如下:
在这里插入图片描述
配置好后,在zabbix web端会这样显示。
在这里插入图片描述
由于zabbix没有监控Tcp的连接状态,这里需要我们自己用shell来实现这些,并且通过自己的自定义模板导入到zabbix

登录需要监控的客户机运行以下命令,用以下脚本安装tcp数据的监控,因为我已经做成了自动化安装脚本,所以脚本的内容如下:

mkdir -p /usr/local/zabbix-agent/scripts/
mkdir -p /etc/zabbix/zabbix_agentd.d/is_ubuntu=`cat /proc/version  | grep "Ubuntu" -c`
if [ $is_ubuntu -ge "1" ] ; thenecho "Ubuntu System"isExist=$(grep "^#" /etc/zabbix/zabbix_agentd.conf -v | grep UnsafeUserParameters -c ) && test -n "$isExist" || echo "UnsafeUserParameters=1" >> /etc/zabbix/zabbix_agentd.confisExist=$(grep "^#" /etc/zabbix/zabbix_agentd.conf -v | grep Include -c ) && test -n "$isExist" || echo "Include=/etc/zabbix/zabbix_agentd.d/*.conf" >> /etc/zabbix/zabbix_agentd.confecho "UserParameter=tcp.status[*],/usr/local/zabbix-agent/scripts/tcp_conn_status.sh \$1" > /etc/zabbix/zabbix_agentd.conf.d/tcp-status-params.conf
elseecho "Not Ubuntu System"isExist=$(grep "^#" /etc/zabbix_agentd.conf -v | grep UnsafeUserParameters -c ) && test -n "$isExist" || echo "UnsafeUserParameters=1" >> /etc/zabbix_agentd.confisExist=$(grep "^#" /etc/zabbix_agentd.conf -v | grep Include -c ) && test -n "$isExist" || echo "Include=/etc/zabbix/zabbix_agentd.d/*.conf" >> /etc/zabbix_agentd.confecho "UserParameter=tcp.status[*],/usr/local/zabbix-agent/scripts/tcp_conn_status.sh \$1" > /etc/zabbix/zabbix_agentd.d/tcp-status-params.conf
ficurl -u "test:test123" -O  http://10.10.52.134:88/wxmessage/tcp_conn_status.sh ; mv tcp_conn_status.sh /usr/local/zabbix-agent/scripts/
chmod 711 /usr/local/zabbix-agent/scripts/tcp_conn_status.sh
chown zabbix:zabbix /usr/local/zabbix-agent/scripts/tcp_conn_status.sh/usr/local/zabbix-agent/scripts/tcp_conn_status.sh listenservice zabbix-agent restartzabbix_agentd -t tcp.status[listen]

执行成功后,会出现zabbix_agentd执行的结果
在这里插入图片描述
这里还有一个执行被监控机器的tcp状态的shell脚本,内容如下:

#!/bin/bash
#this script is used to get tcp and udp connetion status
#tcp status
source /etc/profile
metric=$1
tmp_file=/tmp/tcp_status.txt
ss -an | grep "^tcp" |  awk '{print $2}' | sort | uniq -c | awk '{print $2" "$1}' > $tmp_filecase $metric inclosed)output=$(awk '/CLOSED/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;listen)output=$(awk '/LISTEN/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;synrecv)output=$(awk '/SYN-RECV/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;synsent)output=$(awk '/SYN-SENT/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;established)output=$(awk '/ESTAB/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;timewait)output=$(awk '/TIME-WAIT/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;closing)output=$(awk '/CLOSING/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;closewait)output=$(awk '/CLOSE-WAIT/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;lastack)output=$(awk '/LAST-ACK/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;finwait1)output=$(awk '/FIN-WAIT-1/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;finwait2)output=$(awk '/FIN-WAIT-2/{print $2}' $tmp_file)if [ "$output" == "" ];thenecho 0elseecho $outputfi;;*)echo -e "\e[033mUsage: sh  $0 [closed|closing|closewait|synrecv|synsent|finwait1|finwait2|listen|established|lastack|timewait]\e[0m"esac

如果被监控客户端机器已经把脚本都安装完整,然后我们在zabbix server的web端添加模板。模板是一个xml文件,内容如下。

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export><version>2.0</version><date>2023-09-20T09:41:57Z</date><groups><group><name>Templates</name></group></groups><templates><template><template>Template TCP Connection Status</template><name>Template TCP Connection Status</name><groups><group><name>Templates</name></group></groups><applications><application><name>TCP Status</name></application></applications><items><item><name>CLOSED</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[closed]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>CLOSE_WAIT</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[closewait]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>CLOSING</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[closing]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>ESTABLISHED</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[established]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>FIN_WAIT1</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[finwait1]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>FIN_WAIT2</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[finwait2]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>LAST_ACK</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[lastack]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>LISTEN</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[listen]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>SYN_RECV</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[synrecv]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>SYN_SENT</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[synsent]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item><item><name>TIME_WAIT</name><type>0</type><snmp_community/><multiplier>0</multiplier><snmp_oid/><key>tcp.status[timewait]</key><delay>60</delay><history>90</history><trends>365</trends><status>0</status><value_type>3</value_type><allowed_hosts/><units/><delta>0</delta><snmpv3_contextname/><snmpv3_securityname/><snmpv3_securitylevel>0</snmpv3_securitylevel><snmpv3_authprotocol>0</snmpv3_authprotocol><snmpv3_authpassphrase/><snmpv3_privprotocol>0</snmpv3_privprotocol><snmpv3_privpassphrase/><formula>1</formula><delay_flex/><params/><ipmi_sensor/><data_type>0</data_type><authtype>0</authtype><username/><password/><publickey/><privatekey/><port/><description/><inventory_link>0</inventory_link><applications><application><name>TCP Status</name></application></applications><valuemap/></item></items><discovery_rules/><macros/><templates/><screens/></template></templates><triggers><trigger><expression>{Template TCP Connection Status:tcp.status[timewait].last()}>3000</expression><name>There are too many TCP TIME_WAIT status</name><url/><status>0</status><priority>4</priority><description/><type>0</type><dependencies/></trigger></triggers><graphs><graph><name>TCP Status</name><width>900</width><height>200</height><yaxismin>0.0000</yaxismin><yaxismax>100.0000</yaxismax><show_work_period>1</show_work_period><show_triggers>1</show_triggers><type>0</type><show_legend>1</show_legend><show_3d>0</show_3d><percent_left>0.0000</percent_left><percent_right>0.0000</percent_right><ymin_type_1>0</ymin_type_1><ymax_type_1>0</ymax_type_1><ymin_item_1>0</ymin_item_1><ymax_item_1>0</ymax_item_1><graph_items><graph_item><sortorder>0</sortorder><drawtype>0</drawtype><color>C80000</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[closed]</key></item></graph_item><graph_item><sortorder>1</sortorder><drawtype>0</drawtype><color>00C800</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[closewait]</key></item></graph_item><graph_item><sortorder>2</sortorder><drawtype>0</drawtype><color>0000C8</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[closing]</key></item></graph_item><graph_item><sortorder>3</sortorder><drawtype>0</drawtype><color>C800C8</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[established]</key></item></graph_item><graph_item><sortorder>4</sortorder><drawtype>0</drawtype><color>00C8C8</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[finwait1]</key></item></graph_item><graph_item><sortorder>5</sortorder><drawtype>0</drawtype><color>C8C800</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[finwait2]</key></item></graph_item><graph_item><sortorder>6</sortorder><drawtype>0</drawtype><color>C8C8C8</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[lastack]</key></item></graph_item><graph_item><sortorder>7</sortorder><drawtype>0</drawtype><color>960000</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[listen]</key></item></graph_item><graph_item><sortorder>8</sortorder><drawtype>0</drawtype><color>009600</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[synrecv]</key></item></graph_item><graph_item><sortorder>9</sortorder><drawtype>0</drawtype><color>000096</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[synsent]</key></item></graph_item><graph_item><sortorder>10</sortorder><drawtype>0</drawtype><color>960096</color><yaxisside>0</yaxisside><calc_fnc>2</calc_fnc><type>0</type><item><host>Template TCP Connection Status</host><key>tcp.status[timewait]</key></item></graph_item></graph_items></graph></graphs>
</zabbix_export>

在这里插入图片描述
添加模板成功后,主机开始绑定这个模板。
在这里插入图片描述
然后监视的主机里面就可以看到数据了。
在这里插入图片描述

相关文章:

Cento7 Docker安装Zabbix,定制自定义模板

1.先安装docker环境 yum -y install yum-utils device-mapper-persistent-data lvm2#导入docker安装库 yum-config-manager \--add-repo \https://download.docker.com/linux/centos/docker-ce.repo #按指定版本安装好docker yum install docker-ce-20.10.5 docker-ce-cli-20…...

网络防御--防火墙

拓扑 Cloud 1 作为电脑与ENSP的桥梁 防火墙配置 登录防火墙 配置IP地址及安全区域 添加地址对象 配置策略 1、内网可以访问服务器 结果 2、内网可以访问公网 结果 配置NAT策略 结果...

淘宝商品详情数据采集

淘宝商品详情数据采集的方法如下&#xff1a; 确定采集目标&#xff1a;明确要采集的商品信息&#xff0c;如商品标题、价格、销量、评论、图片等。选择采集工具&#xff1a;可以选择Scrapy框架、Java的WebMagic框架等。编写爬虫程序&#xff1a;进入目标文件夹&#xff0c;输…...

mac安装virtualenv和virtualenvwrapper

1.安装(推荐用sudo安装&#xff0c;直接pip3安装会有坑) sudo pip3 install virtualenv sudo pip3 install virtualenvwrapper 2.查看python virtualenvwrapper.sh 位置 # 查看python默认解释器 which python3 # 查看virtualenvwrapper.sh which virtualenvwrapper.sh 3.打…...

利用PCA科学确定各个指标的权重系数

背景参考: 1、提取主成分 对样本进行PCA分析,查看不同变量贡献率,确定主要的指标。我们可以通过下列代码获取需要的所有数据: import numpy as np from sklearn.decomposition import PCA# 创建一个数据 np.random.seed(0) data = np.random.random((100,5)) y = np.ra…...

代码随想录 -- day55 --392.判断子序列 、115.不同的子序列

392.判断子序列 dp[i][j] 表示以下标i-1为结尾的字符串s&#xff0c;和以下标j-1为结尾的字符串t&#xff0c;相同子序列的长度为dp[i][j]。 if (s[i - 1] t[j - 1]) t中找到了一个字符在s中也出现了if (s[i - 1] ! t[j - 1]) 相当于t要删除元素&#xff0c;继续匹配 if (s…...

mysql5升级到mysql8的血泪教训

核心问题1:下载中断这个包就会有问题&#xff0c;下载中断的话一定要重新下载 核心问题2:低版本向高版本迁移 无法整库备份 只能单库备份 1.数据备份 我这里备份了全库&#xff0c;所以后面数据没恢复回来&#xff0c;把DDL语句拆出来了单独建表 mysqldump -u root -p --al…...

Unity 开发人员转CGE(castle Game engine)城堡游戏引擎指导手册

Unity 开发人员的城堡游戏引擎概述 一、简介2. Unity相当于什么GameObject&#xff1f;3. 如何设计一个由多种资产、生物等组成的关卡&#xff1f;4. 在哪里放置特定角色的代码&#xff08;例如生物、物品&#xff09;&#xff1f;Unity 中“向 GameObject 添加 MonoBehaviour”…...

卷运维不如卷网络安全

最近发现很多从事运维的选择了辞职&#xff0c;重新规划自己的职业发展方向。运维工程师这个岗位在IT行业里面确实是处于最底层的&#xff0c;不管什么环节出现问题&#xff0c;基本都是运维背锅。背锅也就罢了&#xff0c;薪资水平也比不上别的岗位。 一般运维的薪资水平大多数…...

Digger PRO - Voxel enhanced terrains

资源链接在文末 Digger PRO​​​ 是一个简单但强大的工具,可以直接从 Unity 编辑器或游戏中创建天然洞穴和悬岩。会让你感觉自己手中握有一个体素地形,且毫无瑕疵。它实际上保持着最新、最快且可靠的 Unity 地形系统,并在你需要的地方无缝创建洞穴/悬岩峭壁网格。Digger 内…...

文字处理工具 word 2019 mac中文版改进功能

Microsoft Word 2019 是微软公司的文字处理软件&#xff0c;是 office 2019 套件中的一部分。它是一个功能强大、易于使用的工具&#xff0c;可以帮助用户创建各种类型的文档&#xff0c;包括信函、简历、报告、手册等。 Word 2019 提供了许多功能和改进&#xff0c;包括更好的…...

LeetCode 54. 螺旋矩阵

题目链接 力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成长平台 题目解析 1、求出当前矩阵左上角的元素和右下角的元素。 2、根据这两个元素来确定我们需要遍历的具体位置。 3、当遍历完一圈的时候更新左上角元素和右下角元素。 细节&#xff1a; 当遍历最…...

每天几道Java面试题:集合(第四天)

目录 第四幕 、第一场&#xff09;大厦楼下门口第二场&#xff09;大门口 友情提醒 背面试题很枯燥&#xff0c;加入一些戏剧场景故事人物来加深记忆。PS:点击文章目录可直接跳转到文章指定位置。 第四幕 、 第一场&#xff09;大厦楼下门口 【面试者老王&#xff0c;门卫甲…...

【论文解读】Faster sorting algorithm

一、简要介绍 基本的算法&#xff0c;如排序或哈希&#xff0c;在任何一天都被使用数万亿次。随着对计算需求的增长&#xff0c;这些算法的性能变得至关重要。尽管在过去的2年中已经取得了显著的进展&#xff0c;但进一步改进这些现有的算法路线的有效性对人类科学家和计算方法…...

latexocr安装过程中遇到的问题解决办法

环境要求&#xff1a;需要Python版本3.7&#xff0c;并安装相应依赖文件 具体的详细安装步骤可见我上次写的博文&#xff1a;Mathpix替代者|科研人必备公式识别插件|latexocr安装教程 ‘latexocr‘ 不是内部或外部命令&#xff0c;也不是可运行的程序或批处理文件的相关解决办…...

如何判断linux 文件(或lib)是由uclibc还是glibc编译出来的?

工作中使用的编译环境有2套编译器&#xff0c;一个是glibc&#xff0c;一个是uclibc。 有些项目使用的glibc编译的lib&#xff0c;和使用uclibc编译的工程&#xff0c;在一起就会出现reference的编译错误如下&#xff1a; 那和如何来判断一个文件是由哪个编译器编译的呢&#…...

WorkPlus | 好用、专业、安全的局域网即时通讯及协同办公平台

自国家于2022年发布的《关于加强数字政府建设的指导意见》以来&#xff0c;我国数字政府建设已经迈入了一个全新的里程碑&#xff0c;迎来了全面改革和深化升级的全新阶段。 WorkPlus作为自主可控、可信安全、专属定制的数字化平台&#xff0c;扮演着政务机关、政府单位以及各…...

ARM Linux DIY(十二)NES 游戏

文章目录 前言交叉编译工具链使能 Cnes 游戏模拟器移植游戏手柄调试 前言 很多小伙伴为了不让自己的 V3s 吃灰&#xff0c;进而将其打造成游戏机。 我们 DIY 的板子具备屏幕、扬声器、USB Host&#xff08;可以接游戏手柄&#xff09;&#xff0c;当然也要凑一凑热闹。 交叉编…...

MOEA算法的背景知识

MOEA算法 多目标进化算法优化MOEA工作原理举个例子 为什么单一策略可能会导致种群中的个体过于相似&#xff1f;种群在MOEA里面做什么&#xff1f;举例说明 多目标进化算法优化MOEA Multi-objective evolutionary algorithm optimization (MOEA) 多目标进化算法优化&#xff0…...

【rtp-benchmarks】读取本地文件基于uvgRtp实现多线程发送

input 文件做内存映射 : get_mem D:\XTRANS\soup\uvg-rtp-dev\rtp-benchmarks\util\util.cc 文件中读取chunksize 到 vector 里作为chunks 创建多个线程进行发送 std::vector<std::thread*> threads;...

React 第五十五节 Router 中 useAsyncError的使用详解

前言 useAsyncError 是 React Router v6.4 引入的一个钩子&#xff0c;用于处理异步操作&#xff08;如数据加载&#xff09;中的错误。下面我将详细解释其用途并提供代码示例。 一、useAsyncError 用途 处理异步错误&#xff1a;捕获在 loader 或 action 中发生的异步错误替…...

反向工程与模型迁移:打造未来商品详情API的可持续创新体系

在电商行业蓬勃发展的当下&#xff0c;商品详情API作为连接电商平台与开发者、商家及用户的关键纽带&#xff0c;其重要性日益凸显。传统商品详情API主要聚焦于商品基本信息&#xff08;如名称、价格、库存等&#xff09;的获取与展示&#xff0c;已难以满足市场对个性化、智能…...

java 实现excel文件转pdf | 无水印 | 无限制

文章目录 目录 文章目录 前言 1.项目远程仓库配置 2.pom文件引入相关依赖 3.代码破解 二、Excel转PDF 1.代码实现 2.Aspose.License.xml 授权文件 总结 前言 java处理excel转pdf一直没找到什么好用的免费jar包工具,自己手写的难度,恐怕高级程序员花费一年的事件,也…...

STM32F4基本定时器使用和原理详解

STM32F4基本定时器使用和原理详解 前言如何确定定时器挂载在哪条时钟线上配置及使用方法参数配置PrescalerCounter ModeCounter Periodauto-reload preloadTrigger Event Selection 中断配置生成的代码及使用方法初始化代码基本定时器触发DCA或者ADC的代码讲解中断代码定时启动…...

【快手拥抱开源】通过快手团队开源的 KwaiCoder-AutoThink-preview 解锁大语言模型的潜力

引言&#xff1a; 在人工智能快速发展的浪潮中&#xff0c;快手Kwaipilot团队推出的 KwaiCoder-AutoThink-preview 具有里程碑意义——这是首个公开的AutoThink大语言模型&#xff08;LLM&#xff09;。该模型代表着该领域的重大突破&#xff0c;通过独特方式融合思考与非思考…...

工程地质软件市场:发展现状、趋势与策略建议

一、引言 在工程建设领域&#xff0c;准确把握地质条件是确保项目顺利推进和安全运营的关键。工程地质软件作为处理、分析、模拟和展示工程地质数据的重要工具&#xff0c;正发挥着日益重要的作用。它凭借强大的数据处理能力、三维建模功能、空间分析工具和可视化展示手段&…...

反射获取方法和属性

Java反射获取方法 在Java中&#xff0c;反射&#xff08;Reflection&#xff09;是一种强大的机制&#xff0c;允许程序在运行时访问和操作类的内部属性和方法。通过反射&#xff0c;可以动态地创建对象、调用方法、改变属性值&#xff0c;这在很多Java框架中如Spring和Hiberna…...

Java入门学习详细版(一)

大家好&#xff0c;Java 学习是一个系统学习的过程&#xff0c;核心原则就是“理论 实践 坚持”&#xff0c;并且需循序渐进&#xff0c;不可过于着急&#xff0c;本篇文章推出的这份详细入门学习资料将带大家从零基础开始&#xff0c;逐步掌握 Java 的核心概念和编程技能。 …...

图表类系列各种样式PPT模版分享

图标图表系列PPT模版&#xff0c;柱状图PPT模版&#xff0c;线状图PPT模版&#xff0c;折线图PPT模版&#xff0c;饼状图PPT模版&#xff0c;雷达图PPT模版&#xff0c;树状图PPT模版 图表类系列各种样式PPT模版分享&#xff1a;图表系列PPT模板https://pan.quark.cn/s/20d40aa…...

基于TurtleBot3在Gazebo地图实现机器人远程控制

1. TurtleBot3环境配置 # 下载TurtleBot3核心包 mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git git clone -b noetic https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git git clone -b noetic-dev…...