telegraf + influxdb
This commit is contained in:
@@ -11,7 +11,8 @@ RUN git clone $REPOCOBALD /usr/local/src/cobald && \
|
||||
git clone $REPOTARDIS /usr/local/src/tardis
|
||||
|
||||
RUN mkdir /etc/cobald /var/log/cobald && \
|
||||
useradd -m -d /var/lib/cobald --no-log-init --system cobald
|
||||
useradd -m -d /var/lib/cobald --no-log-init --system cobald && \
|
||||
chown cobald:cobald /var/log/cobald
|
||||
|
||||
#RUN mkdir /cobald && python3 -m venv /cobald && source /cobald/bin/activate &&\
|
||||
# pip3 install --upgrade pip && pip3 install cobald
|
||||
@@ -46,6 +47,9 @@ RUN chmod 755 /usr/local/sbin/docker-entrypoint.sh
|
||||
|
||||
ENTRYPOINT /usr/local/sbin/docker-entrypoint.sh
|
||||
|
||||
RUN yum -y install iproute &&\
|
||||
yum clean all && rm -rf /var/cache/yum
|
||||
|
||||
USER cobald
|
||||
|
||||
CMD "python3 -m cobald.daemon /etc/cobald/config.yaml"
|
||||
|
540
roles/cobald/files/influxdb-dashboard-cobald.json
Normal file
540
roles/cobald/files/influxdb-dashboard-cobald.json
Normal file
@@ -0,0 +1,540 @@
|
||||
{
|
||||
"meta": {
|
||||
"version": "1",
|
||||
"type": "dashboard",
|
||||
"name": "cobald-Template",
|
||||
"description": "template created from dashboard: cobald"
|
||||
},
|
||||
"content": {
|
||||
"data": {
|
||||
"type": "dashboard",
|
||||
"attributes": {
|
||||
"name": "cobald",
|
||||
"description": ""
|
||||
},
|
||||
"relationships": {
|
||||
"label": {
|
||||
"data": []
|
||||
},
|
||||
"cell": {
|
||||
"data": [
|
||||
{
|
||||
"type": "cell",
|
||||
"id": "078ad2e135410000"
|
||||
},
|
||||
{
|
||||
"type": "cell",
|
||||
"id": "078ba588b6c10000"
|
||||
},
|
||||
{
|
||||
"type": "cell",
|
||||
"id": "078ba5e53a810000"
|
||||
},
|
||||
{
|
||||
"type": "cell",
|
||||
"id": "078c36c747010000"
|
||||
}
|
||||
]
|
||||
},
|
||||
"variable": {
|
||||
"data": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"included": [
|
||||
{
|
||||
"id": "078ad2e135410000",
|
||||
"type": "cell",
|
||||
"attributes": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"w": 4,
|
||||
"h": 4
|
||||
},
|
||||
"relationships": {
|
||||
"view": {
|
||||
"data": {
|
||||
"type": "view",
|
||||
"id": "078ad2e135410000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "078ba588b6c10000",
|
||||
"type": "cell",
|
||||
"attributes": {
|
||||
"x": 0,
|
||||
"y": 4,
|
||||
"w": 4,
|
||||
"h": 4
|
||||
},
|
||||
"relationships": {
|
||||
"view": {
|
||||
"data": {
|
||||
"type": "view",
|
||||
"id": "078ba588b6c10000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "078ba5e53a810000",
|
||||
"type": "cell",
|
||||
"attributes": {
|
||||
"x": 4,
|
||||
"y": 4,
|
||||
"w": 4,
|
||||
"h": 4
|
||||
},
|
||||
"relationships": {
|
||||
"view": {
|
||||
"data": {
|
||||
"type": "view",
|
||||
"id": "078ba5e53a810000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "078c36c747010000",
|
||||
"type": "cell",
|
||||
"attributes": {
|
||||
"x": 4,
|
||||
"y": 0,
|
||||
"w": 4,
|
||||
"h": 4
|
||||
},
|
||||
"relationships": {
|
||||
"view": {
|
||||
"data": {
|
||||
"type": "view",
|
||||
"id": "078c36c747010000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "view",
|
||||
"id": "078ad2e135410000",
|
||||
"attributes": {
|
||||
"name": "Name this Cell",
|
||||
"properties": {
|
||||
"shape": "chronograf-v2",
|
||||
"queries": [
|
||||
{
|
||||
"text": "from(bucket: \"batleth\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"tardis_machine_name\"] == \"678162c190d5\")\n |> window(every: 10s)\n |> count()\n |> duplicate(column: \"_stop\", as: \"_time\")\n |> window(every: inf)\n |> yield()",
|
||||
"editMode": "advanced",
|
||||
"name": "",
|
||||
"builderConfig": {
|
||||
"buckets": [],
|
||||
"tags": [
|
||||
{
|
||||
"key": "_measurement",
|
||||
"values": [],
|
||||
"aggregateFunctionType": "filter"
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"name": "mean"
|
||||
}
|
||||
],
|
||||
"aggregateWindow": {
|
||||
"period": "auto",
|
||||
"fillValues": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"axes": {
|
||||
"x": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
},
|
||||
"y": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
}
|
||||
},
|
||||
"type": "xy",
|
||||
"legend": {},
|
||||
"geom": "line",
|
||||
"colors": [
|
||||
{
|
||||
"id": "2566435b-7ee0-4222-8ac0-b7f14ab783d9",
|
||||
"type": "scale",
|
||||
"hex": "#31C0F6",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "9263bcff-35a0-4025-bacd-68a1bef54784",
|
||||
"type": "scale",
|
||||
"hex": "#A500A5",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "2f04bd8c-2203-4be6-bc34-c25720d24379",
|
||||
"type": "scale",
|
||||
"hex": "#FF7E27",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"note": "",
|
||||
"showNoteWhenEmpty": false,
|
||||
"xColumn": "_time",
|
||||
"generateXAxisTicks": [],
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "_value",
|
||||
"generateYAxisTicks": [],
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
"shadeBelow": false,
|
||||
"position": "overlaid",
|
||||
"timeFormat": "",
|
||||
"hoverDimension": "auto",
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1,
|
||||
"legendOrientationThreshold": 100000000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "view",
|
||||
"id": "078ba588b6c10000",
|
||||
"attributes": {
|
||||
"name": "states",
|
||||
"properties": {
|
||||
"shape": "chronograf-v2",
|
||||
"queries": [
|
||||
{
|
||||
"text": "from(bucket: \"batleth\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._field == \"state\")\n |> group(columns: [\"_value\"], mode: \"by\")\n |> duplicate(column: \"_value\", as: \"state\")\n |> window(every: 10s)\n |> count(column: \"state\")\n |> rename(columns: {\"_value\": \"_field\", \"state\": \"_value\"})\n |> group(columns: [\"_field\"])\n |> yield()",
|
||||
"editMode": "advanced",
|
||||
"name": "",
|
||||
"builderConfig": {
|
||||
"buckets": [],
|
||||
"tags": [
|
||||
{
|
||||
"key": "_measurement",
|
||||
"values": [],
|
||||
"aggregateFunctionType": "filter"
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"name": "mean"
|
||||
}
|
||||
],
|
||||
"aggregateWindow": {
|
||||
"period": "auto",
|
||||
"fillValues": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"axes": {
|
||||
"x": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
},
|
||||
"y": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
}
|
||||
},
|
||||
"type": "xy",
|
||||
"legend": {},
|
||||
"geom": "line",
|
||||
"colors": [
|
||||
{
|
||||
"id": "9b960932-18d9-4f57-80ba-24998a06613d",
|
||||
"type": "scale",
|
||||
"hex": "#31C0F6",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "c1742651-0d5e-4148-b9c0-92beb642417a",
|
||||
"type": "scale",
|
||||
"hex": "#A500A5",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "756fa8cb-9d9c-4e45-9a4f-f2b106b0216a",
|
||||
"type": "scale",
|
||||
"hex": "#FF7E27",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"note": "",
|
||||
"showNoteWhenEmpty": false,
|
||||
"xColumn": "_stop",
|
||||
"generateXAxisTicks": [],
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "_value",
|
||||
"generateYAxisTicks": [],
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
"shadeBelow": false,
|
||||
"position": "overlaid",
|
||||
"timeFormat": "",
|
||||
"hoverDimension": "auto",
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1,
|
||||
"legendOrientationThreshold": 100000000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "view",
|
||||
"id": "078ba5e53a810000",
|
||||
"attributes": {
|
||||
"name": "node fluctuation",
|
||||
"properties": {
|
||||
"shape": "chronograf-v2",
|
||||
"queries": [
|
||||
{
|
||||
"text": "f = (r, accumulator) => ({\n _value: accumulator._value + (if r._value == \"AvailableState\" then 1 else if r._value == \"DownState\" then -1 else 0)\n })\n\nfrom(bucket: \"batleth\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._field == \"state\")\n |> group()\n |> window(every: 10s)\n |> reduce(fn: f, identity: {_value: 0})\n |> duplicate(column: \"_stop\", as: \"_time\")\n |> window(every: inf, timeColumn: \"_time\")\n |> yield()",
|
||||
"editMode": "advanced",
|
||||
"name": "",
|
||||
"builderConfig": {
|
||||
"buckets": [],
|
||||
"tags": [
|
||||
{
|
||||
"key": "_measurement",
|
||||
"values": [],
|
||||
"aggregateFunctionType": "filter"
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"name": "mean"
|
||||
}
|
||||
],
|
||||
"aggregateWindow": {
|
||||
"period": "auto",
|
||||
"fillValues": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"axes": {
|
||||
"x": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
},
|
||||
"y": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
}
|
||||
},
|
||||
"type": "xy",
|
||||
"legend": {},
|
||||
"geom": "line",
|
||||
"colors": [
|
||||
{
|
||||
"id": "9b960932-18d9-4f57-80ba-24998a06613d",
|
||||
"type": "scale",
|
||||
"hex": "#31C0F6",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "c1742651-0d5e-4148-b9c0-92beb642417a",
|
||||
"type": "scale",
|
||||
"hex": "#A500A5",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "756fa8cb-9d9c-4e45-9a4f-f2b106b0216a",
|
||||
"type": "scale",
|
||||
"hex": "#FF7E27",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"note": "",
|
||||
"showNoteWhenEmpty": false,
|
||||
"xColumn": "_time",
|
||||
"generateXAxisTicks": [],
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "_value",
|
||||
"generateYAxisTicks": [],
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
"shadeBelow": false,
|
||||
"position": "overlaid",
|
||||
"timeFormat": "",
|
||||
"hoverDimension": "auto",
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1,
|
||||
"legendOrientationThreshold": 100000000
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "view",
|
||||
"id": "078c36c747010000",
|
||||
"attributes": {
|
||||
"name": "nodes running",
|
||||
"properties": {
|
||||
"shape": "chronograf-v2",
|
||||
"queries": [
|
||||
{
|
||||
"text": "from(bucket: \"batleth\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._field == \"state\")\n |> group()\n |> window(every: 10s)\n |> reduce(fn: (r, accumulator) => ({\n _value: accumulator._value + (\n if r._value == \"AvailableState\" then 1 \n else if r._value == \"DownState\" then -1 \n else 0)\n }), identity: {_value: 0})\n |> duplicate(column: \"_stop\", as: \"_time\")\n |> window(every: inf) //, timeColumn: \"_time\")\n |> cumulativeSum()\n// |> reduce(fn: (r, accumulator) => ({r with x: r._value * 2}), identity: {x:0})\n// |> map(fn: (r) => ({r with vnew: r._value*2}))\n// |> integral(unit: 10s, timeColumn: \"_stop\")\n// |> window(every: inf) //, timeColumn: \"_stop\")\n |> yield()",
|
||||
"editMode": "advanced",
|
||||
"name": "",
|
||||
"builderConfig": {
|
||||
"buckets": [],
|
||||
"tags": [
|
||||
{
|
||||
"key": "_measurement",
|
||||
"values": [],
|
||||
"aggregateFunctionType": "filter"
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"name": "mean"
|
||||
}
|
||||
],
|
||||
"aggregateWindow": {
|
||||
"period": "auto",
|
||||
"fillValues": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"axes": {
|
||||
"x": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
},
|
||||
"y": {
|
||||
"bounds": [
|
||||
"",
|
||||
""
|
||||
],
|
||||
"label": "",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"base": "10",
|
||||
"scale": "linear"
|
||||
}
|
||||
},
|
||||
"type": "xy",
|
||||
"legend": {},
|
||||
"geom": "line",
|
||||
"colors": [
|
||||
{
|
||||
"id": "9b960932-18d9-4f57-80ba-24998a06613d",
|
||||
"type": "scale",
|
||||
"hex": "#31C0F6",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "c1742651-0d5e-4148-b9c0-92beb642417a",
|
||||
"type": "scale",
|
||||
"hex": "#A500A5",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"id": "756fa8cb-9d9c-4e45-9a4f-f2b106b0216a",
|
||||
"type": "scale",
|
||||
"hex": "#FF7E27",
|
||||
"name": "Nineteen Eighty Four",
|
||||
"value": 0
|
||||
}
|
||||
],
|
||||
"note": "",
|
||||
"showNoteWhenEmpty": false,
|
||||
"xColumn": "_time",
|
||||
"generateXAxisTicks": [],
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "_value",
|
||||
"generateYAxisTicks": [],
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
"shadeBelow": false,
|
||||
"position": "overlaid",
|
||||
"timeFormat": "",
|
||||
"hoverDimension": "auto",
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1,
|
||||
"legendOrientationThreshold": 100000000
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"labels": []
|
||||
}
|
6
roles/cobald/files/influxdb.repo
Normal file
6
roles/cobald/files/influxdb.repo
Normal file
@@ -0,0 +1,6 @@
|
||||
[influxdb]
|
||||
name = InfluxDB Repository - RHEL \$releasever
|
||||
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
|
||||
enabled = 1
|
||||
gpgcheck = 1
|
||||
gpgkey = https://repos.influxdata.com/influxdb.key
|
8
roles/cobald/files/telegraf.Dockerfile
Normal file
8
roles/cobald/files/telegraf.Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM centos:7
|
||||
|
||||
COPY influxdb.repo /etc/yum.repos.d/influxdb.repo
|
||||
|
||||
RUN yum -y install telegraf &&\
|
||||
yum clean all && rm -rf /var/cache/yum
|
||||
|
||||
CMD telegraf
|
Reference in New Issue
Block a user