TheNetworkGuy/netbox-zabbix-sync

Host group format

Closed this issue · 4 comments

When a host group is created the format is:
site/manufacturer/role

if you add the -t to add the tenant it adds it after the site name
site/tenant/manufacturer/role

We restrict access to the hosts to each client "tenant" therefore it would make more sense for the tenant to be the first option in the tree
tenant/site/manufacturer/role

There could be other reasons why you have it this way but would be great if there could be a way to choose the order

Thanks
Tao

This has been tried before in #13, however this FR didn't work out the way it was supposed to work.

It seems that there are users interested in this feature so i might take a look at it and see how easy it is to implement.

I've made some progress on this feature, please test it out and see if this works for you. You can test the new code by checking out on the HG-Format branch.

If unfamiliar with Git branches:
git pull
git checkout HG-Format

To summarize:

  • Added the -l flag to customize the Hostgroup Layout. Right now only 4 options are configured which have been updated in the documentation. This can be expanded to include many more! :)
  • Removed the Tenant flag since you can customize this with the -l flag.

That works perfectly
I ran it with -l tenant/site/manufacturer/dev_role -H and all the hosts moved with the updated syntax
Thank you !!

Glad to hear, closing this one and moving the branch to main.