junipernetworks.junos.junos_ping 模块 – 使用来自运行 Juniper JUNOS 设备的 ping 测试可达性
注意
此模块是 junipernetworks.junos 集合(版本 9.1.0)的一部分。
如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install junipernetworks.junos。
要在 playbook 中使用它,请指定:junipernetworks.junos.junos_ping。
junipernetworks.junos 1.0.0 中的新增功能
概要
- 使用来自运行 Juniper JUNOS 设备的 ping 测试到远程目标的可达性。 
- 已针对 Junos (17.3R1.10) 进行测试 
- 有关通用网络模块,请参阅 ansible.netcommon.net_ping 模块。 
- 对于 Windows 目标,请改用 ansible.windows.win_ping 模块。 
- 对于运行 Python 的目标,请改用 ansible.builtin.ping 模块。 
参数
| 参数 | 注释 | 
|---|---|
| 要发送以检查可达性的数据包数量。 默认值:  | |
| 远程节点的 IP 地址或主机名(可由设备解析)。 | |
| 确定是否设置 DF 位。 选择 
 | |
| 发送 ping 数据包时使用的源接口。 | |
| 确定连续 ping 之间的间隔(以秒为单位)。 | |
| 确定是否快速发送数据包。 选择 
 | |
| 确定 ping 数据包的大小(以字节为单位)。 | |
| 发送 ping 数据包时使用的 IP 地址。 | |
| 确定预期结果是成功还是失败。 选择 
 | |
| ICMP 数据包的生存时间值。 | 
注释
注意
- 有关通用网络模块,请参阅 ansible.netcommon.net_ping 模块。 
- 对于 Windows 目标,请改用 ansible.windows.win_ping 模块。 
- 对于运行 Python 的目标,请改用 ansible.builtin.ping 模块。 
- 此模块仅适用于 - network_cli连接。
- 有关使用 CLI 和 netconf 的信息,请参阅 :ref:`Junos OS 平台选项指南 <junos_platform_options>` 
- 有关使用 Ansible 管理网络设备的更多信息,请参阅 :ref:`Ansible 网络指南 <network_guide>` 
- 有关使用 Ansible 管理 Juniper 网络设备的更多信息,请参阅 https://ansible.org.cn/ansible-juniper。 
示例
- name: Test reachability to 10.10.10.10
  junipernetworks.junos.junos_ping:
    dest: 10.10.10.10
- name: Test reachability to 10.20.20.20 using source and size set
  junipernetworks.junos.junos_ping:
    dest: 10.20.20.20
    size: 1024
    ttl: 128
- name: Test unreachability to 10.30.30.30 using interval
  junipernetworks.junos.junos_ping:
    dest: 10.30.30.30
    interval: 3
    state: absent
- name: Test reachability to 10.40.40.40 setting count and interface
  junipernetworks.junos.junos_ping:
    dest: 10.40.40.40
    interface: fxp0
    count: 20
    size: 512
- name: Test reachability to 10.50.50.50 using do-not-fragment and rapid
  junipernetworks.junos.junos_ping:
    dest: 10.50.50.50
    df_bit: true
    rapid: true
返回值
常见的返回值记录在 此处,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 发送的命令列表。 已返回: 总是 示例:  | |
| 丢失的数据包百分比。 已返回: 总是 示例:  | |
| 成功接收的数据包。 已返回: 总是 示例:  | |
| 成功传输的数据包。 已返回: 总是 示例:  | |
| 往返时间 (RTT) 统计信息。 已返回: 当 ping 成功时 示例:  | 
