Ad Widget

Collapse

Zabbix API - hostgroup.get and nested host groups

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • demoss
    Junior Member
    • Oct 2018
    • 9

    #1

    Zabbix API - hostgroup.get and nested host groups

    I'm finding that hostgroup.get is working fine for me in the API as long as I don't try to get a nested host group - but when I try to get a nested host group (A/B/C rather than A), I can't retrieve it. Is there any way to do that through the API?

    This is with 4.4.1, if it matters.
    Last edited by demoss; 06-12-2019, 00:15.
  • demoss
    Junior Member
    • Oct 2018
    • 9

    #2
    You don't add it to another host group per se, but according to the documentation, you can accomplish something similar by using / in the name. From https://www.zabbix.com/documentation...g_a_host_group :

    "Enter a unique host group name.
    To create a nested host group, use the '/' forward slash separator, for example Europe/Latvia/Riga/Zabbix servers. You can create this group even if none of the three parent host groups (Europe/Latvia/Riga) exist. In this case creating these parent host groups is up to the user; they will not be created automatically.
    Leading and trailing slashes, several slashes in a row are not allowed. Escaping of '/' is not supported.
    Nested representation of host groups is supported since Zabbix 3.2.0."

    Comment

    • demoss
      Junior Member
      • Oct 2018
      • 9

      #3
      Yes, I understand that the groups aren't REALLY nested, they just appear that way, but what's the point of having a search built-in if I'm then going to have to search it myself for the group I actually want? I may as well just pull all the host groups and then do my own search, since I have to do my own search anyway. Is there really no way to search for the group "gr1/gr2/gr3" directly through the API in your example?

      EDIT: This is weirder than I thought. My issue was somehow affecting just the particular host group I was trying to find - once I renamed it (to APPARENTLY the same thing it had previously been) I was able to pull it up. I guess an unprintable character or something must have somehow become incorporated into it. Anyway, my immediate issue is solved. Thanks!
      Last edited by demoss; 09-12-2019, 21:18.

      Comment

      Working...