太博士 發表於 2019-7-25 12:35:00

CentOS 7 安装 fping

<h2>CentOS 7.6.1810 安装 fping 3.15</h2>
<p>1、创建安装目录</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">mkdir</span> -p /usr/local/fping &amp;&amp; cd /usr/local/fping</pre>
</div>
<p>2、下载 fping3.15 安装包</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">wget</span> http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">fping.org/dist/fping-3.15.tar.gz</span></pre>
</div>
<p>3、解压安装包</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">tar</span> -zxvf fping-<span style="color: rgba(128, 0, 128, 1)">3.15</span>.<span style="color: rgba(0, 0, 255, 1)">tar</span>.gz &amp;&amp; cd fping-<span style="color: rgba(128, 0, 128, 1)">3.15</span></pre>
</div>
<p>4、编译安装</p>
<div class="cnblogs_code">
<pre>./configure --prefix=/usr/local/fping &amp;&amp; <span style="color: rgba(0, 0, 255, 1)">make</span> &amp;&amp; <span style="color: rgba(0, 0, 255, 1)">make</span> <span style="color: rgba(0, 0, 255, 1)">install</span></pre>
</div>
<p>5、配置环境变量,并使其生效</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">sed</span> -i <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">1i\export PATH=$PATH:/usr/local/fping/sbin</span><span style="color: rgba(128, 0, 0, 1)">'</span> /etc/profile &amp;&amp; source /etc/profile</pre>
</div>
<p>6、配置环境变量永久生效</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">echo</span> <span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">export PATH=$PATH:/usr/local/fping/sbin</span><span style="color: rgba(128, 0, 0, 1)">"</span> &gt;&gt; /etc/bashrc</pre>
</div>
<p>7、测试成功与否?</p>
<div class="cnblogs_code">
<pre>fping -v</pre>
</div>
<p>&nbsp;</p>
<h3>帮助文件</h3>
<p>常用:&nbsp;fping -Asg 192.168.1.0/24  #以IP显示是否在线,并打印出报告</p>
<p>Usage(用法): fping [选项] [目标...]</p>
<p>-a    显示目标地址是否在线<br>   -A         以IP地址显示,并判断是否在线<br>   -b n  &nbsp;发送ping的数据包量,以字节为单位 (默认 56),n写成数量,以下参数同此<br>   -B f &nbsp; &nbsp;设置指数回退因素为f<br>   -c n &nbsp; 计算要发送到每个目标的ping信号 (默认发送 1 个包)<br>   -C n  功能同-c,报告结果更详细<br>   -D   在每个输出行打印时间戳<br>   -e   显示返回包的运行时间<br>   -f file 从文件中读取目标列表 ( - means stdin) (only if no -g specified)</p>
<p>   -g  &nbsp; 生成目标列表 (only if no -f specified)<br>                    (在目标列表中指定开始和结束IP, 或者提供一个IP网络掩码)<br>                    (ex. fping -g 192.168.1.0 192.168.1.255 or fping -g 192.168.1.0/24)</p>
<p>   -H n &nbsp; 设置IP TTL值(Time To Live hops)<br>   -i n &nbsp; &nbsp;发送ping包之间的间隔 (in millisec毫秒) (default 25)<br>   -I  &nbsp; &nbsp;如果绑定到特定接口<br>   -l  &nbsp; &nbsp;loop sending pings forever永不<br>   -m  &nbsp;ping目标主机上的多个接口<br>   -M  &nbsp;设置Don't Fragment标志<br>   -n  &nbsp; 按名称显示目标 (-d is equivalent等效的)<br>   -N   为网络数据输出兼容(-l -Q are required必须的)<br>   -o  &nbsp;显示累计停机时间 (lost packets * packet interval 间隔)<br>   -O n  在ICMP包上设置服务类型(tos)标志</p>
<p>   -p n &nbsp; ping包到一个目标之间的间隔 (in millisec)<br>                    (in looping and counting modes, default 1000)</p>
<p>   -q  &nbsp; 安静模式 (don't show per-target/per-ping results)<br>   -Q n &nbsp; 功能如同 -q,&nbsp;每n秒显示摘要<br>   -r n  &nbsp; 重复次数 (default 3)<br>   -R  &nbsp; 随机分组数据 (to foil阻止 link data compression压缩)<br>   -s  &nbsp; &nbsp;打印最后的统计数据<br>   -S  &nbsp; 设置源地址<br>   -t n &nbsp; &nbsp; 单个目标初始超时 (in millisec) (default 500)<br>   -T n &nbsp; &nbsp;忽略(for compatibility兼容性 with fping 2.4)<br>   -u  &nbsp; &nbsp;显示目标不可达<br>   -v  &nbsp; &nbsp;显示版本<br>   要检查的目标列表 (if no -f specified)</p>
<p>&nbsp;</p>
<h3>English Version</h3>
<p>fping: Version 3.15</p>
<p>fping: comments to david@schweikert.ch</p>
<p>Usage: fping <br>   -a  &nbsp; show targets that are alive<br>   -A  &nbsp; show targets by address<br>   -b n  amount of ping data to send, in bytes (default 56)<br>   -B f   set exponential backoff factor to f<br>   -c n  count of pings to send to each target (default 1)<br>   -C n  same as -c, report results in verbose format<br>   -D  &nbsp; &nbsp;print timestamp before each output line<br>   -e  &nbsp; &nbsp;show elapsed time on return packets<br>   -f file  read list of targets from a file ( - means stdin) (only if no -g specified)<br>   -g  &nbsp; &nbsp; generate target list (only if no -f specified)<br>                (specify the start and end IP in the target list, or supply a IP netmask)<br>                (ex. fping -g 192.168.1.0 192.168.1.255 or fping -g 192.168.1.0/24)<br>   -H n  Set the IP TTL value (Time To Live hops)<br>   -i n  &nbsp; interval between sending ping packets (in millisec) (default 25)<br>   -I  &nbsp; &nbsp; &nbsp;if      bind to a particular interface<br>   -l  &nbsp; &nbsp; &nbsp;loop sending pings forever<br>   -m  &nbsp; &nbsp;ping multiple interfaces on target host<br>   -M  &nbsp; &nbsp;set the Don't Fragment flag<br>   -n  &nbsp; &nbsp; show targets by name (-d is equivalent)<br>   -N  &nbsp; &nbsp; output compatible for netdata (-l -Q are required)<br>   -o &nbsp; &nbsp; &nbsp; &nbsp; show the accumulated outage time (lost packets * packet interval)<br>   -O n&nbsp; &nbsp; &nbsp; &nbsp; set the type of service (tos) flag on the ICMP packets<br>   -p n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;interval between ping packets to one target (in millisec)<br>                (in looping and counting modes, default 1000)<br>   -q&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quiet (don't show per-target/per-ping results)<br>   -Q n&nbsp; &nbsp; &nbsp; &nbsp; same as -q, but show summary every n seconds<br>   -r n &nbsp; &nbsp; &nbsp; number of retries (default 3)<br>   -R &nbsp; &nbsp; &nbsp; &nbsp; random packet data (to foil link data compression)<br>   -s  &nbsp; &nbsp; &nbsp; &nbsp; print final stats<br>   -S &nbsp; &nbsp; &nbsp; &nbsp; addr    set source address<br>   -t n &nbsp; &nbsp; &nbsp; &nbsp;individual target initial timeout (in millisec) (default 500)<br>   -T n &nbsp; &nbsp; &nbsp;ignored (for compatibility with fping 2.4)<br>   -u  &nbsp; &nbsp; &nbsp;show targets that are unreachable<br>   -v  &nbsp; &nbsp; &nbsp;show version<br>   targets    list of targets to check (if no -f specified)</p>

</div>
<div id="MySignature" role="contentinfo">
    运动可以增加体力;读书可以增加知识;
自古只有天才的学生,没有天才的老师;
猴子不上树是看不见红屁股的,
人不做事情是看不出能力的。
时间花在那儿,擅长就在那儿。
钱花完了可以再赚,时间花了便一去不复返。<br><br>
来源:https://www.cnblogs.com/shuter/p/11242932.html
頁: [1]
查看完整版本: CentOS 7 安装 fping