{"__v":32,"_id":"55d3b648f77e6d0d00b1b29a","category":{"__v":3,"_id":"55d3b645f77e6d0d00b1b275","pages":["55d3b648f77e6d0d00b1b297","55d3b648f77e6d0d00b1b298","55d3b648f77e6d0d00b1b299","55d3b648f77e6d0d00b1b29a","55d3b648f77e6d0d00b1b29b","55d4dc5e9c4e4a0d00ff67c5","55d51f70e60a2f0d00b88add"],"project":"55c505b41469ad2500fa2ab7","version":"55d3b644f77e6d0d00b1b273","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-07T19:23:34.369Z","from_sync":false,"order":1,"slug":"getting-started","title":"Getting Started"},"parentDoc":null,"project":"55c505b41469ad2500fa2ab7","user":"55c50f4a7c199a2f00665cbf","version":{"__v":6,"_id":"55d3b644f77e6d0d00b1b273","project":"55c505b41469ad2500fa2ab7","createdAt":"2015-08-18T22:48:36.632Z","releaseDate":"2015-08-18T22:48:36.632Z","categories":["55d3b645f77e6d0d00b1b274","55d3b645f77e6d0d00b1b275","55d3b645f77e6d0d00b1b276","55d3b645f77e6d0d00b1b277","55d3b645f77e6d0d00b1b278","55d3b645f77e6d0d00b1b279","55d3b645f77e6d0d00b1b27a","55d3b645f77e6d0d00b1b27b","55d3b645f77e6d0d00b1b27c","55d3b645f77e6d0d00b1b27d","55d7c2939510f00d007ec6fe","56fac9925df15a20002972a2","56fb2f7668e1d30e00a0b672","583498d411e8af2500f6b334","58e52a180ab7b03b00f4a97a"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-08-10T23:07:10.246Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"This guide will help you create rules to execute an action in response to a trigger \n\n## Default rules\nOnce you integrate your monitoring tools and infrastructure you will be guided to an use-cases page where you can create default rules for all the alarms in your monitoring tool. You will be able to edit these rules and customize them later on.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/gyjWHyw0SqmwiyDAaThy_defaultRules.png\",\n        \"defaultRules.png\",\n        \"1430\",\n        \"713\",\n        \"#5fa8bd\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Step 1 : Create a single rule \n\nAt any point you will be able to create a single rule by clicking 'Create rule' in your left sidebar. Then\n\n1. **Select trigger :** Select a monitoring tool and an alarm of your choice\n2. **Define an action :** We currently support these actions:\n    * Email runbook : You can write a set of commands and your on-call engineer will get the runbook in email or a slack channel\n    * Execute script : Neptune agent will execute the runbook on the server\n    * Capture metrics : You will be able to get a snapshot of graph or metrics when the alarm triggers\n    * CLI actions : You can write your cloud CLI commands and they get executed\n    * Other Cloud API actions : Start, stop, reboot your servers\n\nFor more details please refer to sections on [triggers](doc:triggers-overview) and [actions](doc:actions-overview)\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f4ImREHsTLOoB8uQSguD_createRule.png\",\n        \"createRule.png\",\n        \"1552\",\n        \"852\",\n        \"#730544\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Step 2 : Write your runbook or select a runbook template from our community repo\n\nWe spoke to over 200 DevOps teams and collected the best practice runbooks and open sourced them on [github](https://github.com/neptuneio/Community-runbooks). You can search for your use-case (e.g : memory) and select a template and then customize it.  OR you can write your own set of shell commands as a runbook. Please save your runbook changes before creating a rule\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/FjwxOFdQROyLiH4yQCUW_selectRunbook.png\",\n        \"selectRunbook.png\",\n        \"1321\",\n        \"751\",\n        \"#3c74d3\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n## Step 4 : Give a good rule name and create the rule\n\nE.g : Get memory diagnostics when error rate goes up \n* Try avoiding backslashes and other special characters\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/rOMBezywSoOwcKYDMdJ9_ruleName.png\",\n        \"ruleName.png\",\n        \"1705\",\n        \"635\",\n        \"#5eb695\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Step 5 : Manage all your rules in the dashboard\n\n1. You can view, edit , toggle and delete all your rules from the dashbord\n2. You can also see rule statistics at a glance (successful vs failures)\n3. Select multiple rules and delete them if needed\n4.  You can see last 50 recent triggers and actions \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/Vw6epq4tQ5C0eI42bWW5_rulesDashboard.png\",\n        \"rulesDashboard.png\",\n        \"1502\",\n        \"917\",\n        \"#780642\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Congratulations ! You have successfully created your first rule. Now manage your incidents and create more rules\",\n  \"body\": \"[Next step : Manage incidents](doc:manage-incidents)\"\n}\n[/block]","excerpt":"","slug":"create-rules","type":"basic","title":"Create Rules"}
This guide will help you create rules to execute an action in response to a trigger ## Default rules Once you integrate your monitoring tools and infrastructure you will be guided to an use-cases page where you can create default rules for all the alarms in your monitoring tool. You will be able to edit these rules and customize them later on. [block:image] { "images": [ { "image": [ "https://files.readme.io/gyjWHyw0SqmwiyDAaThy_defaultRules.png", "defaultRules.png", "1430", "713", "#5fa8bd", "" ] } ] } [/block] ## Step 1 : Create a single rule At any point you will be able to create a single rule by clicking 'Create rule' in your left sidebar. Then 1. **Select trigger :** Select a monitoring tool and an alarm of your choice 2. **Define an action :** We currently support these actions: * Email runbook : You can write a set of commands and your on-call engineer will get the runbook in email or a slack channel * Execute script : Neptune agent will execute the runbook on the server * Capture metrics : You will be able to get a snapshot of graph or metrics when the alarm triggers * CLI actions : You can write your cloud CLI commands and they get executed * Other Cloud API actions : Start, stop, reboot your servers For more details please refer to sections on [triggers](doc:triggers-overview) and [actions](doc:actions-overview) [block:image] { "images": [ { "image": [ "https://files.readme.io/f4ImREHsTLOoB8uQSguD_createRule.png", "createRule.png", "1552", "852", "#730544", "" ] } ] } [/block] ## Step 2 : Write your runbook or select a runbook template from our community repo We spoke to over 200 DevOps teams and collected the best practice runbooks and open sourced them on [github](https://github.com/neptuneio/Community-runbooks). You can search for your use-case (e.g : memory) and select a template and then customize it. OR you can write your own set of shell commands as a runbook. Please save your runbook changes before creating a rule [block:image] { "images": [ { "image": [ "https://files.readme.io/FjwxOFdQROyLiH4yQCUW_selectRunbook.png", "selectRunbook.png", "1321", "751", "#3c74d3", "" ] } ] } [/block] ## Step 4 : Give a good rule name and create the rule E.g : Get memory diagnostics when error rate goes up * Try avoiding backslashes and other special characters [block:image] { "images": [ { "image": [ "https://files.readme.io/rOMBezywSoOwcKYDMdJ9_ruleName.png", "ruleName.png", "1705", "635", "#5eb695", "" ] } ] } [/block] ## Step 5 : Manage all your rules in the dashboard 1. You can view, edit , toggle and delete all your rules from the dashbord 2. You can also see rule statistics at a glance (successful vs failures) 3. Select multiple rules and delete them if needed 4. You can see last 50 recent triggers and actions [block:image] { "images": [ { "image": [ "https://files.readme.io/Vw6epq4tQ5C0eI42bWW5_rulesDashboard.png", "rulesDashboard.png", "1502", "917", "#780642", "" ] } ] } [/block] [block:callout] { "type": "success", "title": "Congratulations ! You have successfully created your first rule. Now manage your incidents and create more rules", "body": "[Next step : Manage incidents](doc:manage-incidents)" } [/block]