{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/985","repository_url":"https://api.github.com/repos/influxdata/kapacitor","labels_url":"https://api.github.com/repos/influxdata/kapacitor/issues/985/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/kapacitor/issues/985/comments","events_url":"https://api.github.com/repos/influxdata/kapacitor/issues/985/events","html_url":"https://github.com/influxdata/kapacitor/issues/985","id":184966560,"number":985,"title":"Starting an empty kapacitord and registering the alerts later is fragile","user":{"login":"rolele","id":22406571,"avatar_url":"https://avatars.githubusercontent.com/u/22406571?v=3","gravatar_id":"","url":"https://api.github.com/users/rolele","html_url":"https://github.com/rolele","followers_url":"https://api.github.com/users/rolele/followers","following_url":"https://api.github.com/users/rolele/following{/other_user}","gists_url":"https://api.github.com/users/rolele/gists{/gist_id}","starred_url":"https://api.github.com/users/rolele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolele/subscriptions","organizations_url":"https://api.github.com/users/rolele/orgs","repos_url":"https://api.github.com/users/rolele/repos","events_url":"https://api.github.com/users/rolele/events{/privacy}","received_events_url":"https://api.github.com/users/rolele/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-24T22:01:13Z","updated_at":"2016-10-24T22:12:41Z","closed_at":null,"body":"I am running kapacitor in swarm mode.\r\nkapacitord is a running container that I start using: \r\n```\r\ndocker service create \r\n--name kapacitor \r\n--network appnet \r\n-p 9092:9092 \r\n--constraint 'node.labels.monitoring == true' \r\n--mount type=bind,src=/mnt/glusterfs/kapacitor/kapacitor.conf,dst=/etc/kapacitor/kapacitor.conf,readonly \r\nkapacitor \r\n```\r\n\r\nThis service is quite useless I have to run another service and do a trick to tell swarm that it is not a long running service and when it ends this is normal do not try to restart it (--restart-condition none):\r\n ``` \r\ndocker service create \r\n--name kapacitor_tick1 \r\n--network appnet \r\n--restart-condition none\r\n--constraint 'node.labels.monitoring == true' \r\n--mount type=bind,src=/mnt/glusterfs/kapacitor/cpu_alert.tick,dst=/root/cpu_alert.tick,readonly\r\n -w=/root \r\n-e KAPACITOR_URL='http://kapacitor:9092' \r\nkapacitor bash -c \"kapacitor define cpu_alert -type stream -dbrp telegraf.default -tick /root/cpu_alert.tick && kapacitor enable cpu_alert\"\r\n```\r\n\r\nOk so I can include that in my ansible script so everything is fine at startup.\r\nNow I can receive alerts if anything goes wrong.\r\n\r\nIf for whatever reason the kapacitord container crash, swarm will restart it automatically but the new container will not have the cpu_alert registered anymore. So it will look like everything is ok but it is not\r\n\r\nI think a more robust option will be to be able to start kapacitord with some tick scripts included (without using the CLI to register them).\r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/comments/255881443","html_url":"https://github.com/influxdata/kapacitor/issues/985#issuecomment-255881443","issue_url":"https://api.github.com/repos/influxdata/kapacitor/issues/985","id":255881443,"user":{"login":"rolele","id":22406571,"avatar_url":"https://avatars.githubusercontent.com/u/22406571?v=3","gravatar_id":"","url":"https://api.github.com/users/rolele","html_url":"https://github.com/rolele","followers_url":"https://api.github.com/users/rolele/followers","following_url":"https://api.github.com/users/rolele/following{/other_user}","gists_url":"https://api.github.com/users/rolele/gists{/gist_id}","starred_url":"https://api.github.com/users/rolele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolele/subscriptions","organizations_url":"https://api.github.com/users/rolele/orgs","repos_url":"https://api.github.com/users/rolele/repos","events_url":"https://api.github.com/users/rolele/events{/privacy}","received_events_url":"https://api.github.com/users/rolele/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T22:12:41Z","updated_at":"2016-10-24T22:12:41Z","body":"This was not clear to me. Thanks a lot. I will try that soon.\r\nI can close this for now."}}
{"actor":{"display_login":"rolele"}}