Easy way to list all hosts?

Hello,

I was wondering, if we have, for example, about 1k hosts, how do our support staff can quick find the problem host from zabbix in boundary host list? Is it possible without logging in to admin console (which I guess does not provide search tool), but using only cli?

Thank you in advance.

1 Like

There is no -recursive flag for the hosts list command since you can only list hosts per host catalog. On the command line:

boundary hosts list -host-catalog-id hcst_1234567890

That will list all hosts in that host catalog.

the boundary CLI is 2023 still very frustrating … why can’t you just list all hosts, that I got access to? I can’t even script it and first get all hosts catalogs, and afterwards list all hosts using an array of host catalog ids. I also can only use host catalog it - and not catalog name or something like this :roll_eyes: explaining this behavior to colleagues will be fun …

Hi @jannik, are you trying to list all of the targets you have access to? If you are, then you can just use:

boundary targets list
or
boundary targets list -recursive

Is there a reason you are trying to list all user-accessible hosts? What is the information you are trying to gather?

This setup works ok, if every target is just one physical host and I will most probably go with this setup now. But Boundary itself says “A target is a logical collection of host sets which may be used to initiate sessions”, so in most cases you will have several hosts grouped as one target. And here is the problem with “boundary targets list -recursive”, as I will just see the target name and not the hosts behind it.