{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/1262","repository_url":"https://api.github.com/repos/influxdata/kapacitor","labels_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1262/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1262/comments","events_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1262/events","html_url":"https://github.com/influxdata/kapacitor/issues/1262","id":214518541,"number":1262,"title":"kapacitor steam not triggering alert","user":{"login":"casertap","id":284394,"avatar_url":"https://avatars2.githubusercontent.com/u/284394?v=3","gravatar_id":"","url":"https://api.github.com/users/casertap","html_url":"https://github.com/casertap","followers_url":"https://api.github.com/users/casertap/followers","following_url":"https://api.github.com/users/casertap/following{/other_user}","gists_url":"https://api.github.com/users/casertap/gists{/gist_id}","starred_url":"https://api.github.com/users/casertap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casertap/subscriptions","organizations_url":"https://api.github.com/users/casertap/orgs","repos_url":"https://api.github.com/users/casertap/repos","events_url":"https://api.github.com/users/casertap/events{/privacy}","received_events_url":"https://api.github.com/users/casertap/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-15T20:39:30Z","updated_at":"2017-03-16T00:50:04Z","closed_at":"2017-03-16T00:50:04Z","body":"I tried to have kapacitor trigger a dumb alert that look if cpu usage_idle is > 90 but kapacitor is not triggering. I am interested in having the alert send via slack and in a log file.\r\nI copied my whole config file to make sure I am not missing anything.\r\n\r\nHere is the necessary info:\r\n\r\n```\r\nkapacitor version\r\nKapacitor 1.2.0 (git: master 5408057e5a3493d3b5bd38d5d535ea45b587f8ff)\r\n```\r\n\r\n\r\nkapacitord config\r\n```\r\n/ # kapacitord config\r\n2017/03/15 10:35:52 Merging with configuration at: /etc/kapacitor/kapacitor.conf\r\nhostname = \"kapacitor\"\r\ndata_dir = \"/var/lib/kapacitor\"\r\nskip-config-overrides = false\r\ndefault-retention-policy = \"\"\r\n\r\n[http]\r\n  bind-address = \":9992\"\r\n  auth-enabled = false\r\n  log-enabled = true\r\n  write-tracing = false\r\n  pprof-enabled = false\r\n  https-enabled = false\r\n  https-certificate = \"/etc/ssl/kapacitor.pem\"\r\n  shutdown-timeout = \"10s\"\r\n  shared-secret = \"\"\r\n\r\n[replay]\r\n  dir = \"/var/lib/kapacitor/replay\"\r\n\r\n[storage]\r\n  boltdb = \"/var/lib/kapacitor/kapacitor.db\"\r\n\r\n[task]\r\n  dir = \"/root/.kapacitor/tasks\"\r\n  snapshot-interval = \"1m0s\"\r\n\r\n[[influxdb]]\r\n  enabled = true\r\n  name = \"default\"\r\n  default = true\r\n  urls = [\"http://influxdb:8086\"]\r\n  username = \"root\"\r\n  password = \"password\"\r\n  ssl-ca = \"\"\r\n  ssl-cert = \"\"\r\n  ssl-key = \"\"\r\n  insecure-skip-verify = false\r\n  timeout = \"0s\"\r\n  disable-subscriptions = false\r\n  subscription-protocol = \"http\"\r\n  kapacitor-hostname = \"\"\r\n  http-port = 0\r\n  udp-bind = \"\"\r\n  udp-buffer = 1000\r\n  udp-read-buffer = 0\r\n  startup-timeout = \"5m0s\"\r\n  subscriptions-sync-interval = \"1m0s\"\r\n  [influxdb.excluded-subscriptions]\r\n    _kapacitor = [\"autogen\"]\r\n\r\n[logging]\r\n  file = \"/var/log/kapacitor.log\"\r\n  level = \"CRITICAL\"\r\n\r\n[config-override]\r\n  enabled = true\r\n\r\n[alert]\r\n\r\n[collectd]\r\n  enabled = false\r\n  bind-address = \":25826\"\r\n  database = \"collectd\"\r\n  retention-policy = \"\"\r\n  batch-size = 5000\r\n  batch-pending = 10\r\n  batch-timeout = \"10s\"\r\n  read-buffer = 0\r\n  typesdb = \"/usr/share/collectd/types.db\"\r\n\r\n[opentsdb]\r\n  enabled = false\r\n  bind-address = \":4242\"\r\n  database = \"opentsdb\"\r\n  retention-policy = \"\"\r\n  consistency-level = \"one\"\r\n  tls-enabled = false\r\n  certificate = \"/etc/ssl/influxdb.pem\"\r\n  batch-size = 1000\r\n  batch-pending = 5\r\n  batch-timeout = \"1s\"\r\n  log-point-errors = true\r\n\r\n[alerta]\r\n  enabled = false\r\n  url = \"\"\r\n  insecure-skip-verify = false\r\n  token = \"\"\r\n  environment = \"\"\r\n  origin = \"\"\r\n\r\n[hipchat]\r\n  enabled = false\r\n  url = \"\"\r\n  token = \"\"\r\n  room = \"\"\r\n  global = false\r\n  state-changes-only = false\r\n\r\n[opsgenie]\r\n  enabled = false\r\n  api-key = \"\"\r\n  url = \"https://api.opsgenie.com/v1/json/alert\"\r\n  recovery_url = \"https://api.opsgenie.com/v1/json/alert/note\"\r\n  global = false\r\n\r\n[pagerduty]\r\n  enabled = false\r\n  url = \"https://events.pagerduty.com/generic/2010-04-15/create_event.json\"\r\n  service-key = \"\"\r\n  global = false\r\n\r\n[smtp]\r\n  enabled = false\r\n  host = \"localhost\"\r\n  port = 25\r\n  username = \"\"\r\n  password = \"\"\r\n  no-verify = false\r\n  global = false\r\n  state-changes-only = false\r\n  from = \"\"\r\n  idle-timeout = \"30s\"\r\n\r\n[snmptrap]\r\n  enabled = false\r\n  addr = \"localhost:162\"\r\n  community = \"kapacitor\"\r\n  retries = 1\r\n\r\n[sensu]\r\n  enabled = false\r\n  addr = \"\"\r\n  source = \"Kapacitor\"\r\n\r\n[slack]\r\n  enabled = true\r\n  url = \"https://hooks.slack.com/services/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\"\r\n  channel = \"#general\"\r\n  username = \"kapacitor\"\r\n  icon-emoji = \"\"\r\n  global = false\r\n  state-changes-only = false\r\n\r\n[talk]\r\n  enabled = false\r\n  url = \"\"\r\n  author_name = \"\"\r\n\r\n[telegram]                       \r\n  enabled = false\r\n  url = \"https://api.telegram.org/bot\"\r\n  token = \"\"\r\n  chat-id = \"\"\r\n  parse-mode = \"\"\r\n  disable-web-page-preview = false\r\n  disable-notification = false\r\n  global = false\r\n  state-changes-only = false\r\n\r\n[victorops]\r\n  enabled = false\r\n  api-key = \"\"\r\n  routing-key = \"\"\r\n  url = \"https://alert.victorops.com/integrations/generic/20131114/alert\"\r\n  global = false\r\n\r\n[kubernetes]\r\n  enabled = false\r\n  in-cluster = false\r\n  token = \"\"\r\n  ca-path = \"\"\r\n  namespace = \"\"\r\n\r\n[reporting]\r\n  enabled = true\r\n  url = \"https://usage.influxdata.com\"\r\n\r\n[stats]\r\n  enabled = true\r\n  stats-interval = \"10s\"\r\n  database = \"_kapacitor\"\r\n  retention-policy = \"autogen\"\r\n  timing-sample-rate = 0.1\r\n  timing-movavg-size = 1000\r\n\r\n[udf]\r\n\r\n[deadman]\r\n  interval = \"10s\"\r\n  threshold = 0.0\r\n  id = \"{{ .Group }}:NODE_NAME for task '{{ .TaskName }}'\"\r\n  message = \"{{ .ID }} is {{ if eq .Level \\\"OK\\\" }}alive{{ else }}dead{{ end }}: {{ index .Fields \\\"emitted\\\" | printf \\\"%0.3f\\\" }} points/INTERVAL.\"\r\n  global = false\r\n```\r\n\r\n\r\ntail -f /var/log/kapacitor.log\r\n```\r\n/ # tail -f /var/log/kapacitor.log\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:35:51 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 2974b945-096b-11e7-8043-000000000000 481\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:35:52 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 299d85f3-096b-11e7-8044-000000000000 393\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:35:52 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 29a6b77c-096b-11e7-8045-000000000000 310\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:35:52 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 29bc9b96-096b-11e7-8046-000000000000 861\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:01 +0000] \"POST /write?consistency=&db=_internal&precision=ns&rp=monitor HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 2f2cc673-096b-11e7-8047-000000000000 723\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:01 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 2f5c0133-096b-11e7-8048-000000000000 1325\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:01 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 2f6aaa02-096b-11e7-8049-000000000000 357\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:02 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 2f937039-096b-11e7-804a-000000000000 445\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:02 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 2f9d16c0-096b-11e7-804b-000000000000 342\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:02 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 2fb2f67a-096b-11e7-804c-000000000000 884\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:11 +0000] \"POST /write?consistency=&db=_internal&precision=ns&rp=monitor HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3522a614-096b-11e7-804d-000000000000 1707\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:11 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 35522059-096b-11e7-804e-000000000000 1402\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:11 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 35606573-096b-11e7-804f-000000000000 355\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:12 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 35892aa1-096b-11e7-8050-000000000000 351\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:12 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3592998d-096b-11e7-8051-000000000000 425\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:12 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 35a84048-096b-11e7-8052-000000000000 948\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:21 +0000] \"POST /write?consistency=&db=_internal&precision=ns&rp=monitor HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3b19a83a-096b-11e7-8053-000000000000 473\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:21 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3b48230e-096b-11e7-8054-000000000000 1291\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:21 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3b565426-096b-11e7-8055-000000000000 390\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:22 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3b7f239e-096b-11e7-8056-000000000000 395\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:22 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3b892668-096b-11e7-8057-000000000000 300\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:22 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 3b9edded-096b-11e7-8058-000000000000 973\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:31 +0000] \"POST /write?consistency=&db=_internal&precision=ns&rp=monitor HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 410ee507-096b-11e7-8059-000000000000 472\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:31 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 413d6969-096b-11e7-805a-000000000000 1354\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:31 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 414c3860-096b-11e7-805b-000000000000 393\r\n[httpd] 10.0.0.27 - - [15/Mar/2017:10:36:32 +0000] \"POST /write?consistency=&db=telegraf&precision=ns&rp=autogen HTTP/1.1\" 204 0 \"-\" \"InfluxDBClient\" 41750eb9-096b-11e7-805c-000000000000 394\r\n```\r\n\r\nthe alert definition (it should be triggered but triggered 0 times)\r\nAlert is triggering slack and log\r\n\r\n```\r\n/ # kapacitor show cpu_alert\r\nID: cpu_alert\r\nError:\r\nTemplate:\r\nType: stream\r\nStatus: enabled\r\nExecuting: true\r\nCreated: 15 Mar 17 10:35 UTC\r\nModified: 15 Mar 17 10:35 UTC\r\nLastEnabled: 15 Mar 17 10:35 UTC\r\nDatabases Retention Policies: [\"telegraf\".\"default\"]\r\nTICKscript:\r\nstream\r\n    |from()\r\n        .database('telegraf')\r\n        .measurement('cpu')\r\n        .groupBy(*)\r\n    |window()\r\n        .period(10s)\r\n        .every(10s)\r\n        .align()\r\n    |mean('usage_idle')\r\n        .as('usage_idle')\r\n    |alert()\r\n        .message('{{ .ID }} is {{ .Level }} value:{{ index .Fields \"value\" }}')\r\n        .warn(lambda: \"usage_idle\" > 90)\r\n        .warnReset(lambda: \"usage_idle\" < 90)\r\n        .log('/tmp/alerts.log')\r\n        .slack()\r\n        .channel('#general')\r\n\r\nDOT:\r\ndigraph cpu_alert {\r\ngraph [throughput=\"0.00 points/s\"];\r\n\r\nstream0 [avg_exec_time_ns=\"0s\" ];\r\nstream0 -> from1 [processed=\"0\"];\r\n\r\nfrom1 [avg_exec_time_ns=\"0s\" ];\r\nfrom1 -> window2 [processed=\"0\"];\r\n\r\nwindow2 [avg_exec_time_ns=\"0s\" ];\r\nwindow2 -> mean3 [processed=\"0\"];\r\n\r\nmean3 [avg_exec_time_ns=\"0s\" ];\r\nmean3 -> alert4 [processed=\"0\"];\r\n\r\nalert4 [alerts_triggered=\"0\" avg_exec_time_ns=\"0s\" crits_triggered=\"0\" infos_triggered=\"0\" oks_triggered=\"0\" warns_triggered=\"0\" ];\r\n}\r\n```\r\n\r\ncat /tmp/alerts.log\r\n```\r\n/tmp/alerts.log does not exists\r\n```\r\n\r\n\r\n\r\nstat\r\n```\r\n/ # kapacitor stats general\r\nClusterID:                    d6a66e8f-4264-4a57-ad9c-d5dd86b2be1e\r\nServerID:                     409877e5-75ce-4661-a00b-3b4ac0eff69f\r\nHost:                         kapacitor\r\nTasks:                        1\r\nEnabled Tasks:                1\r\nSubscriptions:                2\r\nVersion:                      1.2.0\r\n```\r\n\r\ninfluxdb subscriptions\r\n```\r\n/ # influx\r\nConnected to http://localhost:8086 version 1.2.1\r\nInfluxDB shell version: 1.2.1\r\n> show subscriptions\r\nname: _internal\r\nretention_policy name                                           mode destinations\r\n---------------- ----                                           ---- ------------\r\nmonitor          kapacitor-d6a66e8f-4264-4a57-ad9c-d5dd86b2be1e ANY  [http://kapacitor:9992]\r\n\r\n\r\nname: telegraf\r\nretention_policy name                                           mode destinations\r\n---------------- ----                                           ---- ------------\r\nautogen          kapacitor-d6a66e8f-4264-4a57-ad9c-d5dd86b2be1e ANY  [http://kapacitor:9992]\r\n```\r\n\r\nquery influx to see if usage_idle is > 90\r\n```\r\n> select usage_idle from cpu limit 20\r\nname: cpu\r\ntime                usage_idle\r\n----                ----------\r\n1489309060000000000 97.33606557375018\r\n1489309060000000000 97.33606557375018\r\n1489309070000000000 97.7505112474688\r\n1489309070000000000 97.7505112474688\r\n1489309080000000000 94.99478623563074\r\n1489309080000000000 94.99478623563074\r\n1489309090000000000 88.41201716739738\r\n1489309090000000000 88.41201716739738\r\n1489309100000000000 71.38121546960934\r\n1489309100000000000 71.38121546960934\r\n1489309110000000000 72.4750277469589\r\n1489309110000000000 72.4750277469589\r\n1489309120000000000 83.3684210526132\r\n1489309120000000000 83.3684210526132\r\n1489309130000000000 91.07883817430165\r\n1489309130000000000 91.07883817430165\r\n1489309140000000000 96.1224489795826\r\n1489309140000000000 96.1224489795826\r\n1489309150000000000 96.93251533743039\r\n1489309150000000000 96.93251533743039\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/comments/286925036","html_url":"https://github.com/influxdata/kapacitor/issues/1262#issuecomment-286925036","issue_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1262","id":286925036,"user":{"login":"desa","id":1477539,"avatar_url":"https://avatars2.githubusercontent.com/u/1477539?v=3","gravatar_id":"","url":"https://api.github.com/users/desa","html_url":"https://github.com/desa","followers_url":"https://api.github.com/users/desa/followers","following_url":"https://api.github.com/users/desa/following{/other_user}","gists_url":"https://api.github.com/users/desa/gists{/gist_id}","starred_url":"https://api.github.com/users/desa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desa/subscriptions","organizations_url":"https://api.github.com/users/desa/orgs","repos_url":"https://api.github.com/users/desa/repos","events_url":"https://api.github.com/users/desa/events{/privacy}","received_events_url":"https://api.github.com/users/desa/received_events","type":"User","site_admin":false},"created_at":"2017-03-16T00:50:04Z","updated_at":"2017-03-16T00:50:04Z","body":"@casertap you've configured your tickscript with the `-dbrp telegraf.default`, but your data is in the `autogen` retention policy. Try using the flag `-dbrp telegraf.autogen`"}}
{"actor":{"display_login":"desa"}}