本帖最后由 gongguan 于 2011-12-01 16:55 编辑
如果长时间ping可以
[root@samba ~]# pwd
/root
[root@samba ~]# nohup ping 192.168.0.1 &
[1] 27436
[root@samba ~]# crontab -e
*/2 * * * * date >> /root/nohup.out
得出的结果如下:
64 bytes from 192.168.0.1: icmp_seq=122 ttl=128 time=0.546 ms
64 bytes from 192.168.0.1: icmp_seq=123 ttl=128 time=0.728 ms
64 bytes from 192.168.0.1: icmp_seq=124 ttl=128 time=0.661 ms
64 bytes from 192.168.0.1: icmp_seq=125 ttl=128 time=0.593 ms
64 bytes from 192.168.0.1: icmp_seq=126 ttl=128 time=0.524 ms
64 bytes from 192.168.0.1: icmp_seq=127 ttl=128 time=0.708 ms
64 bytes from 192.168.0.1: icmp_seq=128 ttl=128 time=0.641 ms
64 bytes from 192.168.0.1: icmp_seq=129 ttl=128 time=0.572 ms
64 bytes from 192.168.0.1: icmp_seq=130 ttl=128 time=0.505 ms
64 bytes from 192.168.0.1: icmp_seq=131 ttl=128 time=0.689 ms
64 bytes from 192.168.0.1: icmp_seq=132 ttl=128 time=0.622 ms
Thu Dec 1 16:50:01 CST 2011
64 bytes from 192.168.0.1: icmp_seq=133 ttl=128 time=0.550 ms
64 bytes from 192.168.0.1: icmp_seq=134 ttl=128 time=0.485 ms
64 bytes from 192.168.0.1: icmp_seq=135 ttl=128 time=0.670 ms
64 bytes from 192.168.0.1: icmp_seq=136 ttl=128 time=0.601 ms
64 bytes from 192.168.0.1: icmp_seq=137 ttl=128 time=0.535 ms
64 bytes from 192.168.0.1: icmp_seq=138 ttl=128 time=0.718 ms
64 bytes from 192.168.0.1: icmp_seq=139 ttl=128 time=0.651 ms
64 bytes from 192.168.0.1: icmp_seq=140 ttl=128 time=0.583 ms
64 bytes from 192.168.0.1: icmp_seq=141 ttl=128 time=0.516 ms
64 bytes from 192.168.0.1: icmp_seq=142 ttl=128 time=0.698 ms
64 bytes from 192.168.0.1: icmp_seq=143 ttl=128 time=0.632 ms
64 bytes from 192.168.0.1: icmp_seq=144 ttl=128 time=0.564 ms
64 bytes from 192.168.0.1: icmp_seq=145 ttl=128 time=0.747 ms
比较适合长时间监测。 多长时间插入时间戳 自己定义。