-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadm_influxdb_show_retention.sh
More file actions
executable file
·40 lines (31 loc) · 1.07 KB
/
adm_influxdb_show_retention.sh
File metadata and controls
executable file
·40 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#
# Show retention policies of Influxdb - container must be in running state
#
echo "=> Show retention policies of Influxdb - container must be in running state"
if [ ! -e .env ]
then
echo "<!> Please create proper .env file! Exiting."
exit 1
fi
if [ ! -e influxdb.env ]
then
echo "<!> Please create proper influxdb.env file! Exiting."
exit 1
fi
set -o allexport
source .env
source influxdb.env
set +o allexport
cd ${STACKDIR}
echo "Compose up influxdb"
${COMPOSECOMMAND} -f docker-compose.yml up -d influxdb
curl -G http://localhost:8086/query --data-urlencode "u=${INFLUXDB_ADMIN_USER}" --data-urlencode "p=${INFLUXDB_ADMIN_PASSWORD}" --data-urlencode "q=SHOW DATABASES"
echo "SHOW DATABASES"
echo "--------------"
docker exec -it influxdb influx -username ${INFLUXDB_ADMIN_USER} -password "${INFLUXDB_ADMIN_PASSWORD}" -execute "USE sensors
SHOW DATABASES"
echo "SHOW Retention Policy"
echo "-----------"
docker exec -it influxdb influx -username ${INFLUXDB_ADMIN_USER} -password "${INFLUXDB_ADMIN_PASSWORD}" -execute "USE sensors
SHOW RETENTION POLICIES"