• 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 -y
    
    systemctl restart docker.service
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    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
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22

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

    Centos的安装

    yum -y install zabbix6.0-agent
    
    systemctl restart zabbix-agent
    systemctl enable zabbix-agent
    
    • 1
    • 2
    • 3
    • 4

    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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    修改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一致。
    
    • 1
    • 2
    • 3

    然后配置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]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31

    执行成功后,会出现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
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102

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

    
    <zabbix_export>
        <version>2.0version>
        <date>2023-09-20T09:41:57Zdate>
        <groups>
            <group>
                <name>Templatesname>
            group>
        groups>
        <templates>
            <template>
                <template>Template TCP Connection Statustemplate>
                <name>Template TCP Connection Statusname>
                <groups>
                    <group>
                        <name>Templatesname>
                    group>
                groups>
                <applications>
                    <application>
                        <name>TCP Statusname>
                    application>
                applications>
                <items>
                    <item>
                        <name>CLOSEDname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[closed]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>CLOSE_WAITname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[closewait]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>CLOSINGname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[closing]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>ESTABLISHEDname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[established]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>FIN_WAIT1name>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[finwait1]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>FIN_WAIT2name>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[finwait2]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>LAST_ACKname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[lastack]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>LISTENname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[listen]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>SYN_RECVname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[synrecv]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>SYN_SENTname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[synsent]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                    <item>
                        <name>TIME_WAITname>
                        <type>0type>
                        <snmp_community/>
                        <multiplier>0multiplier>
                        <snmp_oid/>
                        <key>tcp.status[timewait]key>
                        <delay>60delay>
                        <history>90history>
                        <trends>365trends>
                        <status>0status>
                        <value_type>3value_type>
                        <allowed_hosts/>
                        <units/>
                        <delta>0delta>
                        <snmpv3_contextname/>
                        <snmpv3_securityname/>
                        <snmpv3_securitylevel>0snmpv3_securitylevel>
                        <snmpv3_authprotocol>0snmpv3_authprotocol>
                        <snmpv3_authpassphrase/>
                        <snmpv3_privprotocol>0snmpv3_privprotocol>
                        <snmpv3_privpassphrase/>
                        <formula>1formula>
                        <delay_flex/>
                        <params/>
                        <ipmi_sensor/>
                        <data_type>0data_type>
                        <authtype>0authtype>
                        <username/>
                        <password/>
                        <publickey/>
                        <privatekey/>
                        <port/>
                        <description/>
                        <inventory_link>0inventory_link>
                        <applications>
                            <application>
                                <name>TCP Statusname>
                            application>
                        applications>
                        <valuemap/>
                    item>
                items>
                <discovery_rules/>
                <macros/>
                <templates/>
                <screens/>
            template>
        templates>
        <triggers>
            <trigger>
                <expression>{Template TCP Connection Status:tcp.status[timewait].last()}>3000expression>
                <name>There are too many TCP TIME_WAIT statusname>
                <url/>
                <status>0status>
                <priority>4priority>
                <description/>
                <type>0type>
                <dependencies/>
            trigger>
        triggers>
        <graphs>
            <graph>
                <name>TCP Statusname>
                <width>900width>
                <height>200height>
                <yaxismin>0.0000yaxismin>
                <yaxismax>100.0000yaxismax>
                <show_work_period>1show_work_period>
                <show_triggers>1show_triggers>
                <type>0type>
                <show_legend>1show_legend>
                <show_3d>0show_3d>
                <percent_left>0.0000percent_left>
                <percent_right>0.0000percent_right>
                <ymin_type_1>0ymin_type_1>
                <ymax_type_1>0ymax_type_1>
                <ymin_item_1>0ymin_item_1>
                <ymax_item_1>0ymax_item_1>
                <graph_items>
                    <graph_item>
                        <sortorder>0sortorder>
                        <drawtype>0drawtype>
                        <color>C80000color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[closed]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>1sortorder>
                        <drawtype>0drawtype>
                        <color>00C800color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[closewait]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>2sortorder>
                        <drawtype>0drawtype>
                        <color>0000C8color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[closing]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>3sortorder>
                        <drawtype>0drawtype>
                        <color>C800C8color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[established]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>4sortorder>
                        <drawtype>0drawtype>
                        <color>00C8C8color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[finwait1]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>5sortorder>
                        <drawtype>0drawtype>
                        <color>C8C800color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[finwait2]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>6sortorder>
                        <drawtype>0drawtype>
                        <color>C8C8C8color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[lastack]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>7sortorder>
                        <drawtype>0drawtype>
                        <color>960000color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[listen]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>8sortorder>
                        <drawtype>0drawtype>
                        <color>009600color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[synrecv]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>9sortorder>
                        <drawtype>0drawtype>
                        <color>000096color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[synsent]key>
                        item>
                    graph_item>
                    <graph_item>
                        <sortorder>10sortorder>
                        <drawtype>0drawtype>
                        <color>960096color>
                        <yaxisside>0yaxisside>
                        <calc_fnc>2calc_fnc>
                        <type>0type>
                        <item>
                            <host>Template TCP Connection Statushost>
                            <key>tcp.status[timewait]key>
                        item>
                    graph_item>
                graph_items>
            graph>
        graphs>
    zabbix_export>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350
    • 351
    • 352
    • 353
    • 354
    • 355
    • 356
    • 357
    • 358
    • 359
    • 360
    • 361
    • 362
    • 363
    • 364
    • 365
    • 366
    • 367
    • 368
    • 369
    • 370
    • 371
    • 372
    • 373
    • 374
    • 375
    • 376
    • 377
    • 378
    • 379
    • 380
    • 381
    • 382
    • 383
    • 384
    • 385
    • 386
    • 387
    • 388
    • 389
    • 390
    • 391
    • 392
    • 393
    • 394
    • 395
    • 396
    • 397
    • 398
    • 399
    • 400
    • 401
    • 402
    • 403
    • 404
    • 405
    • 406
    • 407
    • 408
    • 409
    • 410
    • 411
    • 412
    • 413
    • 414
    • 415
    • 416
    • 417
    • 418
    • 419
    • 420
    • 421
    • 422
    • 423
    • 424
    • 425
    • 426
    • 427
    • 428
    • 429
    • 430
    • 431
    • 432
    • 433
    • 434
    • 435
    • 436
    • 437
    • 438
    • 439
    • 440
    • 441
    • 442
    • 443
    • 444
    • 445
    • 446
    • 447
    • 448
    • 449
    • 450
    • 451
    • 452
    • 453
    • 454
    • 455
    • 456
    • 457
    • 458
    • 459
    • 460
    • 461
    • 462
    • 463
    • 464
    • 465
    • 466
    • 467
    • 468
    • 469
    • 470
    • 471
    • 472
    • 473
    • 474
    • 475
    • 476
    • 477
    • 478
    • 479
    • 480
    • 481
    • 482
    • 483
    • 484
    • 485
    • 486
    • 487
    • 488
    • 489
    • 490
    • 491
    • 492
    • 493
    • 494
    • 495
    • 496
    • 497
    • 498
    • 499
    • 500
    • 501
    • 502
    • 503
    • 504
    • 505
    • 506
    • 507
    • 508
    • 509
    • 510
    • 511
    • 512
    • 513
    • 514
    • 515
    • 516
    • 517
    • 518
    • 519
    • 520
    • 521
    • 522
    • 523
    • 524
    • 525
    • 526
    • 527
    • 528
    • 529
    • 530
    • 531
    • 532
    • 533
    • 534
    • 535
    • 536
    • 537
    • 538
    • 539
    • 540
    • 541
    • 542
    • 543
    • 544
    • 545
    • 546
    • 547
    • 548
    • 549
    • 550
    • 551
    • 552
    • 553
    • 554
    • 555
    • 556
    • 557
    • 558
    • 559
    • 560
    • 561
    • 562
    • 563
    • 564
    • 565
    • 566
    • 567
    • 568
    • 569
    • 570
    • 571
    • 572
    • 573
    • 574
    • 575
    • 576
    • 577
    • 578
    • 579
    • 580
    • 581
    • 582
    • 583
    • 584
    • 585
    • 586
    • 587
    • 588
    • 589
    • 590
    • 591
    • 592
    • 593
    • 594
    • 595
    • 596
    • 597
    • 598
    • 599
    • 600
    • 601
    • 602
    • 603
    • 604
    • 605
    • 606
    • 607
    • 608
    • 609
    • 610
    • 611
    • 612
    • 613
    • 614
    • 615
    • 616
    • 617
    • 618
    • 619
    • 620
    • 621
    • 622
    • 623
    • 624
    • 625
    • 626
    • 627
    • 628
    • 629
    • 630
    • 631
    • 632
    • 633
    • 634
    • 635
    • 636
    • 637
    • 638
    • 639
    • 640
    • 641
    • 642
    • 643
    • 644
    • 645
    • 646
    • 647
    • 648
    • 649
    • 650
    • 651
    • 652
    • 653
    • 654
    • 655
    • 656
    • 657
    • 658
    • 659
    • 660

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

  • 相关阅读:
    文件目录(文件控制块FCB,目录结构,索引结点)
    基于SSM的电动车上牌管理系统(有报告)。Javaee项目。
    如何增长LLM推理token,从直觉到数学
    含文档+PPT+源码等]精品基于SSM的农产品交易平台[包运行成功]Java毕业设计SSM项目源码论文
    二叉树题目:最大二叉树
    开发需要了解的23种设计模式 | 导言
    C++ shutdown 使用方法 (坑人必备)
    后管实现面包屑功能
    自动驾驶中的SLAM
    【C语言】字符函数、字符串函数与内存函数
  • 原文地址:https://blog.csdn.net/m0_37239002/article/details/133068730