Ad Widget

Collapse

Is there a way to bulk template-link hosts?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • james2012
    Junior Member
    • Jan 2008
    • 5

    #1

    Is there a way to bulk template-link hosts?

    It seems the only way to link templates to hosts is to click the host, click add template, wait for a window to popup, check the template box, click add, click save.

    If I need to add a template to hundreds of hosts, this would take all week.

    Is there a way to link a template to a group? it is easy to add hosts to groups. Or is there a way to link/unlink hosts to templates in bulk?

    I must be missing something here because this is just not scalable the way I am doing it now.
  • xs-
    Senior Member
    Zabbix Certified Specialist
    • Dec 2007
    • 393

    #2
    Im in the process of building such a thing.
    I believe the easiest way of doing this is using the include/hosts.inc.php.
    Fetch the contents of a host group, and loop through it while linking the templates you want. hosts.inc.php has all the functionality you need for this.

    Comment

    • eli.stair
      Junior Member
      • May 2006
      • 20

      #3
      zabix-cli.php

      FYI, I've written a CLI frontend to some Zabbix GUI features I need regularly. Currently this can perform basic queries (not returning data from history/trends yet) on hosts, and creates hosts along with linking any templates and assigning groups. I've been using this now for a while to add thousands of hosts regularly, and is an analog of all options available in the GUI for adding new hosts.

      The next steps before release (GPL) is further documenting, sanitizing input so it prevents users from breaking things, and adding the ability to update/add/delete template/host linkage for existing hosts.

      If you are interested in testing this out, let me know.

      /eli

      Comment

      • kisielk
        Junior Member
        • Apr 2008
        • 2

        #4
        I'd be interested in giving the command-line tool a spin.

        Comment

        Working...