JSPM

node-red-node-ping-zh

0.3.7
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q45343F
  • License Apache-2.0

用于ping远程服务器的Node-RED节点,用作保活检查(中文版)

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-red-node-ping-zh) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    node-red-node-ping-zh

    一个用于ping远程服务器的Node-RED节点,用作保活检查。

    安装

    使用编辑器 - 菜单 - 管理调色板 - 导入选项,或在Node-RED用户目录中运行以下命令 - 通常是 ~/.node-red

    npm install node-red-node-ping-zh

    注意事项

    1. Ubuntu Snap容器是严格的,不喜欢给外部命令(如ping)外部访问。要允许ping工作,必须手动添加网络观察接口

      sudo snap connect node-red:network-observe

    2. 在某些版本的Raspbian(树莓派)上,ping似乎是仅限root用户的命令。 修复方法如下

    sudo setcap cap_net_raw=ep /bin/ping
    sudo setcap cap_net_raw=ep /bin/ping6

    使用方法

    Ping一个或多个设备,并以毫秒为单位返回往返时间作为msg.payload

    如果未收到响应或主机无法解析,则返回布尔值false

    如有必要,msg.error将包含任何错误消息。

    msg.topic包含目标主机的IP地址。

    有两种模式 - 定时触发

    • 定时模式 - 这是默认模式,按定时方式ping您的设备。默认ping间隔为20秒,但可以配置。
    • 触发模式 - 此模式允许您通过输入消息触发ping。如果目标留空且msg.payload是字符串或数组,您可以按需ping一个或多个设备。

    有关更多详细信息,请参阅侧边栏信息面板中的内置帮助。