Elminate servers from Grafana dashboard

the last month i added 20 servers to my Grafana dashboard
now i got 10 servers powered off and no longer working on my internal network so i need to elminate them from my dashboard !
How can i do that !
some help please

Unless you tell us how you added them, I don’t think we can tell you how to
remove them.

Please, give us some details, at least?

Antony.

i added them by installing telegraf on each one of them !
But now they doesn’t exist so i can’t access to them but they still exist on my dashboard !

The data for those servers is still likely in your datasource (Telegraf or whatever database you have setup to hold the metrics). Grafana will just be reporting on those metrics, it has no control over those metrics.

So you need to find to find out how to remove/purge the particular server data from Telegraf or whatever data source it’s in.

1 Like

the names of servers are still exist on the dashboard
(Normally influxdb hold the database and telegraf installed on each server sends metrics to influxdb)
I’am sure that servers are offline and powered off , telegraf is not sending metrics to my influxdb
even while openning from grafana one of my servers (powered off) i got not data !
so telegraf stoops working and send metrics but the servers name still exist

Understood. But you have historical data of those servers in your InfluxDB, hence Grafana will show them. You can go back an arbitrary time in your Grafana display as long as there is data in the database.

You need to use the “influx” command line tool and delete the data from your InfluxDB. Then the servers will vanish in Grafana, too.
You should think about an expiry mechanism for the InfluxDB data, anyway. InfluxDB has got the concept of “retention policies”. But I found them rather complicated to set up and they are stored in the database, so they are completely opaque from an “ops” point of view and difficult to roll out with Ansible and the like.

So I came up with this cron job to delete all data older than a year:

#! /bin/sh

db="graphite"
keep="-1y"

expire=$(/bin/date -v "${keep}" '+%Y-%m-%d')
echo "DELETE WHERE time < '${expire}'" | /usr/local/bin/influx -database "${db}"

HTH,
Patrick