zabbix TCP 连接数监控
直接上配置:
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)}>85</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME} {#DISKNAME} iostat %util > 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)}>10000</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME} {#DISKNAME} read ops is too high (>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)}>10000</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME} {#DISKNAME} write ops is too high (>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)}>6000</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>{HOST.NAME}:TCP ESTABLISHED too high > 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 连接数监控的更多相关文章
- 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 ...
- zabbix 监控数据库 及 tcp连接数
参考网站: 监控sqlserver http://blog.51cto.com/13272050/2050601 http://blog.51cto.com/ultrasql/1927672 ...
- zabbix 监控linux tcp连接数
zabbix 监控linux tcp连接数 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.TCP的状态概述 1>.端口状态转换 2>.TCP 三次握手 3>. ...
- zabbix 监控 tcp 连接数
一.zabbix-agent 服务器配置 1.编辑zabbix_agent配置文件,添加以下内容 vim /etc/zabbix/zabbix_agentd.conf ##添加此行 UserParam ...
- zabbix监控tcp连接数的脚本!!
#!/bin/bash #this script is used to get tcp and udp connetion status #tcp status metric=$ tmp_file=/ ...
- zabbix (11) 监控TCP连接数
对TCP的监控可以采用ss.netstat./proc/net/tcp这三个不同的方案来实现.其中ss是最快的 (1)ss命令 [root@manager1 script_py ::]#time ss ...
- 使用ss命令对tcp连接数和状态的监控性能优化
之前对tcp的监控采用netstat命令,发现在服务器繁忙的时候效果不理想,这个命令占用大量的cpu有时候高达90%以上,可能会导致业务的不稳定,所以改用ss命令对脚本进行优化 对tcp连接数和状态的 ...
- zabbix3.0对tcp连接数和状态的监控优化
zabbix3.0对tcp连接数及状态的监控优化 之前对tcp的监控采用netstat命令,发现在服务器繁忙的时候效果不理想,这个命令占用大量的cpu有时候高达90%以上,可能会导致业务的不稳定,所以 ...
- zabbix3.0使用ss命令对tcp连接数和状态的监控性能优化
zabbix3.0对tcp连接数及状态的监控优化 之前对tcp的监控采用netstat命令,发现在服务器繁忙的时候效果不理想,这个命令占用大量的cpu有时候高达90%以上,可能会导致业务的不稳定,所以 ...
随机推荐
- MySQL之简介以及数据类型(一)
一:关系型数据库 所谓的关系型数据库RDBMS,是建立在关系模型基础上的数据库,借助于集合代数等数学概念和方法来处理数据库中的数据. 二:关系型数据库的主要产品: oracle:在以前的大型项目中使用 ...
- SpringMVC中的400错误,The request sent by the client was syntactically incorrect.
在其他对象属性类型一样情况下,只需要创建一个类,再在springmvc.xml中添加配置: package com.ujiuye.common; import org.springframework. ...
- VS 对话框控件的Tab顺序问题
我们先来直观的看看各个控件的Tab顺序吧.打开“Resource View”视图,然后在资源中找到对话框IDD_ADDITION_DIALOG,双击ID后中间客户区域出现其模板视图.在主菜单中选择“F ...
- mmap vs read
先放个结论: 内存映射通常比随机访问更快,尤其访问的对象是分离的和不可预测的. 内存映射会持续占用pages, 直到完成访问. 这意味当长时间重度使用一个文件很久之前, 然后你关闭了它, 然后再重新打 ...
- YUV详解
YUV格式解析2 又确认了一下H264的视频格式——H264支持4:2:0的连续或隔行视频的编码和解码 YUV(亦称YCrCb)是被欧洲电视系统所采用的一种颜色编码方法(属于PAL).YUV主要用 ...
- 使用DocumentFormat.OpenXml操作Excel文件.xlsx
1.开始 DocumentFormat.OpenXml是ms官方给一个操作office三大件新版文件格式(.xlsx,.docx,.pptx)的组件:特色是它定义了OpenXml所包含的所有对象(たぶ ...
- Linux定时任务运行thinkPHP某个方法
先上实力: 1.查看正在执行的crontab,用命令crontab -l ,这样就可以看到哪些任务一直在执行了.2.crontab -e 自动打开文件 编辑定时任务程序 在打开的页面中点击“i”键 ...
- php的类使用样例
这个demo.差不多php的类的主要知识点都用到了. public,private关键字, namespace,use命令空间, require导入, interface复用, abstract抽象类 ...
- 31、Python程序中的协程操作(greenlet\gevent模块)
一.协程介绍 协程:是单线程下的并发,又称微线程,纤程.英文名Coroutine.一句话说明什么是协程:协程是一种用户态的轻量级线程,即协程是由用户程序自己控制调度的. 对比操作系统控制线程的切换,用 ...
- nginx访问url内容过滤
当访问的url中含有/%df时返回404 location / { if ($request_uri ~* "/%df") { # return 200 "error&q ...