Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Zabbix monitors the status of TCP connections     - CentOS 6.6 install JDK7 (Linux)

- Linux Getting Started tutorial: Experience QEMU virtual machine articles (Linux)

- How to use Git to upload code to GitHub project (Linux)

- Remote installation of Net-SNMP whole process (Linux)

- Spacewalk Linux system configuration and installation (Linux)

- Ten SCP transfer command example (Linux)

- Can not empty the Recycle Bin to repair problems in Ubuntu 14.04 (Linux)

- Ubuntu install Lighttpd + Mono support .net (Linux)

- Impact test noatime Linux file access time (Linux)

- Let OS X support NTFS write file (Linux)

- Lucene Getting Started Tutorial (Server)

- Oracle utilized undo data recovery operations (Database)

- imp / exp Oracle Database import and export commands (Database)

- Ubuntu use three methods to install Ruby (Linux)

- Spark On YARN cluster installation deployment (Server)

- Installation and management of Linux applications (Linux)

- Linux maximum number of threads and limit the number of queries the current thread (Linux)

- Linux shell script debugging (Linux)

- Use Markdown editor for document work under Linux (Linux)

- Linux Network Programming --epoll model Detailed principles and examples (Programming)

 
         
  Zabbix monitors the status of TCP connections
     
  Add Date : 2017-08-31      
         
       
         
  Tcp connection status for our web server is critical, especially the amount of concurrency ESTAB; or syn_recv value, if the value is relatively large, then we can think is not under attack, or the value of time_wait is relatively high , We need to consider to see whether we need to tune the kernel, too high time_wait value will take up too many ports, if the port less then the consequences would be disastrous:

First, the list of scripts:

#! / Bin / bash
#xiaoluo
#scripts for tcp status
Function SYNRECV {
Grep 'SYN-RECV' | awk '{print $ 2} $ {$ s [$ 1]} END {for (k in s) print k, s [k] ''
}}
Function ESTAB {
/ Usr / sbin / ss -ant | awk '{++ s [$ 1]} END {for (k in s) print k, s [k]}' | grep 'ESTAB' | awk '{print $ 2}
}}
Function FINWAIT1 {
Awk '{++ s [$ 1]} END {for (k in s) print k, s [k]}' | grep 'FIN-WAIT-1' | awk { $ 2} '
}}
Function FINWAIT2 {
Awk '{++ s [$ 1]} END {for (k in s) print k, s [k]}' | grep 'FIN-WAIT-2' | awk { $ 2} '
}}
Function TIMEWAIT {
Grep 'TIME-WAIT' | awk '{print $ 2} $ {$ s [$ 1]} END {for (k in s) print k, s [k] ''
}}
Function LASTACK {
Grep 'LAST-ACK' | awk '{print $ 2} $ {$ s [$ 1]} END {for (k in s) print k, s [k] ''
}}
Function LISTEN {
/ Usr / sbin / ss -ant | awk '{++ s [$ 1]} END {for (k in s) print k, s [k]}' | grep 'LISTEN' | awk '{print $ 2}
}}
$ 1

Second, fill in the key value: Of course, we join the key value of the best after the server to perform the above to see if there is no return value:

[Root @ WEB_007 scripts] # cat /usr/local/zabbix/etc/zabbix_agentd.conf.d/tcp
#monitor tcp
UserParameter = tcp [*], / usr / local / zabbix / scripts / tcp_status $ 1

Third, the import template (in my annex, and then trigger the adjustment according to their own situation :)

In writing this time just finished monitoring the activities of lvs connection. The following are also given templates, we download, I am here to give the script and key:

First, the script:

#! / Bin / bash
#xiaoluo
#status about lvs forward
Function first {
/ Sbin / ipvsadm -L 2> / dev / null | grep '192.168.10.234:http' | sed '2d' | awk '{print $ 5}'
}}
Function second {
/ Sbin / ipvsadm -L 2> / dev / null | grep '192.168.10.235:http' | sed '2d' | awk '{print $ 5}'
}}
Function third {
/ Sbin / ipvsadm -L 2> / dev / null | grep '192.168.10.236:http' | sed '2d' | awk '{print $ 5}'
}}
$ 1

Second, the key:
#monitor lvs
UserParameter = lvs [*], / usr / local / zabbix / scripts / ipvsadm_status $ 1
     
         
       
         
  More:      
 
- Talk about the Linux ABI compatibility Application (Linux)
- Linux centos rm directory does not prompt (Linux)
- Oracle Execute to Parse perform analytical Ratio Analysis (Database)
- Use SVN to automatically deploy code under Apache (Server)
- How to configure Apache Solr on Ubuntu 14/15 (Server)
- PHP interview questions of design patterns (Programming)
- The security administrator network analysis tools SATAN Introduction under Linux (Linux)
- Android basics summary article (Programming)
- sed and awk in shell usage and some examples (Linux)
- How to use Git to upload code to GitHub project (Linux)
- MYSQL root password for the database user passwords are weak attack analysis (Linux)
- Shell scripts to copy all directories under the current directory of a certain type of file to the same directory (Linux)
- Orabbix binding Python send graphical reports (Linux)
- Ubuntu 14.10 Server configuration wireless Internet access (Server)
- Ubuntu install Avast antivirus software (Programming)
- VPN built on CentOS (Server)
- Ubuntu How to mount iso file (Linux)
- Use cmake to compile and install MySQL 5.5 (Database)
- Binary Tree Traversal (Linux)
- Debian Stable (Jessie 8.1) of normal.mod not found (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.