
Linux下长时间ping网络加时间戳并记录到文本
而想给网站添加文章、更改站点、更换模板,就要到后台,wordpress的默认后台地址是你的域名/wp-admin,访问此地址,输入用户名、密码,就进入后台wordpress的后台了。在8051中断系统中,一个中断源都分配一个固定的中断服程序入口地址,通常称为中断向量,cpu响应中断时,硬件自动形成各自的入口地址,由此进入中断服务程序lunix 时间戳lunix 时间戳,从而实现了正确的转移。需求产生原因:某些使用php作为后台语言的网站可能会有调用python等脚本语言的需求.例如我最近在做的数据处理工作 中,由于所需处理的文本数目过大,难以人工分类,所以需要一个文本分类函数,接受传入的文章输出文章应 有的分类. 然而php却没有可靠的实现方法. 这时,就需要php调用python等脚本辅助处理.。
首先是长时间ping,这个非常简单,使用参数-c即可:
[root@test ~]# ping 192.168.2.1 -c 10
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.638 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.341 ms
64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=0.291 ms

64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=0.259 ms
64 bytes from 192.168.1.101: icmp_seq=4 ttl=128 time=4.31 ms。64 bytes from 192.168.1.101: icmp_seq=2 ttl=128 time=7.07 ms。64 bytes from 192.168.1.101: icmp_seq=1 ttl=128 time=3.95 ms。
64 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=0.339 ms
64 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=0.243 ms
64 bytes from 192.168.2.1: icmp_seq=8 ttl=64 time=0.234 ms
64 bytes from 192.168.2.1: icmp_seq=9 ttl=64 time=0.333 ms
64 bytes from 192.168.2.1: icmp_seq=10 ttl=64 time=0.284 ms
--- 192.168.2.1 ping statistics ---

2 packets transmitted, 1 received, 50% packet loss, time 1000ms。4 packets transmitted, 4 received, 0% packet loss, time 3004ms。3 packets transmitted, 3 received, 0% packet loss, time 1999ms。
rtt min/avg/max/mdev = 0.234/0.330/0.638/0.109 ms
上面我们ping了10次,每次的时间1秒,因此比如你要ping连天那么就是60*60*24*2=172800。
接下来是加时间戳:
wss8848@ubuntu:~$ netstat -nat | grep "192.168.1.15:22" |awk '{print $5}'|awk -f: '{print $1}'|sort|uniq -c|sort -nr|head -20。wss8848@ubuntu:~$ netstat -nat | grep "192.168.1.15:22" |awk '{print $5}'|awk -f: '{print $1}'|sort|uniq -c|sort -nr|head -2018 221.136.168.363 154.74.45.2422 78.173.31.2362 62.183.207.982 192.168.1.142 182.48.111.2152 124.193.219.342 119.145.41.22 114.255.41.301 75.102.11.99。命令:netstat-nat|grep"192.168.120.20:16067"|awk'{print$5}'|awk-f:'{print$4}'|sort|uniq-c|sort-nr|head-20。
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 10:30:21
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.436 ms 10:30:21
64 bytes from 192.168.1.101: icmp_seq=4 ttl=128 time=4.31 ms。64 bytes from 192.168.1.101: icmp_seq=2 ttl=128 time=7.07 ms。64 bytes from 192.168.1.101: icmp_seq=1 ttl=128 time=3.95 ms。

64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=0.368 ms 10:30:23
64 bytes from 192.168.1.101: icmp_seq=3 ttl=128 time=4.46 ms。64 bytes from 192.168.1.101: icmp_seq=1 ttl=128 time=3.95 ms。64 bytes from 192.168.1.101: icmp_seq=2 ttl=128 time=7.07 ms。
64 bytes from 192.168.1.101: icmp_seq=4 ttl=128 time=4.31 ms。64 bytes from 192.168.1.101: icmp_seq=2 ttl=128 time=7.07 ms。64 bytes from 192.168.1.101: icmp_seq=1 ttl=128 time=3.95 ms。
64 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=0.360 ms 10:30:26
64 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=0.319 ms 10:30:27
64 bytes from 192.168.2.1: icmp_seq=8 ttl=64 time=0.274 ms 10:30:28
64 bytes from 192.168.1.101: icmp_seq=4 ttl=128 time=4.31 ms。64 bytes from 192.168.1.101: icmp_seq=2 ttl=128 time=7.07 ms。64 bytes from 192.168.1.101: icmp_seq=3 ttl=128 time=4.46 ms。
64 bytes from 192.168.1.101: icmp_seq=3 ttl=128 time=4.46 ms。64 bytes from 192.168.1.101: icmp_seq=2 ttl=128 time=7.07 ms。64 bytes from 192.168.1.101: icmp_seq=1 ttl=128 time=3.95 ms。

10:30:30
--- 192.168.2.1 ping statistics --- 10:30:30
10 packets transmitted, 10 received, 0% packet loss, time 9000ms 10:30:30
rtt min/avg/max/mdev = 0.265/0.331/0.436/0.052 ms 10:30:30
然后我们把信息输出到文本:
[root@andy ~]# netstat -nat | grep "192.168.120.20:16067" |awk '{print $5}'|awk -f: '{print $4}'|sort|uniq -c|sort -nr|head -20。wss8848@ubuntu:~$ netstat -nat | grep "192.168.1.15:22" |awk '{print $5}'|awk -f: '{print $1}'|sort|uniq -c|sort -nr|head -20。命令:netstat-nat|grep"192.168.120.20:16067"|awk'{print$5}'|awk-f:'{print$4}'|sort|uniq-c|sort-nr|head-20。
[root@test ~]# cat ping.log
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 10:37:23
64 bytes from 192.168.1.101: icmp_seq=3 ttl=128 time=4.46 ms。64 bytes from 192.168.1.101: icmp_seq=2 ttl=128 time=7.07 ms。eq=5 ttl=255 time=27 ms64.bytes from 129.35.34.234: icmp_seq=6 ttl=255 time=30 ms64.bytes from 129.35.34.234: icmp_seq=7 ttl=255 time=31 ms64.bytes from 129.35.34.234: icmp_seq=8 ttl=255 time=33 ms64.。
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-117330-1.html
伊拉克人民或许会投你的票