直接上配置:

1、修改配置

cat userparameter_tcp_connect.conf

UserParameter=tcp_connect.established,/opt/app/zabbix-agent/scripts/tcp_connect.sh established
UserParameter=tcp_connect.listen,/opt/app/zabbix-agent/scripts/tcp_connect.sh listen
UserParameter=tcp_connect.timewait,/opt/app/zabbix-agent/scripts/tcp_connect.sh timewait
UserParameter=tcp_connect.timeclose,/opt/app/zabbix-agent/scripts/tcp_connect.sh timeclose
UserParameter=tcp_connect.finwait1,/opt/app/zabbix-agent/scripts/tcp_connect.sh finwait1
UserParameter=tcp_connect.finwait2,/opt/app/zabbix-agent/scripts/tcp_connect.sh finwait2
UserParameter=tcp_connect.synsent,/opt/app/zabbix-agent/scripts/tcp_connect.sh synsent
UserParameter=tcp_connect.synrecv,/opt/app/zabbix-agent/scripts/tcp_connect.sh synrecv
UserParameter=tcp_connect.closewait,/opt/app/zabbix-agent/scripts/tcp_connect.sh closewait

cat /opt/app/zabbix-agent/scripts/tcp_connect.sh

#!/bin/bash

# function:monitor tcp connect status from zabbix
# License: GPL
# mail:root@nowsafe.org
# date:2014-03-12
sss=`ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'`
#Permission=$(ls -l /var/log/zabbix/tcp_connect.log |awk '{print $3}')
#[ $Permission != zabbix ] && chown zabbix.zabbix /var/log/zabbix/tcp_connect.log

#Functions to return tcp connect status

established () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/ESTAB/'|awk '{print $2}'
}
listen () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/LISTEN/'|awk '{print $2}'
}
timewait () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/TIME-WAIT/'|awk '{print $2}'
}
timeclose () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/TIME-CLOSE/'|awk '{print $2}'
}
finwait1 () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/FIN-WAIT-1/'|awk '{print $2}'
}

finwait2 () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/FIN-WAIT-2/'|awk '{print $2}'
}

synsent () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/SYN-SENT/'|awk '{print $2}'
}
synrecv () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/SYN-RECV/'|awk '{print $2}'
}
closewait () {
ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'|awk '/CLOSE-WAIT/'|awk '{print $2}'
}

# Run the requested function
$1

2、导入模板

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.4</version>
<date>2018-07-05T05:34:53Z</date>
<groups>
<group>
<name>Template base</name>
</group>
<group>
<name>Template For Base</name>
</group>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Template Linux Disk IO</template>
<name>Template Linux Disk IO</name>
<description/>
<groups>
<group>
<name>Template For Base</name>
</group>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>Linux I/O Stats</name>
</application>
</applications>
<items/>
<discovery_rules>
<discovery_rule>
<name>Linux Disk device discovery</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>custom.vfs.discovery.diskname</key>
<delay>3600</delay>
<status>0</status>
<allowed_hosts/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<filter>
<evaltype>0</evaltype>
<formula/>
<conditions>
<condition>
<macro>{#DISKNAME}</macro>
<value/>
<operator>8</operator>
<formulaid>A</formulaid>
</condition>
</conditions>
</filter>
<lifetime>30d</lifetime>
<description>Discovery of disk devices on Linux</description>
<item_prototypes>
<item_prototype>
<name>Disk:{#DISKNAME}:I/O's currently in progress</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>custom.vfs.dev.io.active[{#DISKNAME}]</key>
<delay>120</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units>iops</units>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Linux I/O Stats</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<application_prototypes/>
<master_item_prototype/>
</item_prototype>
<item_prototype>
<name>Disk:{#DISKNAME}:time spent doing I/O</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>custom.vfs.dev.io.ms[{#DISKNAME}]</key>
<delay>120</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units>ms</units>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Linux I/O Stats</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing>
<step>
<type>10</type>
<params/>
</step>
</preprocessing>
<jmx_endpoint/>
<application_prototypes/>
<master_item_prototype/>
</item_prototype>
<item_prototype>
<name>Disk:{#DISKNAME}:completed reads per second</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>custom.vfs.dev.read.ops[{#DISKNAME}]</key>
<delay>120</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units>Reads/sec</units>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Linux I/O Stats</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing>
<step>
<type>10</type>
<params/>
</step>
</preprocessing>
<jmx_endpoint/>
<application_prototypes/>
<master_item_prototype/>
</item_prototype>
<item_prototype>
<name>Disk:{#DISKNAME}:completed writes per second</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>custom.vfs.dev.write.ops[{#DISKNAME}]</key>
<delay>120</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units>Writes/sec</units>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Linux I/O Stats</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing>
<step>
<type>10</type>
<params/>
</step>
</preprocessing>
<jmx_endpoint/>
<application_prototypes/>
<master_item_prototype/>
</item_prototype>
<item_prototype>
<name>Disk:{#DISKNAME}:iostat await</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>iostat.await[{#DISKNAME}]</key>
<delay>300</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Linux I/O Stats</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<application_prototypes/>
<master_item_prototype/>
</item_prototype>
<item_prototype>
<name>Disk:{#DISKNAME}:iostat %util</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>iostat.util[{#DISKNAME}]</key>
<delay>300</delay>
<history>90d</history>
<trends>365d</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>Linux I/O Stats</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<application_prototypes/>
<master_item_prototype/>
</item_prototype>
</item_prototypes>
<trigger_prototypes>
<trigger_prototype>
<expression>{Template Linux Disk IO:iostat.util[{#DISKNAME}].min(#3)}&gt;85</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME} {#DISKNAME} iostat %util &gt; 85</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>3</priority>
<description/>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger_prototype>
<trigger_prototype>
<expression>{Template Linux Disk IO:custom.vfs.dev.read.ops[{#DISKNAME}].min(#3)}&gt;10000</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME} {#DISKNAME} read ops is too high (&gt;10000)</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>3</priority>
<description/>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger_prototype>
<trigger_prototype>
<expression>{Template Linux Disk IO:custom.vfs.dev.write.ops[{#DISKNAME}].min(#3)}&gt;10000</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME} {#DISKNAME} write ops is too high (&gt;10000)</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>3</priority>
<description/>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger_prototype>
</trigger_prototypes>
<graph_prototypes>
<graph_prototype>
<name>Disk:{#DISKNAME}: I/O's currently in progress</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>00C800</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template Linux Disk IO</host>
<key>custom.vfs.dev.io.active[{#DISKNAME}]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>Disk:{#DISKNAME}: IOPS reads and writes 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>5</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template Linux Disk IO</host>
<key>custom.vfs.dev.read.ops[{#DISKNAME}]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<drawtype>0</drawtype>
<color>0000C8</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template Linux Disk IO</host>
<key>custom.vfs.dev.write.ops[{#DISKNAME}]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>Disk:{#DISKNAME}: iostat stats</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 Linux Disk IO</host>
<key>iostat.util[{#DISKNAME}]</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 Linux Disk IO</host>
<key>iostat.await[{#DISKNAME}]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
</graph_prototypes>
<host_prototypes/>
<jmx_endpoint/>
</discovery_rule>
</discovery_rules>
<httptests/>
<macros/>
<templates/>
<screens/>
</template>
<template>
<template>Templates tcp_connect</template>
<name>Templates tcp_connect</name>
<description/>
<groups>
<group>
<name>Template base</name>
</group>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<items>
<item>
<name>tcp_connect.closewait</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.closewait</key>
<delay>60</delay>
<history>7d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp_connect.established</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.established</key>
<delay>60</delay>
<history>60d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp_connect.finwait1</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.finwait1</key>
<delay>60</delay>
<history>7d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp_connect.finwait2</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.finwait2</key>
<delay>60</delay>
<history>7d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp_connect.synrecv</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.synrecv</key>
<delay>60</delay>
<history>7d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp_connect.synsent</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.synsent</key>
<delay>60</delay>
<history>7d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp_connect.timeclose</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.timeclose</key>
<delay>60</delay>
<history>7d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
<item>
<name>tcp_connect.timewait</name>
<type>0</type>
<snmp_community/>
<snmp_oid/>
<key>tcp_connect.timewait</key>
<delay>60</delay>
<history>7d</history>
<trends>365d</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units/>
<snmpv3_contextname/>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authprotocol>0</snmpv3_authprotocol>
<snmpv3_authpassphrase/>
<snmpv3_privprotocol>0</snmpv3_privprotocol>
<snmpv3_privpassphrase/>
<params/>
<ipmi_sensor/>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications>
<application>
<name>tcp_connect</name>
</application>
</applications>
<valuemap/>
<logtimefmt/>
<preprocessing/>
<jmx_endpoint/>
<master_item/>
</item>
</items>
<discovery_rules/>
<httptests/>
<macros/>
<templates/>
<screens/>
</template>
</templates>
<triggers>
<trigger>
<expression>{Templates tcp_connect:tcp_connect.established.min(#3)}&gt;6000</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME}:TCP ESTABLISHED too high &gt; 6000</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>4</priority>
<description/>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger>
</triggers>
<graphs>
<graph>
<name>tcp_connect</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>Templates tcp_connect</host>
<key>tcp_connect.closewait</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<drawtype>0</drawtype>
<color>000099</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Templates tcp_connect</host>
<key>tcp_connect.established</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<drawtype>0</drawtype>
<color>666666</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Templates tcp_connect</host>
<key>tcp_connect.finwait1</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>Templates tcp_connect</host>
<key>tcp_connect.finwait2</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<drawtype>0</drawtype>
<color>C8C800</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Templates tcp_connect</host>
<key>tcp_connect.synrecv</key>
</item>
</graph_item>
<graph_item>
<sortorder>5</sortorder>
<drawtype>0</drawtype>
<color>C8C8C8</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Templates tcp_connect</host>
<key>tcp_connect.synsent</key>
</item>
</graph_item>
<graph_item>
<sortorder>6</sortorder>
<drawtype>0</drawtype>
<color>960000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Templates tcp_connect</host>
<key>tcp_connect.timeclose</key>
</item>
</graph_item>
<graph_item>
<sortorder>7</sortorder>
<drawtype>0</drawtype>
<color>009600</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Templates tcp_connect</host>
<key>tcp_connect.timewait</key>
</item>
</graph_item>
</graph_items>
</graph>
</graphs>
</zabbix_export>

3、重启zabbix-agent

zabbix TCP 连接数监控的更多相关文章

  1. zabbix系列(七)zabbix3.0添加对tcp连接数及状态的监控

    原理: netstat -an|awk '/^tcp/{++S[$NF]}END{for(a in S) print a,S[a]}' TIME_WAIT 79 ESTABLISHED 6 LISTE ...

  2. zabbix 监控数据库 及 tcp连接数

    参考网站: 监控sqlserver      http://blog.51cto.com/13272050/2050601 http://blog.51cto.com/ultrasql/1927672 ...

  3. zabbix 监控linux tcp连接数

    zabbix 监控linux tcp连接数 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.TCP的状态概述 1>.端口状态转换 2>.TCP 三次握手 3>. ...

  4. zabbix 监控 tcp 连接数

    一.zabbix-agent 服务器配置 1.编辑zabbix_agent配置文件,添加以下内容 vim /etc/zabbix/zabbix_agentd.conf ##添加此行 UserParam ...

  5. zabbix监控tcp连接数的脚本!!

    #!/bin/bash #this script is used to get tcp and udp connetion status #tcp status metric=$ tmp_file=/ ...

  6. zabbix (11) 监控TCP连接数

    对TCP的监控可以采用ss.netstat./proc/net/tcp这三个不同的方案来实现.其中ss是最快的 (1)ss命令 [root@manager1 script_py ::]#time ss ...

  7. 使用ss命令对tcp连接数和状态的监控性能优化

    之前对tcp的监控采用netstat命令,发现在服务器繁忙的时候效果不理想,这个命令占用大量的cpu有时候高达90%以上,可能会导致业务的不稳定,所以改用ss命令对脚本进行优化 对tcp连接数和状态的 ...

  8. zabbix3.0对tcp连接数和状态的监控优化

    zabbix3.0对tcp连接数及状态的监控优化 之前对tcp的监控采用netstat命令,发现在服务器繁忙的时候效果不理想,这个命令占用大量的cpu有时候高达90%以上,可能会导致业务的不稳定,所以 ...

  9. zabbix3.0使用ss命令对tcp连接数和状态的监控性能优化

    zabbix3.0对tcp连接数及状态的监控优化 之前对tcp的监控采用netstat命令,发现在服务器繁忙的时候效果不理想,这个命令占用大量的cpu有时候高达90%以上,可能会导致业务的不稳定,所以 ...

随机推荐

  1. drf之接口规范

    web接口 # 请求工具:postman => https://www.getpostman.com/ # 接口:url链接,通过向链接发生不同的类型请求与数据得到相应的响应数据 # http: ...

  2. Xcode11 Developer Tool中没了Application Loader

    升级Xcode11之后不少人发现在Open Developer Tool中没了Application Loader. 那么如果我们还想用该怎么办呢? 先这样 找个老版的Xcode–>Conten ...

  3. CRM ORDER SEARCH增强查询条件(已有字段)

    ORDER_H表增强的两个字段,很早了,非AET,非EEWB,所以也加不到标准的搜索界面. GENIL_MODEL_BROWSER找到对应的查询和结果结构,append进字段:ZZZBRAND. 然后 ...

  4. 虚拟机-VMware小结

    1.网卡的3种模式 桥接模式:虚拟机=物理机器,连接物理网卡,虚拟ip设置物理网卡的网段和网管.可上网. NAT模式:虚拟机把物理机器当做路由器,虚拟ip网段ip自动获取.可上网. https://w ...

  5. vue脚手架中动态引用图片的办法

    需要先导入: import logo_st_ga from '../assets/big_st_ga.png'; import logo_st_sp from '../assets/big_st_sp ...

  6. MySQL--mysqldmp命令参数set-gtid-purged

    在MySQL 5.7版本中使用mysqldump导出数据时,如果未显式指定set-gtid-purged参数,会报下面错误: Warning: A partial dump from a server ...

  7. Odoo MRP模块

    转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10825963.html 一:MRP MRP:产品制造管理. 产品制造业务设计到以下几个关键概念: 1)BOM ...

  8. SaltStack--远程执行

    saltstack远程执行 安装完Saltstack后可以立即执行shell命令,更新软件包并将文件同时分不到所有受管系统.所有回复都以一致的可配置格式返回.远程执行参考文档:http://docs. ...

  9. nginx编译安装以及配置tcp转发

    依赖包安装 yum -y install gcc gcc-c++ make automake autoconf pcre pcre-devel zlib zlib-devel openssl open ...

  10. alpha冲刺事后诸葛亮(团队)

    alpha冲刺事后诸葛亮(团队) 课程名称:软件工程1916|W(福州大学) 团队名称: 云打印 作业要求: 项目Alpha冲刺(团队) 作业目标:完成Alpha冲刺的事后诸葛亮 团队队员 队员学号 ...