2018-07-09 21:56:27 +00:00
|
|
|
import {
|
|
|
|
Source,
|
|
|
|
SourceAuthenticationMethod,
|
|
|
|
Template,
|
|
|
|
Dashboard,
|
|
|
|
Cell,
|
|
|
|
CellType,
|
|
|
|
SourceLinks,
|
|
|
|
TemplateType,
|
|
|
|
TemplateValueType,
|
|
|
|
} from 'src/types'
|
2018-04-17 23:28:03 +00:00
|
|
|
|
2018-04-04 04:10:06 +00:00
|
|
|
export const role = {
|
|
|
|
name: '',
|
|
|
|
organization: '',
|
|
|
|
}
|
|
|
|
|
|
|
|
export const currentOrganization = {
|
|
|
|
name: '',
|
|
|
|
defaultRole: '',
|
|
|
|
id: '',
|
|
|
|
links: {
|
|
|
|
self: '',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const me = {
|
|
|
|
currentOrganization,
|
|
|
|
role,
|
|
|
|
}
|
|
|
|
|
2018-04-17 23:28:03 +00:00
|
|
|
export const sourceLinks: SourceLinks = {
|
2018-05-18 23:08:58 +00:00
|
|
|
services: '/chronograf/v1/sources/16/services',
|
2018-03-15 23:44:18 +00:00
|
|
|
self: '/chronograf/v1/sources/16',
|
|
|
|
kapacitors: '/chronograf/v1/sources/16/kapacitors',
|
|
|
|
proxy: '/chronograf/v1/sources/16/proxy',
|
|
|
|
queries: '/chronograf/v1/sources/16/queries',
|
|
|
|
write: '/chronograf/v1/sources/16/write',
|
|
|
|
permissions: '/chronograf/v1/sources/16/permissions',
|
|
|
|
users: '/chronograf/v1/sources/16/users',
|
|
|
|
databases: '/chronograf/v1/sources/16/dbs',
|
2018-04-17 23:28:03 +00:00
|
|
|
annotations: '/chronograf/v1/sources/16/annotations',
|
2018-04-04 04:10:06 +00:00
|
|
|
health: '/chronograf/v1/sources/16/health',
|
2018-03-15 23:44:18 +00:00
|
|
|
}
|
|
|
|
|
2018-04-17 23:28:03 +00:00
|
|
|
export const source: Source = {
|
2018-03-03 17:14:40 +00:00
|
|
|
id: '16',
|
|
|
|
name: 'ssl',
|
|
|
|
type: 'influx',
|
|
|
|
username: 'admin',
|
|
|
|
url: 'https://localhost:9086',
|
|
|
|
insecureSkipVerify: true,
|
|
|
|
default: false,
|
|
|
|
telegraf: 'telegraf',
|
|
|
|
organization: '0',
|
|
|
|
role: 'viewer',
|
2018-04-12 00:02:18 +00:00
|
|
|
defaultRP: '',
|
2018-04-17 23:28:03 +00:00
|
|
|
links: sourceLinks,
|
2018-07-09 21:56:27 +00:00
|
|
|
authentication: SourceAuthenticationMethod.Basic,
|
2018-03-03 17:14:40 +00:00
|
|
|
}
|
|
|
|
|
2018-04-04 22:39:34 +00:00
|
|
|
export const timeRange = {
|
|
|
|
lower: 'now() - 15m',
|
|
|
|
upper: null,
|
|
|
|
}
|
|
|
|
|
2018-03-03 17:14:40 +00:00
|
|
|
export const query = {
|
|
|
|
id: '0',
|
|
|
|
database: 'db1',
|
|
|
|
measurement: 'm1',
|
|
|
|
retentionPolicy: 'r1',
|
|
|
|
fill: 'null',
|
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
value: 'f1',
|
|
|
|
type: 'field',
|
|
|
|
alias: 'foo',
|
|
|
|
args: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
tags: {
|
|
|
|
tk1: ['tv1', 'tv2'],
|
|
|
|
},
|
|
|
|
groupBy: {
|
|
|
|
time: null,
|
|
|
|
tags: [],
|
|
|
|
},
|
|
|
|
areTagsAccepted: true,
|
|
|
|
rawText: null,
|
|
|
|
status: null,
|
|
|
|
shifts: [],
|
|
|
|
}
|
2018-03-07 18:00:04 +00:00
|
|
|
|
|
|
|
export const kapacitor = {
|
|
|
|
url: '/foo/bar/baz',
|
|
|
|
name: 'kapa',
|
|
|
|
username: 'influx',
|
|
|
|
password: '',
|
|
|
|
active: false,
|
2018-03-13 23:13:36 +00:00
|
|
|
insecureSkipVerify: false,
|
2018-03-07 18:00:04 +00:00
|
|
|
links: {
|
|
|
|
self: '/kapa/1',
|
2018-03-12 20:38:17 +00:00
|
|
|
proxy: '/proxy/kapacitor/1',
|
2018-03-07 18:00:04 +00:00
|
|
|
},
|
|
|
|
}
|
2018-03-14 01:34:34 +00:00
|
|
|
|
2018-05-17 20:27:45 +00:00
|
|
|
export const service = {
|
2018-05-18 00:15:48 +00:00
|
|
|
id: '1',
|
2018-05-22 21:50:07 +00:00
|
|
|
sourceID: '1',
|
2018-05-17 20:27:45 +00:00
|
|
|
url: 'localhost:8082',
|
2018-06-05 17:40:25 +00:00
|
|
|
type: 'flux',
|
|
|
|
name: 'Flux',
|
2018-05-17 20:27:45 +00:00
|
|
|
username: '',
|
|
|
|
password: '',
|
|
|
|
active: false,
|
|
|
|
insecureSkipVerify: false,
|
|
|
|
links: {
|
2018-05-18 00:15:48 +00:00
|
|
|
source: '/chronograf/v1/sources/1',
|
2018-05-17 20:27:45 +00:00
|
|
|
proxy: '/chronograf/v1/sources/1/services/2/proxy',
|
|
|
|
self: '/chronograf/v1/sources/1/services/2',
|
|
|
|
},
|
2018-05-22 21:50:07 +00:00
|
|
|
metadata: {},
|
2018-05-17 20:27:45 +00:00
|
|
|
}
|
|
|
|
|
2018-03-14 01:34:34 +00:00
|
|
|
export const kapacitorRules = [
|
|
|
|
{
|
2018-04-06 23:16:27 +00:00
|
|
|
id: '1',
|
2018-03-14 01:34:34 +00:00
|
|
|
tickscript:
|
|
|
|
"var db = 'telegraf'\n\nvar rp = 'autogen'\n\nvar measurement = 'cpu'\n\nvar groupBy = ['cpu']\n\nvar whereFilter = lambda: (\"cpu\" != 'cpu-total' OR \"cpu\" != 'cpu1')\n\nvar period = 1h\n\nvar name = 'asdfasdfasdfasdfbob'\n\nvar idVar = name + ':{{.Group}}'\n\nvar message = ''\n\nvar idTag = 'alertID'\n\nvar levelTag = 'level'\n\nvar messageField = 'message'\n\nvar durationField = 'duration'\n\nvar outputDB = 'chronograf'\n\nvar outputRP = 'autogen'\n\nvar outputMeasurement = 'alerts'\n\nvar triggerType = 'deadman'\n\nvar threshold = 0.0\n\nvar data = stream\n |from()\n .database(db)\n .retentionPolicy(rp)\n .measurement(measurement)\n .groupBy(groupBy)\n .where(whereFilter)\n\nvar trigger = data\n |deadman(threshold, period)\n .stateChangesOnly()\n .message(message)\n .id(idVar)\n .idTag(idTag)\n .levelTag(levelTag)\n .messageField(messageField)\n .durationField(durationField)\n .stateChangesOnly()\n .pushover()\n .pushover()\n .sensu()\n .source('Kapacitorsdfasdf')\n .handlers()\n\ntrigger\n |eval(lambda: \"emitted\")\n .as('value')\n .keep('value', messageField, durationField)\n |eval(lambda: float(\"value\"))\n .as('value')\n .keep()\n |influxDBOut()\n .create()\n .database(outputDB)\n .retentionPolicy(outputRP)\n .measurement(outputMeasurement)\n .tag('alertName', name)\n .tag('triggerType', triggerType)\n\ntrigger\n |httpOut('output')\n",
|
|
|
|
query: {
|
|
|
|
id: 'chronograf-v1-1bb60c5d-9c46-4601-8fdd-930ac5d2ae3d',
|
|
|
|
database: 'telegraf',
|
|
|
|
measurement: 'cpu',
|
|
|
|
retentionPolicy: 'autogen',
|
|
|
|
fields: [],
|
|
|
|
tags: {
|
|
|
|
cpu: ['cpu-total', 'cpu1'],
|
|
|
|
},
|
|
|
|
groupBy: {
|
|
|
|
time: '',
|
|
|
|
tags: ['cpu'],
|
|
|
|
},
|
|
|
|
areTagsAccepted: false,
|
|
|
|
rawText: null,
|
|
|
|
range: null,
|
|
|
|
shifts: null,
|
|
|
|
},
|
|
|
|
every: '',
|
|
|
|
alertNodes: {
|
|
|
|
typeOf: 'alert',
|
|
|
|
stateChangesOnly: true,
|
|
|
|
useFlapping: false,
|
|
|
|
post: [],
|
|
|
|
tcp: [],
|
|
|
|
email: [],
|
|
|
|
exec: [],
|
|
|
|
log: [],
|
|
|
|
victorOps: [],
|
|
|
|
pagerDuty: [],
|
|
|
|
pushover: [
|
|
|
|
{
|
|
|
|
userKey: '',
|
|
|
|
device: '',
|
|
|
|
title: '',
|
|
|
|
url: '',
|
|
|
|
urlTitle: '',
|
|
|
|
sound: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
userKey: '',
|
|
|
|
device: '',
|
|
|
|
title: '',
|
|
|
|
url: '',
|
|
|
|
urlTitle: '',
|
|
|
|
sound: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
sensu: [
|
|
|
|
{
|
|
|
|
source: 'Kapacitorsdfasdf',
|
|
|
|
handlers: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
slack: [],
|
|
|
|
telegram: [],
|
|
|
|
hipChat: [],
|
|
|
|
alerta: [],
|
|
|
|
opsGenie: [],
|
|
|
|
talk: [],
|
|
|
|
},
|
|
|
|
message: '',
|
|
|
|
details: '',
|
|
|
|
trigger: 'deadman',
|
|
|
|
values: {
|
|
|
|
period: '1h0m0s',
|
|
|
|
rangeValue: '',
|
|
|
|
},
|
|
|
|
name: 'asdfasdfasdfasdfbob',
|
|
|
|
type: 'stream',
|
|
|
|
dbrps: [
|
|
|
|
{
|
|
|
|
db: 'telegraf',
|
|
|
|
rp: 'autogen',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
status: 'enabled',
|
|
|
|
executing: true,
|
|
|
|
error: '',
|
|
|
|
created: '2018-01-05T15:40:48.195743458-08:00',
|
|
|
|
modified: '2018-03-13T17:17:23.991640555-07:00',
|
|
|
|
'last-enabled': '2018-03-13T17:17:23.991640555-07:00',
|
|
|
|
links: {
|
|
|
|
self:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/rules/chronograf-v1-1bb60c5d-9c46-4601-8fdd-930ac5d2ae3d',
|
|
|
|
kapacitor:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-1bb60c5d-9c46-4601-8fdd-930ac5d2ae3d',
|
|
|
|
output:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-1bb60c5d-9c46-4601-8fdd-930ac5d2ae3d%2Foutput',
|
|
|
|
},
|
|
|
|
},
|
2018-03-16 21:37:03 +00:00
|
|
|
{
|
|
|
|
id: 'chronograf-v1-75b638b0-1530-4163-adab-c9631386e0a2',
|
|
|
|
tickscript:
|
|
|
|
"var db = 'telegraf'\n\nvar rp = 'autogen'\n\nvar measurement = 'disk'\n\nvar groupBy = []\n\nvar whereFilter = lambda: TRUE\n\nvar name = 'Untitled bob'\n\nvar idVar = name + ':{{.Group}}'\n\nvar message = ''\n\nvar idTag = 'alertID'\n\nvar levelTag = 'level'\n\nvar messageField = 'message'\n\nvar durationField = 'duration'\n\nvar outputDB = 'chronograf'\n\nvar outputRP = 'autogen'\n\nvar outputMeasurement = 'alerts'\n\nvar triggerType = 'threshold'\n\nvar crit = 0\n\nvar data = stream\n |from()\n .database(db)\n .retentionPolicy(rp)\n .measurement(measurement)\n .groupBy(groupBy)\n .where(whereFilter)\n |eval(lambda: \"inodes_free\")\n .as('value')\n\nvar trigger = data\n |alert()\n .crit(lambda: \"value\" == crit)\n .stateChangesOnly()\n .message(message)\n .id(idVar)\n .idTag(idTag)\n .levelTag(levelTag)\n .messageField(messageField)\n .durationField(durationField)\n .stateChangesOnly()\n .email()\n .pagerDuty()\n .alerta()\n .environment('bob')\n .origin('kapacitoadfr')\n .services()\n\ntrigger\n |eval(lambda: float(\"value\"))\n .as('value')\n .keep()\n |influxDBOut()\n .create()\n .database(outputDB)\n .retentionPolicy(outputRP)\n .measurement(outputMeasurement)\n .tag('alertName', name)\n .tag('triggerType', triggerType)\n\ntrigger\n |httpOut('output')\n",
|
|
|
|
query: {
|
|
|
|
id: 'chronograf-v1-75b638b0-1530-4163-adab-c9631386e0a2',
|
|
|
|
database: 'telegraf',
|
|
|
|
measurement: 'disk',
|
|
|
|
retentionPolicy: 'autogen',
|
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
value: 'inodes_free',
|
|
|
|
type: 'field',
|
|
|
|
alias: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
tags: {},
|
|
|
|
groupBy: {
|
|
|
|
time: '',
|
|
|
|
tags: [],
|
|
|
|
},
|
|
|
|
areTagsAccepted: false,
|
|
|
|
rawText: null,
|
|
|
|
range: null,
|
|
|
|
shifts: null,
|
|
|
|
},
|
|
|
|
every: '',
|
|
|
|
alertNodes: {
|
|
|
|
typeOf: 'alert',
|
|
|
|
stateChangesOnly: true,
|
|
|
|
useFlapping: false,
|
|
|
|
post: [],
|
|
|
|
tcp: [],
|
|
|
|
email: [
|
|
|
|
{
|
|
|
|
to: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
exec: [],
|
|
|
|
log: [],
|
|
|
|
victorOps: [],
|
|
|
|
pagerDuty: [
|
|
|
|
{
|
|
|
|
serviceKey: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
pushover: [],
|
|
|
|
sensu: [],
|
|
|
|
slack: [],
|
|
|
|
telegram: [],
|
|
|
|
hipChat: [],
|
|
|
|
alerta: [
|
|
|
|
{
|
|
|
|
token: '',
|
|
|
|
resource: '',
|
|
|
|
event: '',
|
|
|
|
environment: 'bob',
|
|
|
|
group: '',
|
|
|
|
value: '',
|
|
|
|
origin: 'kapacitoadfr',
|
|
|
|
service: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
opsGenie: [],
|
|
|
|
talk: [],
|
|
|
|
},
|
|
|
|
message: '',
|
|
|
|
details: '',
|
|
|
|
trigger: 'threshold',
|
|
|
|
values: {
|
|
|
|
operator: 'equal to',
|
|
|
|
value: '0',
|
|
|
|
rangeValue: '',
|
|
|
|
},
|
|
|
|
name: 'Untitled bob',
|
|
|
|
type: 'stream',
|
|
|
|
dbrps: [
|
|
|
|
{
|
|
|
|
db: 'telegraf',
|
|
|
|
rp: 'autogen',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
status: 'disabled',
|
|
|
|
executing: false,
|
|
|
|
error: '',
|
|
|
|
created: '2018-01-05T15:41:22.759905067-08:00',
|
|
|
|
modified: '2018-03-14T18:46:37.940091231-07:00',
|
|
|
|
'last-enabled': '2018-03-14T18:46:32.409262103-07:00',
|
|
|
|
links: {
|
|
|
|
self:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/rules/chronograf-v1-75b638b0-1530-4163-adab-c9631386e0a2',
|
|
|
|
kapacitor:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-75b638b0-1530-4163-adab-c9631386e0a2',
|
|
|
|
output:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-75b638b0-1530-4163-adab-c9631386e0a2%2Foutput',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 'chronograf-v1-7734918d-b8b6-460d-a416-34767ba76faa',
|
|
|
|
tickscript:
|
2018-03-21 01:40:44 +00:00
|
|
|
"var db = 'telegraf'\n\nvar rp = 'autogen'\n\nvar measurement = 'cpu'\n\nvar groupBy = []\n\nvar whereFilter = lambda: (\"host\" == 'Bobs-MacBook-Pro.local')\n\nvar period = 24h\n\nvar name = 'xena'\n\nvar idVar = name + ':{{.Group}}'\n\nvar message = ''\n\nvar idTag = 'alertID'\n\nvar levelTag = 'level'\n\nvar messageField = 'message'\n\nvar durationField = 'duration'\n\nvar outputDB = 'chronograf'\n\nvar outputRP = 'autogen'\n\nvar outputMeasurement = 'alerts'\n\nvar triggerType = 'deadman'\n\nvar threshold = 0.0\n\nvar data = stream\n |from()\n .database(db)\n .retentionPolicy(rp)\n .measurement(measurement)\n .groupBy(groupBy)\n .where(whereFilter)\n\nvar trigger = data\n |deadman(threshold, period)\n .stateChangesOnly()\n .message(message)\n .id(idVar)\n .idTag(idTag)\n .levelTag(levelTag)\n .messageField(messageField)\n .durationField(durationField)\n .hipChat()\n .room('asdf')\n\ntrigger\n |eval(lambda: \"emitted\")\n .as('value')\n .keep('value', messageField, durationField)\n |eval(lambda: float(\"value\"))\n .as('value')\n .keep()\n |influxDBOut()\n .create()\n .database(outputDB)\n .retentionPolicy(outputRP)\n .measurement(outputMeasurement)\n .tag('alertName', name)\n .tag('triggerType', triggerType)\n\ntrigger\n |httpOut('output')\n",
|
2018-03-16 21:37:03 +00:00
|
|
|
query: {
|
|
|
|
id: 'chronograf-v1-7734918d-b8b6-460d-a416-34767ba76faa',
|
|
|
|
database: 'telegraf',
|
|
|
|
measurement: 'cpu',
|
|
|
|
retentionPolicy: 'autogen',
|
|
|
|
fields: [],
|
|
|
|
tags: {
|
2018-03-21 01:40:44 +00:00
|
|
|
host: ['Bobs-MacBook-Pro.local'],
|
2018-03-16 21:37:03 +00:00
|
|
|
},
|
|
|
|
groupBy: {
|
|
|
|
time: '',
|
|
|
|
tags: [],
|
|
|
|
},
|
|
|
|
areTagsAccepted: true,
|
|
|
|
rawText: null,
|
|
|
|
range: null,
|
|
|
|
shifts: null,
|
|
|
|
},
|
|
|
|
every: '',
|
|
|
|
alertNodes: {
|
|
|
|
typeOf: 'alert',
|
|
|
|
stateChangesOnly: true,
|
|
|
|
useFlapping: false,
|
|
|
|
post: [],
|
|
|
|
tcp: [],
|
|
|
|
email: [],
|
|
|
|
exec: [],
|
|
|
|
log: [],
|
|
|
|
victorOps: [],
|
|
|
|
pagerDuty: [],
|
|
|
|
pushover: [],
|
|
|
|
sensu: [],
|
|
|
|
slack: [],
|
|
|
|
telegram: [],
|
|
|
|
hipChat: [
|
|
|
|
{
|
|
|
|
room: 'asdf',
|
|
|
|
token: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
alerta: [],
|
|
|
|
opsGenie: [],
|
|
|
|
talk: [],
|
|
|
|
},
|
|
|
|
message: '',
|
|
|
|
details: '',
|
|
|
|
trigger: 'deadman',
|
|
|
|
values: {
|
|
|
|
period: '24h0m0s',
|
|
|
|
rangeValue: '',
|
|
|
|
},
|
|
|
|
name: 'xena',
|
|
|
|
type: 'stream',
|
|
|
|
dbrps: [
|
|
|
|
{
|
|
|
|
db: 'telegraf',
|
|
|
|
rp: 'autogen',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
status: 'disabled',
|
|
|
|
executing: false,
|
|
|
|
error: '',
|
|
|
|
created: '2018-01-05T15:44:54.657212781-08:00',
|
|
|
|
modified: '2018-03-13T17:17:19.099800735-07:00',
|
|
|
|
'last-enabled': '2018-03-13T17:17:15.964357573-07:00',
|
|
|
|
links: {
|
|
|
|
self:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/rules/chronograf-v1-7734918d-b8b6-460d-a416-34767ba76faa',
|
|
|
|
kapacitor:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-7734918d-b8b6-460d-a416-34767ba76faa',
|
|
|
|
output:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-7734918d-b8b6-460d-a416-34767ba76faa%2Foutput',
|
|
|
|
},
|
|
|
|
},
|
2018-03-21 01:40:44 +00:00
|
|
|
{
|
|
|
|
// if rule has no `query` key, it will display as a tickscript task only
|
|
|
|
id: 'chronograf-v1-7734918d-b8b6-460d-a416-34767ba76aac',
|
|
|
|
tickscript:
|
|
|
|
"var db = 'telegraf'\n\nvar rp = 'autogen'\n\nvar measurement = 'cpu'\n\nvar groupBy = []\n\nvar whereFilter = lambda: (\"host\" == 'Bobs-MacBook-Pro.local')\n\nvar period = 24h\n\nvar name = 'xena'\n\nvar idVar = name + ':{{.Group}}'\n\nvar message = ''\n\nvar idTag = 'alertID'\n\nvar levelTag = 'level'\n\nvar messageField = 'message'\n\nvar durationField = 'duration'\n\nvar outputDB = 'chronograf'\n\nvar outputRP = 'autogen'\n\nvar outputMeasurement = 'alerts'\n\nvar triggerType = 'deadman'\n\nvar threshold = 0.0\n\nvar data = stream\n |from()\n .database(db)\n .retentionPolicy(rp)\n .measurement(measurement)\n .groupBy(groupBy)\n .where(whereFilter)\n\nvar trigger = data\n |deadman(threshold, period)\n .stateChangesOnly()\n .message(message)\n .id(idVar)\n .idTag(idTag)\n .levelTag(levelTag)\n .messageField(messageField)\n .durationField(durationField)\n .hipChat()\n .room('asdf')\n\ntrigger\n |eval(lambda: \"emitted\")\n .as('value')\n .keep('value', messageField, durationField)\n |eval(lambda: float(\"value\"))\n .as('value')\n .keep()\n |influxDBOut()\n .create()\n .database(outputDB)\n .retentionPolicy(outputRP)\n .measurement(outputMeasurement)\n .tag('alertName', name)\n .tag('triggerType', triggerType)\n\ntrigger\n |httpOut('output')\n",
|
|
|
|
every: '',
|
|
|
|
alertNodes: {
|
|
|
|
typeOf: 'alert',
|
|
|
|
stateChangesOnly: true,
|
|
|
|
useFlapping: false,
|
|
|
|
post: [],
|
|
|
|
tcp: [],
|
|
|
|
email: [],
|
|
|
|
exec: [],
|
|
|
|
log: [],
|
|
|
|
victorOps: [],
|
|
|
|
pagerDuty: [],
|
|
|
|
pushover: [],
|
|
|
|
sensu: [],
|
|
|
|
slack: [],
|
|
|
|
telegram: [],
|
|
|
|
hipChat: [
|
|
|
|
{
|
|
|
|
room: 'asdf',
|
|
|
|
token: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
alerta: [],
|
|
|
|
opsGenie: [],
|
|
|
|
talk: [],
|
|
|
|
},
|
|
|
|
message: '',
|
|
|
|
details: '',
|
|
|
|
trigger: 'deadman',
|
|
|
|
values: {
|
|
|
|
period: '24h0m0s',
|
|
|
|
rangeValue: '',
|
|
|
|
},
|
|
|
|
name: 'pineapples',
|
|
|
|
type: 'stream',
|
|
|
|
dbrps: [
|
|
|
|
{
|
|
|
|
db: 'telegraf',
|
|
|
|
rp: 'autogen',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
status: 'enabled',
|
|
|
|
executing: false,
|
|
|
|
error: '',
|
|
|
|
created: '2018-01-05T15:44:54.657212781-08:00',
|
|
|
|
modified: '2018-03-13T17:17:19.099800735-07:00',
|
|
|
|
'last-enabled': '2018-03-13T17:17:15.964357573-07:00',
|
|
|
|
links: {
|
|
|
|
self:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/rules/chronograf-v1-7734918d-b8b6-460d-a416-34767ba76aac',
|
|
|
|
kapacitor:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-7734918d-b8b6-460d-a416-34767ba76aac',
|
|
|
|
output:
|
|
|
|
'/chronograf/v1/sources/1/kapacitors/1/proxy?path=%2Fkapacitor%2Fv1%2Ftasks%2Fchronograf-v1-7734918d-b8b6-460d-a416-34767ba76aac%2Foutput',
|
|
|
|
},
|
|
|
|
},
|
2018-03-14 01:34:34 +00:00
|
|
|
]
|
2018-03-17 04:03:58 +00:00
|
|
|
|
2018-03-15 23:44:18 +00:00
|
|
|
export const authLinks = {
|
|
|
|
allUsers: '/chronograf/v1/users',
|
|
|
|
auth: [
|
|
|
|
{
|
|
|
|
callback: '/oauth/github/callback',
|
|
|
|
label: 'Github',
|
|
|
|
login: '/oauth/github/login',
|
|
|
|
logout: '/oauth/github/logout',
|
|
|
|
name: 'github',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
config: {
|
|
|
|
auth: '/chronograf/v1/config/auth',
|
|
|
|
self: '/chronograf/v1/config',
|
|
|
|
},
|
|
|
|
dashboards: '/chronograf/v1/dashboards',
|
|
|
|
environment: '/chronograf/v1/env',
|
|
|
|
external: {
|
|
|
|
statusFeed: 'https://www.influxdata.com/feed/json',
|
|
|
|
},
|
|
|
|
layouts: '/chronograf/v1/layouts',
|
|
|
|
logout: '/oauth/logout',
|
|
|
|
mappings: '/chronograf/v1/mappings',
|
|
|
|
me: '/chronograf/v1/me',
|
|
|
|
organizations: '/chronograf/v1/organizations',
|
|
|
|
sources: '/chronograf/v1/sources',
|
|
|
|
users: '/chronograf/v1/organizations/default/users',
|
|
|
|
}
|
2018-04-17 01:29:16 +00:00
|
|
|
|
|
|
|
export const layout = {
|
|
|
|
id: '6dfb4d49-20dc-4157-9018-2b1b1cb75c2d',
|
|
|
|
app: 'apache',
|
|
|
|
measurement: 'apache',
|
|
|
|
autoflow: false,
|
|
|
|
cells: [
|
|
|
|
{
|
|
|
|
x: 0,
|
|
|
|
y: 0,
|
|
|
|
w: 4,
|
|
|
|
h: 4,
|
|
|
|
i: '0246e457-916b-43e3-be99-211c4cbc03e8',
|
|
|
|
name: 'Apache Bytes/Second',
|
|
|
|
queries: [
|
|
|
|
{
|
|
|
|
query:
|
|
|
|
'SELECT non_negative_derivative(max("BytesPerSec")) AS "bytes_per_sec" FROM ":db:".":rp:"."apache"',
|
|
|
|
groupbys: ['"server"'],
|
|
|
|
label: 'bytes/s',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
axes: {
|
|
|
|
x: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
|
|
|
y: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
|
|
|
y2: {
|
|
|
|
bounds: [],
|
|
|
|
label: '',
|
|
|
|
prefix: '',
|
|
|
|
suffix: '',
|
|
|
|
base: '',
|
|
|
|
scale: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
type: '',
|
|
|
|
colors: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
x: 4,
|
|
|
|
y: 0,
|
|
|
|
w: 4,
|
|
|
|
h: 4,
|
|
|
|
i: '37f2e4bb-9fa5-4891-a424-9df5ce7458bb',
|
|
|
|
name: 'Apache - Requests/Second',
|
|
|
|
queries: [
|
|
|
|
{
|
|
|
|
query:
|
|
|
|
'SELECT non_negative_derivative(max("ReqPerSec")) AS "req_per_sec" FROM ":db:".":rp:"."apache"',
|
|
|
|
groupbys: ['"server"'],
|
|
|
|
label: 'requests/s',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
axes: {
|
|
|
|
x: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
|
|
|
y: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
|
|
|
y2: {
|
|
|
|
bounds: [],
|
|
|
|
label: '',
|
|
|
|
prefix: '',
|
|
|
|
suffix: '',
|
|
|
|
base: '',
|
|
|
|
scale: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
type: '',
|
|
|
|
colors: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
x: 8,
|
|
|
|
y: 0,
|
|
|
|
w: 4,
|
|
|
|
h: 4,
|
|
|
|
i: 'ea9174b3-2b56-4e80-a37d-064507c6775a',
|
|
|
|
name: 'Apache - Total Accesses',
|
|
|
|
queries: [
|
|
|
|
{
|
|
|
|
query:
|
|
|
|
'SELECT non_negative_derivative(max("TotalAccesses")) AS "tot_access" FROM ":db:".":rp:"."apache"',
|
|
|
|
groupbys: ['"server"'],
|
|
|
|
label: 'accesses/s',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
axes: {
|
|
|
|
x: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
|
|
|
y: {bounds: [], label: '', prefix: '', suffix: '', base: '', scale: ''},
|
|
|
|
y2: {
|
|
|
|
bounds: [],
|
|
|
|
label: '',
|
|
|
|
prefix: '',
|
|
|
|
suffix: '',
|
|
|
|
base: '',
|
|
|
|
scale: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
type: '',
|
|
|
|
colors: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
link: {
|
|
|
|
href: '/chronograf/v1/layouts/6dfb4d49-20dc-4157-9018-2b1b1cb75c2d',
|
|
|
|
rel: 'self',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export const hosts = {
|
|
|
|
'MacBook-Pro.local': {
|
|
|
|
name: 'MacBook-Pro.local',
|
|
|
|
deltaUptime: -1,
|
|
|
|
cpu: 0,
|
|
|
|
load: 0,
|
|
|
|
},
|
|
|
|
}
|
2018-06-08 22:04:24 +00:00
|
|
|
|
|
|
|
// Dashboards
|
|
|
|
export const template: Template = {
|
|
|
|
id: '1',
|
2018-06-12 20:20:30 +00:00
|
|
|
type: TemplateType.TagKeys,
|
2018-06-08 22:04:24 +00:00
|
|
|
label: 'test query',
|
|
|
|
tempVar: ':region:',
|
|
|
|
query: {
|
|
|
|
db: 'db1',
|
|
|
|
rp: 'rp1',
|
|
|
|
tagKey: 'tk1',
|
|
|
|
fieldKey: 'fk1',
|
|
|
|
measurement: 'm1',
|
|
|
|
influxql: 'SHOW TAGS WHERE CHRONOGIRAFFE = "friend"',
|
|
|
|
},
|
|
|
|
values: [
|
2018-06-23 00:17:00 +00:00
|
|
|
{
|
|
|
|
value: 'us-west',
|
|
|
|
type: TemplateValueType.TagKey,
|
|
|
|
selected: false,
|
2018-07-02 20:42:50 +00:00
|
|
|
localSelected: false,
|
2018-06-23 00:17:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 'us-east',
|
|
|
|
type: TemplateValueType.TagKey,
|
|
|
|
selected: true,
|
2018-07-02 20:42:50 +00:00
|
|
|
localSelected: true,
|
2018-06-23 00:17:00 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 'us-mount',
|
|
|
|
type: TemplateValueType.TagKey,
|
|
|
|
selected: false,
|
2018-07-02 20:42:50 +00:00
|
|
|
localSelected: false,
|
2018-06-23 00:17:00 +00:00
|
|
|
},
|
2018-06-08 22:04:24 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2018-06-26 23:52:54 +00:00
|
|
|
export const emptyTemplate: Template = {
|
|
|
|
id: '1',
|
|
|
|
type: TemplateType.CSV,
|
|
|
|
label: '',
|
|
|
|
tempVar: '',
|
|
|
|
query: {},
|
|
|
|
values: [],
|
|
|
|
}
|
|
|
|
|
2018-06-08 22:04:24 +00:00
|
|
|
export const dashboard: Dashboard = {
|
|
|
|
id: 1,
|
|
|
|
cells: [],
|
|
|
|
name: 'd1',
|
|
|
|
templates: [],
|
|
|
|
organization: 'thebestorg',
|
|
|
|
}
|
|
|
|
|
|
|
|
export const cell: Cell = {
|
|
|
|
x: 0,
|
|
|
|
y: 0,
|
|
|
|
w: 4,
|
|
|
|
h: 4,
|
|
|
|
i: '0246e457-916b-43e3-be99-211c4cbc03e8',
|
|
|
|
name: 'Apache Bytes/Second',
|
|
|
|
queries: [],
|
|
|
|
axes: {
|
|
|
|
x: {
|
|
|
|
bounds: ['', ''],
|
|
|
|
label: '',
|
|
|
|
prefix: '',
|
|
|
|
suffix: '',
|
|
|
|
base: '',
|
|
|
|
scale: '',
|
|
|
|
},
|
|
|
|
y: {
|
|
|
|
bounds: ['', ''],
|
|
|
|
label: '',
|
|
|
|
prefix: '',
|
|
|
|
suffix: '',
|
|
|
|
base: '',
|
|
|
|
scale: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
type: CellType.Line,
|
|
|
|
colors: [],
|
|
|
|
tableOptions: {
|
|
|
|
verticalTimeAxis: true,
|
|
|
|
sortBy: {
|
|
|
|
internalName: '',
|
|
|
|
displayName: '',
|
|
|
|
visible: true,
|
|
|
|
},
|
|
|
|
fixFirstColumn: true,
|
|
|
|
},
|
|
|
|
fieldOptions: [],
|
|
|
|
timeFormat: '',
|
|
|
|
decimalPlaces: {
|
|
|
|
isEnforced: false,
|
|
|
|
digits: 1,
|
|
|
|
},
|
|
|
|
links: {
|
|
|
|
self:
|
|
|
|
'/chronograf/v1/dashboards/10/cells/8b3b7897-49b1-422c-9443-e9b778bcbf12',
|
|
|
|
},
|
|
|
|
legend: {},
|
2018-07-16 16:24:10 +00:00
|
|
|
inView: true,
|
2018-06-08 22:04:24 +00:00
|
|
|
}
|