Skip to content
Sebastian YEPES edited this page Jan 9, 2016 · 1 revision

InfluxDB - Configuration

Example of the InfluxDB configuration

  1. Creating Database and Retention Policies:

     CREATE DATABASE ESXi
     CREATE RETENTION POLICY raw ON ESXi DURATION 2w REPLICATION 1 DEFAULT
     CREATE RETENTION POLICY h5m ON ESXi DURATION 106w REPLICATION 1
     CREATE RETENTION POLICY h1h ON ESXi DURATION 106w REPLICATION 1
    
  2. Creating Continuous Queries to downsample raw metrics to 5 minutes interval

     CREATE CONTINUOUS QUERY events_5m ON ESXi BEGIN SELECT sum(value) AS "sum" INTO "h5m".:MEASUREMENT FROM "raw"./^events/ GROUP BY time(5m), * END
    
     CREATE CONTINUOUS QUERY cpu_mem_5m ON ESXi BEGIN SELECT max(value) AS "max", min(value) AS "min", mean(value) AS "mean", median(value) AS "median", sum(value) AS "sum", percentile(value, 90.000) AS "pct90", percentile(value, 95.000) AS "pct95", stddev(value) AS "stddev"  INTO "h5m".:MEASUREMENT FROM "raw"./^(cpu|rescpu|mem|power)_.*/ WHERE instance = 'avg' GROUP BY time(5m), "host", "server", "type" END
    
     CREATE CONTINUOUS QUERY net_5m ON ESXi BEGIN SELECT max(value) AS "max", min(value) AS "min", mean(value) AS "mean", median(value) AS "median", sum(value) AS "sum", percentile(value, 90.000) AS "pct90", percentile(value, 95.000) AS "pct95", stddev(value) AS "STDDEV" INTO "h5m".:MEASUREMENT FROM "raw"./^(net)_.*/ WHERE instance = 'avg' GROUP BY time(5m), "host", "server", "type" END
    
     CREATE CONTINUOUS QUERY disk_5m ON ESXi BEGIN SELECT max(value) AS "max", min(value) AS "min", mean(value) AS "mean", median(value) AS "median", sum(value) AS "sum", percentile(value, 90.000) AS "pct90", percentile(value, 95.000) AS "pct95", stddev(value) AS "stddev" INTO "h5m".:MEASUREMENT FROM "raw"./^(disk|datastore)_.*/ GROUP BY time(5m), * END
    
  3. Creating Continuous Queries to downsample raw metrics to 1 hour interval

     CREATE CONTINUOUS QUERY cpu_mem_1h ON ESXi BEGIN SELECT max(value) AS "max", min(value) AS "min", mean(value) AS "mean", median(value) AS "median", sum(value) AS "sum", percentile(value, 90.000) AS "pct90", percentile(value, 95.000) AS "pct95", stddev(value) AS "stddev" INTO "h1h".:MEASUREMENT FROM "raw"./^(cpu|rescpu|mem|power)_.*/ WHERE instance = 'avg' GROUP BY time(1h), "host", "server", "type" END
    
     CREATE CONTINUOUS QUERY net_1h ON ESXi BEGIN SELECT max(value) AS "max", min(value) AS "min", mean(value) AS "mean", median(value) AS "median", sum(value) AS "sum", percentile(value, 90.000) AS "pct90", percentile(value, 95.000) AS "pct95", stddev(value) AS "stddev" INTO "h1h".:MEASUREMENT FROM "raw"./^(net)_.*/ WHERE instance = 'avg' GROUP BY time(1h), "host", "server", "type" END
    
     CREATE CONTINUOUS QUERY disk_1h ON ESXi BEGIN SELECT max(value) AS "max", min(value) AS "min", mean(value) AS "mean", median(value) AS "median", sum(value) AS "sum", percentile(value, 90.000) AS "pct90", percentile(value, 95.000) AS "pct95", stddev(value) AS "stddev" INTO "h1h".:MEASUREMENT FROM "raw"./^(disk|datastore)_.*/ GROUP BY time(1h), * END
    
Clone this wiki locally