List of hosts to ping?


(R a V) #1

Hey guys, I was just wondering if it's possible to provide a list of hosts in the "hosts" field for the ping test.
For example, in our case we want to do a ping test to all the servers in the list /tmp/unixhosts. The documentation says comma seperated values.

- type: tcp
  schedule: '@every 60s'
  hosts: ["/tmp/unixhosts"]
  ports: [22]

(Steffen Siering) #2

The hosts field is a list (See Config file format docs). You can either use ['url1', 'url2', ...] or have one URL per line by writing:

- type: txp
  schedule: ...
  ports: ...
  hosts:
    - host1
    - host2
    - host3

As you have the list in an external file, you need to make use of config reloading using the watch.poll_file setting. This one requires JSON, though.


(R a V) #3

Thank you, although I was looking at something that'd just take a plain text file as an input :slight_smile:


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.