首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在heartbeat.yml中添加更多监视器?

如何在heartbeat.yml中添加更多监视器?
EN

Stack Overflow用户
提问于 2019-10-14 06:54:50
回答 1查看 1.2K关注 0票数 1

我正在Kibana试用的正常时间功能。我下载了“心跳”并使用默认设置运行了它。它可以正常工作。

但是,当我试图在heartbeat.monitorsheartbeat.yml中添加更多监视器时。我遇到了一个错误。

下面是缺省值,它运行正常。

haertbeat.yml

代码语言:javascript
复制
# Configure monitors inline
heartbeat.monitors:
- type: http

  # List or urls to query
  urls: ["http://localhost:9200"]

  # Configure task schedule
  schedule: '@every 10s'

  # Total test connection and data exchange timeout
  #timeout: 16s  

但是,当我添加以下内容时,会得到一个错误。

代码语言:javascript
复制
# Configure monitors inline
heartbeat.monitors:
- type: http

  # List or urls to query
  urls: ["http://localhost:9200"]

  # Configure task schedule
  schedule: '@every 10s'

  # Total test connection and data exchange timeout
  #timeout: 16s  
- type: icmp                       <------ When I try to add tcp or icmp,
   schedule: '@every 10s'          <------ I get an error. I am doing something
   hosts: ["localhost"]            <------  wrong. How can I add more monitors?
代码语言:javascript
复制
PS C:\Program Files\Heartbeat> Start-Service heartbeat
Start-Service : Service 'heartbeat (heartbeat)' cannot be started due to the following error: Cannot start service heartbeat on computer '.'.
At line:1 char:1
+ Start-Service heartbeat
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

当我删除我想要添加的内容时,效果很好。如何在heartbeat.yml中添加更多监视器

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-14 12:13:25

我坚信这是YAML文件中的缩进问题。

看看您的icmp监视器:

代码语言:javascript
复制
- type: icmp                       <------ When I try to add tcp or icmp,
   schedule: '@every 10s'          <------ I get an error. I am doing something
   hosts: ["localhost"]            <------  wrong. How can I add more monitors?

schedulehosts设置之前有空白。

现在看看默认监视器:

代码语言:javascript
复制
heartbeat.monitors:
- type: http

  # List or urls to query
  urls: ["http://localhost:9200"]

  # Configure task schedule
  schedule: '@every 10s'

  # Total test connection and data exchange timeout
  #timeout: 16s  

type字段下对齐设置并再次运行。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58371483

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档