GBase 8a
运维管理
文章

tcping安装和使用

发表于2024-12-31 11:47:4227次浏览1个评论

参考链接:

https://www.cnblogs.com/rui517hua20/p/12985466.html

 

1、操作系统

CentOS6+/Debian7+/Ubuntu12+

2、安装依赖

这里用到的是tcptraceroute和bc

yum install -y tcptraceroute bc

# CentOS系统 用这个

 

apt-get install -y tcptraceroute bc

# Debian/Ubuntu系统 用这个 

 

3、安装TCPING

方式一:

// 切换目录

cd /usr/bin

// 下载TCP-PING文件,并重命名为tcping

wget -O tcping https://soft.mengclaw.com/Bash/TCP-PING

//  赋予执行权限

chmod +x tcping

 

方式二:

// 下面文件上传到主机上;

// 修改文件名

mv TCP-PING tcping

//  复制文件

cp tcping /usr/local/bin/

//  赋予执行权限

chmod +x tcping

 

4、使用TCPING

# 用法:tcpping [-d] [-c] [-C] [-w sec] [-q num] [-x count] ipaddress [port]

# -d 在每个响应时间前,打印时间戳

# -c 以列表形式显示

# -C 输出类似于fping工具中-C选项的结果

 

# -w 等待时间(默认 3)

# -r 每N秒重试一次(默认 1)

# -x 限定测试总时长 (默认 无限)

 

 

示例:我们要用到百度官网的IP:119.75.217.109 以及他的TCP端口:80 

[root@localhost ~]# tcping 119.75.217.109 80

 

traceroute to 119.75.217.109 (119.75.217.109), 255 hops max, 60 byte packets

seq 0: tcp response from 119.75.217.109 (119.75.217.109) <syn,ack>  174.357 ms

traceroute to 119.75.217.109 (119.75.217.109), 255 hops max, 60 byte packets

seq 1: tcp response from 119.75.217.109 (119.75.217.109) <syn,ack>  188.953 ms

 

 

评论

登录后才可以发表评论
GBase用户51935发表于 2个月前
来了