Ad Widget

Collapse

Auto removal of inactive hosts (AWS)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dodgetimes2
    Junior Member
    • Aug 2008
    • 4

    #1

    Auto removal of inactive hosts (AWS)

    My company has recently moved some of their dev environments to AWS and we have all AWS hosts auto-registering with our on-prem Zabbix server. The problem we have is that with each new build the entire stack of servers is terminated and a new stack brought up in its place with different hostnames and IPs. At the end of each week we now have 50-100 inactive hosts to manually delete. What I'd like to have is a script that runs off cron that will delete all inactive hosts (after X hours or X days of inactivity). Any recommendations? Is this something that may be added in an upcoming release (currently running 3.2.0 still)?
  • 1berto
    Senior Member
    • Sep 2018
    • 182

    #2
    Maybe i'm wrong, but isn't enough to create a script to check (and delete) hosts via API?

    Comment

    • kloczek
      Senior Member
      • Jun 2006
      • 1771

      #3
      Originally posted by 1berto
      Maybe i'm wrong, but isn't enough to create a script to check (and delete) hosts via API?
      In that case all what is needed is state of some trigger which like "host is inactive" and delete all host with that trigger active in the loop (one by one).
      Other solution which could be considered is combine script which will be deleting one host by hostid passed as parameter which will be automatically executed as remote command of the action trigger activated by trigger "host is inactive".
      In that case it will be no external need to use crontab/systemd timer.
      http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
      https://kloczek.wordpress.com/
      zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
      My zabbix templates https://github.com/kloczek/zabbix-templates

      Comment

      Working...