chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

Add support to delete a host

Open nhaugo opened this issue 9 years ago • 17 comments

nhaugo avatar Jan 24 '17 16:01 nhaugo

image Hi, if i delete or rename a host , does chronograf has a method to delete the old server's data?

guozequn avatar May 23 '17 10:05 guozequn

Hi @guozequn , thanks for writing in! Currently, chronograf cannot delete an old server's data.

We've been thinking about how we'd like to support it in chronograf. We could either blacklist the host and not show them in the list, or, remove the data from the telegraf database.

Of those two options which do you like better?

goller avatar May 23 '17 14:05 goller

Thank you for getting back to me. I think the first option is better to me, if a server is in a wrong state instead of crash, i can just hide it manually, and there is no need to care about the the history data, it will be cleaned up automatically by influxdb if the retention policies is specified.

guozequn avatar May 24 '17 04:05 guozequn

i would like to have both options.

hflamboauto1 avatar Jun 16 '17 09:06 hflamboauto1

If possible, I'd love the ability to rename the host data, since we just changed the hostname the box is reporting in telegraph.

icco avatar Jul 17 '17 18:07 icco

What is the correct procedure to remove hosts from the chronograf "host list"? I have servers which are not in use anymore.

djyoda avatar Jul 25 '17 09:07 djyoda

hi all, any progress to this? i have some hosts that i don't want to see in the host list.. how can i remove?

cleonte avatar Jul 31 '17 04:07 cleonte

At the moment, the only way I've found to delete a host is to run the following command on Influxdb host. drop series where host=<hostname> This will delete all the data held for that host on the database, so use with caution (ie. only when the host is gone for good)

To be clear for any passers by, you will need to single quote the host's name in that query:

drop series where host='OldServer01'

nogweii avatar Nov 29 '17 22:11 nogweii

How long does it take for the updated host list to be reflected in the UI once the series records for the hosts have been dropped?

mjlyon avatar Feb 14 '18 18:02 mjlyon

It should be on the next reload. Chronograf pulls the host list from a SHOW SERIES command, so if the host does not show up there, it shouldn't show up in chronograf

nhaugo avatar Feb 16 '18 01:02 nhaugo

I am doing this drop series where host='oldhost' but even minutes after the drop deadman still throws an alert on the host.

'oldhost' is turned off. Influx data is dropped. Minutes later I have a deadman alert. How can I get chronograf to ignore the 'oldhost' so I don't get this false deadman?

nostamp avatar Apr 11 '18 22:04 nostamp

after drop series the deleted hosts still show up in the host list with 0.00% 0.00

rif avatar Apr 19 '18 15:04 rif

@rif same here. I had to restart InfluxDB in order to get rid of the removed hosts in Chronograf host list. systemctl restart influxdb

Besides, InfluxDB also supports regex. So if ever you need to clean a bunch of Docker hosts (with docker id as hostname), you can do something like:

$ influx -database telegraf
> drop series where host =~ /^[0-9a-f]{12}$/

onlime avatar Apr 19 '18 16:04 onlime

@onlime thanks for the tip, it did the job :+1: The regex support is also a good suggestion!

rif avatar Apr 19 '18 16:04 rif

Hi, I have same issue, but when I do DROP SERIES WHERE host = some_host I still see tag value some_host even I restart influxdb. Just updated from previous version to 1.6.0 and problem is still there.

Naumis1 avatar Jul 11 '18 08:07 Naumis1

so chronograf isn't caching anything on the current host page. so if the host is showing up in the UI, it still exists in your influxdb cluster somewhere.

That being said, in the updated host list page (#682 ), we will add a time component which would allow old hosts to eventually drop off the list if you like.

russorat avatar Jul 20 '18 16:07 russorat