A powerful network analysis shell script

This script features included are: 1, real-time monitor traffic on any network adapter 2, statistics within 10 seconds of the average flow 3, statistics the average flow rate for each port in less than 10 seconds, based on the client-side and server-side port statistics. Which sides you can see relatively large population flows, for a […]

Operation and maintenance shell command

1. Display consumes memory / CPU 10 of the largest processes ps aux | sort -nk +4 | tail -10 ps aux | sort -nk +3 | tail -10 2. view the number of concurrent requests to Apache and the TCP connection state netstat -n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, […]

centos timed release memory script

The following is the script! #!/bin/bash used=free -m | awk ‘NR==2′ | awk ‘{print $3}’ free=free -m | awk ‘NR==2′ | awk ‘{print $4}’ echo “===========================” >> /var/log/mem.log date >> /var/log/mem.log echo “Memory usage | [Use:${used}MB][Free:${free}MB]” >> /var/log/mem.log if [ $free -le 100 ] ; then sync && echo 1 > /proc/sys/vm/drop_caches sync && echo […]

Used to the iptables script

Shell scripting environment a key installation LNMP

Nginx is a high performance HTTP and reverse proxy server. Nginx reverse proxy, Rewrite rule, stability, static file processing, memory consumption is a strong advantage. So the company online and WEB services in most of the test environment uses LNMP environment often LNMP environmental structures, is written in SHELL script below one–click installation script LNMP […]

Simple security logs and statistics under CentOS shell script

It involves sensitive customer information has been processed Following is a detailed explanation:   #!/bin/bash   read -p “please input the path of your logfiles,The Default is current path. (Warning:Do not exists any other files!): ” path     #To accept user input path variable echo “The tool is working, it’s depends on your file […]

CentOS7LVM logical volume partitions automatically expand Shell scripting

Scenarios and known problems: Apply to CentOS6 or CentOS7 (probably available on CentOS4 and earlier versions such as 5) The root file system (extended file system) use LVM to manage, such as the mount command output “/dev/mapper/vg_$hostname-lv_root on/type ext4 (RW)“ contains the “Mapper“ keywords Automatic expansion of the root file system, if you want to […]

Shell scripts to automate daily website access log statistics

Write a shell script that can be used to count the daily access log, and sent e-mail, to facilitate understanding of the site every day situation. Script statistics: 1, totals 2, the total bandwidth 3, the amount of unique visitors 4, access to IP statistics 5, visit url statistics 6, statistical sources 7,404 Statistics 8, […]

CentOS6,7 LVM logical partitions automatic expansion Shell Scripting

Scenarios and known problems: Apply to CentOS6 or CentOS7 (probably available on CentOS4 and earlier versions such as 5) The root file system (extended file system) use LVM to manage, such as the mount command output “/dev/mapper/vg_$hostname-lv_root on/type ext4 (RW)“ contains the “Mapper“ keywords Automatic expansion of the root file system, if you want to […]

Linux system files tamper-script

  Linux system files tamper tamper-proof script script files, a file has been modified, immediately sending alarm messages #!/bin/bash #description: check files shell #author:coralzd powered by www.freebsdsystem.org checkdir=/data/www/bbs.xxx.com ipadd=ifconfig |grep “inet” |cut -c 0-36|sed -e ‘s/[a-zA-Z: ]//g’ |grep -v “127.0.0.1” while [ 1 ] do DATE=date +%Y-%m-%d.%H:%M:%S find ${checkdir} ( -path ${checkdir}/forumdata/threadcaches -o -path ${checkdir}/forumdata_1/threadcaches […]