I am trying to configure an icmp.yml file to ping a list of hosts on my network.
I got it to ping the host that part is working, how do I add name: to the list of host.
type: icmp
enabled: true
schedule: '@every 1m'
List of hosts to ping
hosts:
- host1
- host2
- etc....
is there a way to add a name so I don't get the unnamed - auto gibberish name in the Kibana dashboard?
You may want to consider using the following monitors options: id and name.
I believe the auto gibberish name you are referring to is actually the id. Since the id is not specified, a generated value will be used (c.f. documentation).
I dont expect the great people of the community to do my job for me but can you give me an example of how that yaml file should be laid out. I have tried all different ways, to no success.
@delatucci - I have tried all different ways, to no success. - I am not sure what you have tried and which issue you are facing. Did you include the id in option in heartbeat.yml file and did you check if the value was correctly indexed? May be you could share with us the heartbeat.yml and some documents from your index as well as some screenshots of the issue.
Configure IP protocol types to ping on if hostnames are configured.
Ping all resolvable IPs if mode is all, or only one IP if mode is any.
ipv4: true
ipv6: false
mode: any
Total running time per ping test.
timeout: 16s
Waiting duration until another ICMP Echo Request is emitted.
wait: 1s
The tags of the monitors are included in their own field with each
transaction published. Tags make it easy to group servers by different
logical properties.
#tags: ["service-X", "web-tier"]
Optional fields that you can specify to add additional information to the
monitor output. Fields can be scalar values, arrays, dictionaries, or any nested
combination of these.
#fields:
env: staging
If this option is set to true, the custom fields are stored as top-level
fields in the output document instead of being grouped under a fields
sub-dictionary. Default is false.
#fields_under_root: false
the heartbeat log has this error in response:
job err parse icmp://hostname1 name:hostname1: invalid port ":hostname1" after host
I also got this error"
error invalid config: yaml: line 22: mapping values are not allowed in this context
when i tried it this way
hosts:
-host1
id: host1
Again any guidance on the correct syntax/structure of how to properly create this file will be greatly appreciated.
Within an ICMP monitor, you will not be able to define multiple hosts option. hosts can only appear once within the monitor definition and it is an array of hosts to ping. This is why the configuration you mentioned earlier will not work.
If you create an ICMP monitor with multiple hosts to ping, this would correspond to a logical grouping and as such, I do not see what would be the benefits of having a separate id, name for each host.
The only way you could achieve what you want (id, name per monitor per host) would be to define one ICMP monitor for each host. Example of such configuration (not tested):
I am using the ICMP monitor to ping by ip address
I want the id or name to display a Human Readable description of the IP address.
for example my icmp.yml is as follows
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.