Show pageOld revisionsBacklinksAdd to bookExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== influxdb ====== <code> curl -sL https://repos.influxdata.com/influxdb.key | apt-key add - source /etc/lsb-release echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | tee -a /etc/apt/sources.list apt update apt install influxdb </code> enable admin service in /etc/influxdb/influxdb.conf and <code> systemctl restart influxdb </code> create database <code> root@graphite:~# influx Connected to http://localhost:8086 version 1.2.1 InfluxDB shell version: 1.2.1 > create database captive > CREATE USER "captive" WITH PASSWORD 'captive' WITH ALL PRIVILEGES > show databases name: databases name ---- _internal captive > </code> select <code> influx -database test -execute 'select * from "mctc.veicoli.get" order by time desc limit 10' </code> test <code> curl -G http://carbon:8086/query --data-urlencode "q=SHOW DATABASES" </code> python test <code python> from influxdb import InfluxDBClient client = InfluxDBClient('carbon.csgalileo.org', 8086, username='captive', password='captive', database='test') json_body = [{"measurement": "browser", "tags": {"server":1, "server-name":"galileo"}, "time": datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ'), "fields": {"value":"ios"}}] client.write_points(json_body) client.query('select value from browser;') </code> retention <code> CREATE RETENTION POLICY "a_year" ON "test" DURATION 52w REPLICATION 1 SHARD DURATION 168h CREATE RETENTION POLICY "a_week" ON "test" DURATION 168h REPLICATION 1 SHARD DURATION 24h DEFAULT </code> ====== grafana ====== ===== install ===== <code bash> TODO # per rasp cd /tmp wget https://github.com/fg2it/grafana-on-raspberry/releases/download/v4.6.1/grafana_4.6.1_armhf.deb dpkg -i grafana_4.6.1_armhf.deb systemctl enable grafana-server systemctl start grafana-server </code> Login to http://localhost:3000 (admin/admin) add datasource {{ :projects:internetofthings:datasource.png |}} ===== plugins ===== Add plugin in /var/lib/grafana/plugins/ directory piechart <code bash> cd /var/lib/grafana/plugins/ git clone https://github.com/grafana/piechart-panel.git systemctl restart grafana-server.service </code> projects/internetofthings/influxdb.txt Last modified: 2019/09/24 11:07by scipio