Ad Widget

Collapse

Triggered movement of hosts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lcbowen3
    Junior Member
    • Sep 2014
    • 3

    #1

    Triggered movement of hosts

    I have a large development environment based in a cloud (in this case, AWS). When our software developers need to build a project, a build server is automatically spun up by Jenkins and then removed after the job is completed. During the job run, I need to monitor the status of these servers. I've created an server image which Jenkins uses that adds these hosts to a specific host group on startup and adds a specific template to monitor the components I need to track while the job is running. This is simple and is standard functionality.

    My issue is after the job completes, I'd like to get rid of these hosts that are now unreachable, but that's no trivial task. I'm manually managing these hosts now (which get into the hundreds and cause all kinds of issues with unreachable pollers). I've managed to create a way that will move the host from the host group to another (using a triggered action system script sql command to alter the hostgroup id of the host based on the hostname), but I'd like to unlink and clear the template as well. I'd prefer to use the method that Zabbix uses to do this (based on their "unlink and clear" command in the interface) rather than cobble together my own SQL which may leave junk data behind.

    Does anyone have the sql to "clear" the template data from a host? I can convert it from whatever to the database version I'm using.

    I'm planning on creating a stored procedure to which I can pass a hostname to do this in production.

    Thanks
Working...