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)?
Ad Widget
Collapse
Auto removal of inactive hosts (AWS)
Collapse
X
-
Tags: None
-
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-templatesComment
Comment