Ad Widget

Collapse

Frontend Script to Add a Host to a specific Host Group

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • matidr
    Junior Member
    • Jan 2020
    • 8

    #1

    Frontend Script to Add a Host to a specific Host Group

    Hi everyone,

    I´m working on simplifying the way to put a Host in Maintenance Mode.
    So I created a Maintenance Period for as long as I could, applying every day all day, to a Host Group (MAINTENANCE).
    This already simplifyies maintenance mode a lot, since you only have to add a host to this host group and it will be in maintenance mode right away Same deal the other way arround, take it of the group and its no longer in maintenance mode.

    Now I was thinking on going one step forwards by adding two front end scripts, one that adds the selected Host to the MAINTENANCE Host Group and one that removes the said Host from the Host Group.
    The problem is that I can´t find any information on how to do this.

    Any Help or ideas?

    Thanks in advance!

    Matías.​
  • Answer selected by matidr at 13-05-2024, 17:35.
    tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    Zabbix 5.0 added support for front-end modules to extend the functionality of the web interface, without having to patch existing files every time a new version is released.

    This has been extended and advanced through later versions, especially 6.4.x. See the "Development framework" section of this blog post: https://blog.zabbix.com/zabbix-6-4-is-out-now/25444/

    There is an existing module that was written for the 5.0 module interface to simplify creating a one-time maintenance period. It looks like it has been updated to work with the latest Zabbix: https://framagit.org/zabbix-modules/...ic-maintenance

    As far as easy maintenance, using the API makes it even easier for the end user. With some scripting, you could make a script that just requires the person running it to supply the host or host group and the script creates a maintenance period and adds the host or host group to it.

    Comment

    • jashley
      Member
      • Aug 2007
      • 37

      #2
      Did you get any help on this? I am curious about adding frontend functionality for when you click on a host as well.

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #3
        Zabbix 5.0 added support for front-end modules to extend the functionality of the web interface, without having to patch existing files every time a new version is released.

        This has been extended and advanced through later versions, especially 6.4.x. See the "Development framework" section of this blog post: https://blog.zabbix.com/zabbix-6-4-is-out-now/25444/

        There is an existing module that was written for the 5.0 module interface to simplify creating a one-time maintenance period. It looks like it has been updated to work with the latest Zabbix: https://framagit.org/zabbix-modules/...ic-maintenance

        As far as easy maintenance, using the API makes it even easier for the end user. With some scripting, you could make a script that just requires the person running it to supply the host or host group and the script creates a maintenance period and adds the host or host group to it.

        Comment

        • Chris Ruettimann
          Junior Member
          • Sep 2020
          • 6

          #4
          Thats a great module, thanks for pointing Tim.

          I wrote a script based solution to just fire Maint windows directly to hosts.
          Its super easy to install and I have choosen shell instead of python, because I use docker images ... no pyton there.

          BR Chris

          Comment

          Working...