{"id":13449421,"url":"https://github.com/madflojo/automatron","last_synced_at":"2025-03-22T22:32:59.004Z","repository":{"id":44557526,"uuid":"58887619","full_name":"madflojo/automatron","owner":"madflojo","description":"Infrastructure monitoring framework turning DevOps runbooks into automated actions","archived":true,"fork":false,"pushed_at":"2018-09-02T05:34:18.000Z","size":900,"stargazers_count":394,"open_issues_count":4,"forks_count":60,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-10-28T16:44:54.211Z","etag":null,"topics":["devops","devops-tools","docker","health-check","jinja2","monitoring","python","remote-execution","runbook","self-healing"],"latest_commit_sha":null,"homepage":"https://automatron.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madflojo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-15T22:25:35.000Z","updated_at":"2024-08-31T02:18:23.000Z","dependencies_parsed_at":"2022-09-02T07:10:27.157Z","dependency_job_id":null,"html_url":"https://github.com/madflojo/automatron","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madflojo%2Fautomatron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madflojo%2Fautomatron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madflojo%2Fautomatron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madflojo%2Fautomatron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madflojo","download_url":"https://codeload.github.com/madflojo/automatron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245029173,"owners_count":20549657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","devops-tools","docker","health-check","jinja2","monitoring","python","remote-execution","runbook","self-healing"],"created_at":"2024-07-31T06:00:37.661Z","updated_at":"2025-03-22T22:32:58.590Z","avatar_url":"https://github.com/madflojo.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/madflojo/automatron.svg?branch=master)](https://travis-ci.org/madflojo/automatron) [![Coverage Status](https://coveralls.io/repos/github/madflojo/automatron/badge.svg?branch=master)](https://coveralls.io/github/madflojo/automatron?branch=master)\n\n\n![Automatron](https://raw.githubusercontent.com/madflojo/automatron/master/docs/img/logo_huge.png)\n\nAutomatron is a framework for creating self-healing infrastructure. Simply put, it detects system events \u0026 takes action to correct them.\n\nThe goal of Automatron is to allow users to automate the execution of common tasks performed during system events. These tasks can be as simple as **sending an email** to as complicated as **restarting services across multiple hosts**.\n\n![Automatron Dashboard](https://raw.githubusercontent.com/madflojo/automatron/develop/docs/img/dashboard.png)\n\n## Features\n\n  * Automatically detect and add new systems to monitor\n  * Monitoring is executed over SSH and completely **agent-less**\n  * Policy based Runbooks allow for monitoring policies rather than server specific configurations\n  * Supports Nagios compliant health check scripts\n  * Allows dead simple **arbitrary shell commands** for both checks and actions\n  * Runbook flexibility with **Jinja2** templating support\n  * Pluggable Architecture that simplifies customization\n\n## Runbooks\n\nThe core of Automatron is based around **Runbooks**. Runbooks are policies that define health checks and actions. You can think of them in the same way you would think of a printed runbook. Except with Automatron, the actions are automated.\n\n### A simple Runbook example\n\nThe below runbook is a very basic example, it will check if NGINX is running (every 2 minutes) and restart it after 2 unsuccessful checks.\n\n```yaml+jinja\nname: Check NGINX\nschedule: \"*/2 * * * *\"\nchecks:\n  nginx_is_running:\n    execute_from: target\n    type: cmd\n    cmd: service nginx status\nactions:\n  restart_nginx:\n    execute_from: target\n    trigger: 2\n    frequency: 300\n    call_on:\n      - WARNING\n      - CRITICAL\n      - UNKNOWN\n    type: cmd\n    cmd: service nginx restart\n```\n\nThe above actions will be performed every 300 seconds (5 minutes) until the health check returns an OK status. This delay allows time for NGINX to restart after each execution.\n\n### A complex Runbook with Jinja2\n\nThis next runbook example is a more complex version of the above. In this example we will use Jinja2 and Automatron's Facts to enhance our runbook further.\n\n```yaml+jinja\nname: Check NGINX\n{% if \"prod\" in facts['hostname'] %}\nschedule:\n  second: */20\n{% else %}\nschedule: \"*/2 * * * *\"\n{% endif %}\nchecks:\n  nginx_is_running:\n    execute_from: target\n    type: cmd\n    cmd: service nginx status\nactions:\n  restart_nginx:\n    execute_from: target\n    trigger: 2\n    frequency: 300\n    call_on:\n      - WARNING\n      - CRITICAL\n      - UNKNOWN\n    type: cmd\n    cmd: service nginx restart\n  remove_from_dns:\n    execute_from: remote\n    trigger: 0\n    frequency: 0\n    call_on:\n      - WARNING\n      - CRITICAL\n      - UNKNOWN\n    type: plugin\n    plugin: cloudflare/dns.py\n    args: remove test@example.com apikey123 example.com --content {{ facts['network']['eth0']['v4'][0] }}\n```\n\nThe above example uses **Jinja2** and **Facts** to create a conditional schedule. If our target server has a hostname that contains the word \"prod\" within it. The schedule for the health check will be every 20 seconds. If not, it will be every 2 minutes.\n\nAnother addition is the `remove_from_dns` action, which will remove the target server's DNS entry using the **CloudFlare DNS** plugin.\n\nBy using **Facts** and **Jinja2** together you can customize a single runbook to cover unique actions for multiple hosts and environments.\n\n## Stay in the loop\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/automatronio.svg?style=flat-square)](https://twitter.com/automatronio) [![Gitter](https://badges.gitter.im/madflojo/automatron.svg)](https://gitter.im/madflojo/automatron?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n## License\n\n```\n Copyright 2016 Benjamin Cane\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadflojo%2Fautomatron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadflojo%2Fautomatron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadflojo%2Fautomatron/lists"}