[ZBXNEXT-1136] Remove disabled/inactive auto-registered hosts automatically Created: 2012 Mar 01 Updated: 2018 Dec 25 |
|
Status: | Reopened |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Server (S) |
Affects Version/s: | 1.8.10 |
Fix Version/s: | None |
Type: | Change Request | Priority: | Major |
Reporter: | Kleber Vinicius de Carvalho Domingues | Assignee: | Alexei Vladishev |
Resolution: | Unresolved | Votes: | 14 |
Labels: | actions, autoregistration | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
OS Centos 5.7 64bits |
Issue Links: |
|
Description |
I'm trying to find something to automate the deletion of my disabled hosts on my Zabbix Server. |
Comments |
Comment by richlv [ 2012 Mar 01 ] |
what's your definition of "inactive" ? |
Comment by Kleber Vinicius de Carvalho Domingues [ 2012 Mar 01 ] |
Hosts that are some time without answering Zabbix Server requests. This is the opposite of Auto Discovery. |
Comment by Oleksii Zagorskyi [ 2012 Mar 02 ] |
"Remove host" operation is available for Discovery's actions. |
Comment by richlv [ 2012 Mar 11 ] |
as mentioned, if you are using network discovery, you can use host removal operation; i don't think there's going to be anything more specific implemented -> closing |
Comment by Oleksii Zagorskyi [ 2013 Jun 04 ] |
I updated this feature request summary to reflect a main target - auto-registered hosts automatic removal. |
Comment by Oleksii Zagorskyi [ 2013 Jun 04 ] |
Any nice ideas how it could be nicely implemented are welcome |
Comment by Rob Langley [ 2013 Sep 08 ] |
I'm currently using Auto Registration for load balanced servers I'm starting and stopping with Amazon's AWS auto scaling feature. So what would be useful is an operation to Disable Host after xx mins, then 'Delete Host' after xxx mins For example when the server is terminated it could be disabled after 60 mins, then deleted after 240 mins. |
Comment by Ionut Cadariu [ 2015 Mar 28 ] |
@Rob, If you have found a way to deal with that type of issues please respond since I'm looking for a way to automatically remove hosts that are no longer available from zabbix. Thank you |
Comment by TonyFu [ 2015 Apr 14 ] |
@Ionut Cadariu, I've rencently write a script with python to delete unactive hosts periodly. Call for zbx json-rpc with groupid, we get the status of hosts, then we can decide disable them after specific time and delete them. My zabbix version is 2.2.4, if you're interested, post an email:[email protected] to me. |
Comment by JamesH [ 2015 Apr 14 ] |
I'm using zabbix_sender called from the zabbix_agent init script upon shutdown to trigger a server-side API call which disables the host. Then a server-side script runs periodically and deletes disabled hosts greater than X days old through the API. It's working for us but I'd like to see this functionality built-in as ephemeral hosts is becoming more widespread. |
Comment by Matt [ 2015 Jun 24 ] |
@James Hammett What is the syntax to send the disable signal for zabbix_sender??? I've been searching Google for the past 1.5 hours trying to find exactly that key and value and the best I've found is your comment saying you've done it... PLEASE reply. PLEASE. M. |
Comment by JamesH [ 2015 Jun 26 ] |
Google is no help as I haven't seen anyone else tackle this problem. I created an item named "disable-host" and I have zabbix_sender send the name of the host to it upon shutdown. I created a trigger that triggers upon each update of "disable-host". That triggers an action that runs a server-side script that hits the API disabling the host. Lots of moving parts but 100% reliable so far. Right now I'm working toward making this all work with Docker containers :^) |
Comment by richlv [ 2015 Jun 26 ] |
please consider using https://www.zabbix.org/wiki/Getting_help for discussion, and maybe even writing a howto on zabbix.org |
Comment by Matt [ 2015 Jun 26 ] |
@JamesH Man, thank you. I am totally following what you are saying and am working on a Proof of Concept. I had gotten another idea working just late yesterday. 1) Wrote a "service": /etc/init.d/zabbix-disable-host
I decided on this way because if the node crashes and burns, it never sends the "disable" back so it will go unreachable (and in turn sound the alert) Currently, I'm trying to figure out how to get the date/time out of Zabbix when the node went disabled. This way we can retain usage history for the node for X days, then delete it. We don't want it deleted right away. Looking at the API docs, I don't see that Zabbix actually stores anywhere WHEN the node got / went disabled. :-\ M. |
Comment by Matt [ 2015 Jun 30 ] |
As a small follow up, it doesn't seem that Zabbix records the date/time a node was disabled. So what I do now in my "service" file (/etc/init.d/zabbix-disable-host) on stop:
Server side I scheduled a daily script to:
M. |
Comment by richlv [ 2017 Jan 02 ] |
might be solvable by ZBXNEXT-1387 |