Monitor uptime for multiple URL through heartbeat

Hi Community,

My goal is to monitor uptime for each service. so, we are trying to configure heartbeat to monitor multiple URL to get uptime for each service however heartbeat is considering last http input rather all http inputs under heartbeat.monitors.

Kindly suggest what is the issue and how to fix it.

Below is my configuration:

heartbeat.monitors:
- type: http
  # Set enabled to true (or delete the following line) to enable this monitor
  enabled: true
  # ID used to uniquely identify this monitor in Elasticsearch even if the config changes
  id: MasterAdmin
  # Human readable display name for this service in Uptime UI and elsewhere
  name: MasterAdmin
  # List of URLs to query
  urls: ["https://kyn-aa-01.kyndleit.com:7002/mabamlogin.htm"]
  ssl:
    certificate_authorities: ['C:\Program Files\heartbeat-agent\aa.pem']
  # Configure task schedule
  schedule: '@every 10s'
  # Total test connection and data exchange timeout
  #timeout: 16s
  # Name of corresponding APM service, if Elastic APM is in use for the monitored service.
  service.name: MasterAdmin
 
- type: http
  # Set enabled to true (or delete the following line) to enable this monitor
  enabled: true
  # ID used to uniquely identify this monitor in Elasticsearch even if the config changes
  id: AdminConsole
  # Human readable display name for this service in Uptime UI and elsewhere
  name: AdminConsole
  # List of URLs to query
  urls: ["https://kyn-aa-01.kyndleit.com:7002/adminlogin.htm"]
  ssl:
    certificate_authorities: ['C:\Program Files\heartbeat-agent\aa.pem']
  # Configure task schedule
  schedule: '@every 10s'
  # Total test connection and data exchange timeout
  #timeout: 16s
  # Name of corresponding APM service, if Elastic APM is in use for the monitored service.
  service.name: AdminConsole

Regards,
Eshwar

Hello @Eshwar_K

I tried monitoring 2 HTTP URL's and did not see any issues :

# Configure monitors inline
heartbeat.monitors:
- type: http
  enabled: true
  id: MasterAdmin
  name: MasterAdmin
  urls: ["https://google.com"]
  schedule: '@every 10s'
  service.name: MasterAdmin
 
- type: http
  enabled: true
  id: AdminConsole
  name: AdminConsole
  urls: ["https://google.com"]
  schedule: '@every 10s'
  service.name: AdminConsole

Could you please review the heartbeat.yml as formatting should be proper & any issue with that can cause problem. Also can review the heartbeat logs post starting the service to see what it is loading & where is the problem because of which it is only able to monitor 1 URL & not both the URL's

Thanks!!

Hi @Tortoise ,

Thank you for your quick response.

It was my mistake as I had given same id for multiple http inputs. I realized and changed it to different ids. It is working as expected now.

Thank you once again.

Regards,
Eshwar

1 Like