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

news2024/9/28 13:16:12

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 -y

systemctl 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-net

docker 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.28

docker 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.6

docker 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.6

docker 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-agent2


docker 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-agent

systemctl 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" ] ; then
 	echo "Ubuntu System"
	isExist=$(grep "^#" /etc/zabbix/zabbix_agentd.conf -v | grep UnsafeUserParameters -c ) && test -n "$isExist" || echo "UnsafeUserParameters=1" >> /etc/zabbix/zabbix_agentd.conf
	isExist=$(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.conf
	echo "UserParameter=tcp.status[*],/usr/local/zabbix-agent/scripts/tcp_conn_status.sh \$1" > /etc/zabbix/zabbix_agentd.conf.d/tcp-status-params.conf
else
  echo "Not Ubuntu System"
 	isExist=$(grep "^#" /etc/zabbix_agentd.conf -v | grep UnsafeUserParameters -c ) && test -n "$isExist" || echo "UnsafeUserParameters=1" >> /etc/zabbix_agentd.conf
	isExist=$(grep "^#" /etc/zabbix_agentd.conf -v | grep Include -c ) && test -n "$isExist" || echo "Include=/etc/zabbix/zabbix_agentd.d/*.conf" >> /etc/zabbix_agentd.conf
	echo "UserParameter=tcp.status[*],/usr/local/zabbix-agent/scripts/tcp_conn_status.sh \$1" > /etc/zabbix/zabbix_agentd.d/tcp-status-params.conf
fi





curl -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 listen

service zabbix-agent restart

zabbix_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_file
 
case $metric in
   closed)
          output=$(awk '/CLOSED/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   listen)
          output=$(awk '/LISTEN/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   synrecv)
          output=$(awk '/SYN-RECV/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   synsent)
          output=$(awk '/SYN-SENT/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   established)
          output=$(awk '/ESTAB/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   timewait)
          output=$(awk '/TIME-WAIT/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   closing)
          output=$(awk '/CLOSING/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   closewait)
          output=$(awk '/CLOSE-WAIT/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
        ;;
   lastack)
          output=$(awk '/LAST-ACK/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
         ;;
   finwait1)
          output=$(awk '/FIN-WAIT-1/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
         ;;
   finwait2)
          output=$(awk '/FIN-WAIT-2/{print $2}' $tmp_file)
          if [ "$output" == "" ];then
             echo 0
          else
             echo $output
          fi
         ;;
         *)
          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>

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1026015.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

vector类(顺序表)

文章目录 1.定义&#xff1a;接口成员函数构造成员函数析构函数赋值 2.迭代器2.1begin&#xff08;&#xff09;和end&#xff08;&#xff09;重点2.1.1应用2.1.1.1函数调用 2.1.1.2用变量接受迭代器 2.2rbegin()和rend()2.2.1应用 3.顺序表的访问&#xff08;增删查检&#x…

Vue的路由使用,Node.js下载安装及环境配置教程 (超级详细)

前言&#xff1a; 今天我们来讲解关于Vue的路由使用&#xff0c;Node.js下载安装及环境配置教程 一&#xff0c;Vue的路由使用 首先我们Vue的路由使用&#xff0c;必须要导入官方的依赖的。 BootCDN - Bootstrap 中文网开源项目免费 CDN 加速服务https://www.bootcdn.cn/ <…

架构核心技术之分布式消息队列

Java全能学习面试指南&#xff1a;https://javaxiaobear.cn 今天我们来学习分布式消息队列&#xff0c;分布式消息队列的知识结构如下图。 主要介绍以下内容&#xff1a; 同步架构和异步架构的区别。异步架构的主要组成部分&#xff1a;消息生产者、消息消费者、分布式消息队列…

Vue路由及Node.js环境搭建

一、Vue路由 1.1 定义 Vue路由是指使用Vue Router插件来管理前端应用程序的导航和页面路由的过程。它允许你在单页面应用程序&#xff08;SPA&#xff09;中定义不同的路由路径&#xff0c;并将每个路径映射到相应的组件。 通过使用Vue路由&#xff0c;你可以根据URL的变化加载…

无涯教程-JavaScript - ASIN函数

描述 ASIN函数返回给定数字的反正弦或反正弦,并返回以弧度表示的Angular,介于-π/2和π/2之间。 语法 ASIN (number)争论 Argument描述Required/OptionalNumberThe sine of the angle you want and must be from -1 to 1.Required Notes 如果您希望ASIN函数返回的Angular以…

HUAWEI华为荣耀猎人游戏本V700 i7独显2060(FRD-WFD9)原装出厂Windows10系统工厂模式(含F10还原)

华为HONOR荣耀笔记本原厂系统镜像包&#xff0c;安装恢复时自动创建F10一键智能还原功能 链接&#xff1a;https://pan.baidu.com/s/1_px_3Fr9qEE6jExz1eKKKg?pwdk6uc 提取码&#xff1a;k6uc 系统自带所有驱动、出厂主题壁纸LOGO、Office办公软件、华为电脑管家等预装程序…

基于springboot高校场馆预订系统

博主主页&#xff1a;猫头鹰源码 博主简介&#xff1a;Java领域优质创作者、CSDN博客专家、公司架构师、全网粉丝5万、专注Java技术领域和毕业设计项目实战 主要内容&#xff1a;毕业设计(Javaweb项目|小程序等)、简历模板、学习资料、面试题库、技术咨询 文末联系获取 项目介绍…

(并查集) 1971. 寻找图中是否存在路径 ——【Leetcode每日一题】

❓ 1971. 寻找图中是否存在路径 难度&#xff1a;简单 有一个具有 n 个顶点的 双向 图&#xff0c;其中每个顶点标记从 0 到 n - 1&#xff08;包含 0 和 n - 1&#xff09;。图中的边用一个二维整数数组 edges 表示&#xff0c;其中 edges[i] [ui, vi] 表示顶点 ui 和顶点 …

select in ()的时候,MySQL会自动按主键自增排序,要是按IN中给定的顺序来取,如何实现呢?

select * from table_name where id in ()的时候&#xff0c;MySQL会自动按主键自增排序&#xff0c;要是按IN中给定的顺序来取&#xff0c;如何实现呢&#xff1f; 比如下面这个查询结果&#xff0c;mysql会默认使用主键id的ASC自增排序结果集&#xff1a; 那么&#xff0c;…

RHEL 8.8 安装部署 Zabbix 6.4 详细过程

文章目录 前言1. 关闭系统防火墙2. 禁用 SELinux 模块3. 配置本地 YUM 源4. 配置 Zabbix 下载源5. 切换 PHP 模块版本6. 安装 Zabbix Server && Frontend && Agent7. 安装配置 MariaDB 数据库8. 为 Zabbix Server 配置数据库9. 启动 Zabbix Server 和 Agent 服…

【Java 基础篇】Java 中的 `wait` 与 `notify` 方法详解

在 Java 中&#xff0c;wait 与 notify 方法是用于线程之间通信的重要工具。它们被用于实现线程的等待与唤醒&#xff0c;以及线程之间的协作。本节将深入介绍这两个方法的使用方式、作用以及一些注意事项。 wait 方法 wait 方法是 java.lang.Object 类的一个实例方法&#x…

知识图谱(4)图算法

基于图有很多任务&#xff0c;比如&#xff1a; 节点分类&#xff1a;预测哪些网站是诈骗网站&#xff1b;关系预测&#xff1a;判断图中两个节点的关系&#xff1b;图分类&#xff1a;分子性质预测&#xff1b;聚类&#xff1a;社交网络分析&#xff0c;将相似用户聚类在一起…

如何选择合适的官文转录供应商

为什么质量不应该是唯一的考虑因素 官文记录必须准确无误——很多重要的程序&#xff08;包括法庭案件审判、严重欺诈调查和尸检调查&#xff09;成功得出结论&#xff0c;可能都依赖于记录的准确性。但是&#xff0c;在选择转录供应商时&#xff0c;还必须考虑更多因素。 官文…

2023Q2全球可穿戴腕带出货量达 4400 万台

全球可穿戴设备市场在2023年第二季度继续保持增长态势&#xff0c;总出货量达到了4400万台&#xff0c;同比增长了6%。这一增长得益于消费者对于可穿戴设备的需求不断增加&#xff0c;以及不同细分市场的需求反弹。 根据市场研究机构 Canalys 的最新报告&#xff0c;全球可穿戴…

阿里测开面试大全(一)附答案完整版

万字长文&#xff0c;建议收藏 1 什么是POM&#xff0c;为什么要使用它&#xff1f; POM是Page Object Model的简称&#xff0c;它是一种设计思想&#xff0c;而不是框架。大概的意思是&#xff0c;把一个一个页面&#xff0c;当做一个对象&#xff0c;页面的元素和元素之间操…

VM虚拟机CentOS7.9x64 LVM硬盘扩容

软件版本&#xff1a;VMWare Workstation14 虚拟机CentOS 7.9X64位 GParted 0.33.0 一、虚拟机安装gparted软件 sudo yum install epel-release sudo yum install gparted sudo yum install yum-utils git gnome-common gcc-c sudo yum-builddep gparted 二、关闭虚拟机&a…

【Java 基础篇】Java Condition 接口详解

Java 提供了一种更灵活和高级的线程协作机制&#xff0c;通过 Condition 接口的使用&#xff0c;你可以更精细地控制线程的等待和唤醒&#xff0c;实现更复杂的线程同步和通信。本文将详细介绍 Java 的 Condition 接口&#xff0c;包括它的基本概念、常见用法以及注意事项。 什…

TS编译器选项​compilerOptions指定编译后文件所在目录

compilerOptions是TS的编译器选项&#xff0c;主要在tsconfig.json文件中用于对ts编译为js文件时进行配置 "compilerOptions" : { 配置项 } 在tsconfig.json中编写如下代码&#xff1a; {// compilerOptions 编译器选项"compilerOptions": {// outDir 用于…

buuctf web [极客大挑战 2019]Upload

上传头像&#xff0c;上传一下&#xff0c;看看能不能成功 抓包&#xff0c;抓取上传时的数据,看看限制条件 改两个地方&#xff0c;符合上传图片的要求&#xff0c;上传试试 一句话木马的<?被扳了 改一下木马的格式 <script language"php">eval($_POST[cm…

[NOIP2016 提高组] 蚯蚓

题目链接 题目很长&#xff0c;题意如下&#xff1a;一开始有n个值&#xff0c;&#xff0c;有m次操作&#xff0c;每次操作选择一个最大的值x&#xff0c;将它分解成两个数&#xff0c;分别为&#xff0c;以及&#xff0c;然后&#xff0c;经过这个操作之后&#xff0c;对除了…