![GitHub repo size](https://img.shields.io/github/repo-size/spook/sshping)
# sshping
ssh-based ping: measure character-echo latency and bandwidth for an interactive ssh session
## Description
Use this utility to test the performance of interactive ssh sessions
or scp file transfers. It uses ssh to log into a remote system, then
runs two tests: the first test sends one character at a time, waiting
for each character to be returned while it records the latency time
for each. The second test sends a dummy file over scp to /dev/null
on the remote system.
For the echo test, you may specify a character count limit (-c) or a test
time limit (-t), and also the command (-e) used on the remote system that
echoes characters back.
For the speed test, you may specify the number of megabytes to send (-s)
and the target location for the copies (-z).
The default output format is RFC-2822 compliant with simple integers so
parsing is easy. You may also display delimiters to make reading of
large numbers easier, or you may use a "human readable" format that
displays values using SI prefixes to keep the numberic value small.
## Usage
```
Usage: sshping [options] [user@]addr[:port]
SSH-based ping that measures interactive character echo latency
and file transfer throughput. Pronounced "shipping".
Options:
-b --bindaddr IP Bind to this source address
-c --count NCHARS Number of characters to echo, default 1000
-d --delimited Use delimiters in big numbers, eg 1,234,567
-e --echocmd CMD Use CMD for echo command; default: cat > /dev/null
-f --config-file F Read the ssh config file F for options
-h --help Print usage and exit
-H --human-readable Use flesh-friendly units
-i --identity FILE Identity file, ie ssh private keyfile
-p --password PWD Use password PWD (can be seen, use with care)
-P --ping-summary Append measurements in ping-like rtt line format
-r --runtests e|s Run tests e=echo s=speed; default es=both
-s --size MB For speed test, send/recv MB megabytes; default=8 MB
-t --time SECS Time limit for echo test
-T --connect-time S Time limit for ssh connection; default 10 sec
-v --verbose Show more output, use twice for lots: -vv
-z --remote FILE Remote file for up/download tests;
default=/tmp/sshping-PID.tmp
```
### Examples
```
# bin/sshping -d cheyenne.example.com
ssh-Login-Time: 1,835,377,610 ns
Minimum-Latency: 548,993 ns
Median-Latency: 698,494 ns
Average-Latency: 704,123 ns
Average-Deviation: 72,839 ns
Maximum-Latency: 1,075,017 ns
Echo-Count: 1,000 B
Upload-Size: 8,000,000 B
Upload-Rate: 9,371,579 B/s
Download-Size: 8,000,000 B
Download-Rate: 5,493,034 B/s
# bin/sshping -H cheyenne.example.com
ssh-Login-Time: 1.84 s
Minimum-Latency: 633 us
Median-Latency: 751 us
Average-Latency: 764 us
Average-Deviation: 63.7 us
Maximum-Latency: 1.15 ms
Echo-Count: 1.00 kB
Upload-Size: 8.00 MB
Upload-Rate: 9.33 MB/s
Download-Size: 8.00 MB
Download-Rate: 5.48 MB/s
```
## Building
Install the libssh-dev (or libssh-devel) package, version 0.6 or later:
sudo apt-get install libssh-dev
...or
sudo yum install libssh-devel
...or whatever works on your platform
From the main directory (where this README.md file is located), run 'make':
cd sshping
make
The resultant binary will be in the bin/ directory. You may copy this to
your system binary location, for example:
sudo cp bin/sshping /usr/local/bin/
sudo chown root.root /usr/local/bin/sshping
sudo chmod 555 /usr/local/bin/sshping
To build the man pages, install the pod2man utility (you may already
have it installed, it's often part of standard Perl). Then run 'make man'.
The resulting uncompressed man page will be in the doc/ directory.
You can view it from there (man doc/sshping.8) but normally it's placed
in /usr/share/man/man8 in gzip'd format:
sudo cp doc/sshping.8 /usr/share/man/man8/
sudo gzip /usr/share/man/man8/sshping.8
sudo chown root.root /usr/share/man/man8/sshping.8.gz
sudo chmod 644 /usr/share/man/man8/sshping.8.gz
That's it!
### Building with CMake
You can build this with CMake, which includes creating .deb
or .rpm packages. Here's how:
First, install libssh as above. It's a prerequisite.
And of course you need CMake.
Then from the main directory (where this README.md file is located):
mkdir build
cd build
cmake ..
make
make package
You will find the binary `sshping` as well as the .deb and/or .rpm
file in the current (build) directory. Install those as you
would any other package.
Or you can directly install on the current system with:
sudo make install
Enjoy!
没有合适的资源?快使用搜索试试~ 我知道了~
基于 ssh 的 ping:测量字符回显延迟和带宽_C++_代码_相关文件_下载
共10个文件
makefile:1个
svg:1个
gitignore:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 58 浏览量
2022-07-11
23:36:46
上传
评论
收藏 3.38MB ZIP 举报
温馨提示
基于 ssh 的 ping:测量交互式 ssh 会话的字符回显延迟和带宽 描述 使用此实用程序测试交互式 ssh 会话或 scp 文件传输的性能。它使用 ssh 登录远程系统,然后运行两个测试:第一个测试一次发送一个字符,等待每个字符返回,同时记录每个字符的延迟时间。第二个测试通过 scp 向远程系统上的 /dev/null 发送一个虚拟文件。 对于回显测试,您可以指定字符计数限制 (-c) 或测试时间限制 (-t),还可以指定远程系统上用于回显字符的命令 (-e)。 对于速度测试,您可以指定要发送的兆字节数 (-s) 和副本的目标位置 (-z)。 默认输出格式是符合 RFC-2822 的简单整数,因此解析很容易。您还可以显示分隔符以更轻松地读取大数字,或者您可以使用“人类可读”格式显示使用 SI 前缀的值以保持数字值较小。 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
sshping-master.zip (10个子文件)
sshping-master
bin
.gitignore 71B
sshping-intro.svg 66KB
LICENSE 1KB
src
sshping.cxx 34KB
ext
optionparser.h 99KB
doc
sshping.pod 7KB
CMakeLists.txt 2KB
Makefile 697B
README.md 5KB
sshping-intro.webm 3.64MB
共 10 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- unity开发教程.docx
- 代码使用Pygame库实现了一个简单的烟花模拟 核心逻辑包括烟花和粒子类的定义,处理位置、爆炸、尾迹和绘制等操作
- Matlab Simulink 电力电子仿真-Flyback(反激电路)电路分析
- tudou-android-release.apk
- 数据分析教程.docx
- 基于matlab实现用有限元法计算电磁场的Matlab工具 .rar
- 基于matlab实现有限元算法 计算电磁场问题 边界条件包括第一类边界和第二类边界.rar
- 基于matlab实现用于计算不同车重下的电动汽车动力性和经济性.rar
- 基于matlab实现遗传算法求解多车场车辆路径问题 有多组算例可以用.rar
- 浏览器.apk
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功