{"id":21469938,"url":"https://github.com/dobin/dmsr","last_synced_at":"2025-07-15T06:32:27.692Z","repository":{"id":185036242,"uuid":"622843211","full_name":"dobin/dmsr","owner":"dobin","description":"Does My Shit Run - Linux Monitoring Solution","archived":false,"fork":false,"pushed_at":"2023-09-25T19:29:09.000Z","size":108,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-09T16:16:32.764Z","etag":null,"topics":["monitoring"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dobin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-03T07:16:50.000Z","updated_at":"2024-02-05T21:40:00.000Z","dependencies_parsed_at":"2023-07-31T13:58:13.607Z","dependency_job_id":"e98ab6d0-aa42-4c5e-a83c-b3e35a80201d","html_url":"https://github.com/dobin/dmsr","commit_stats":null,"previous_names":["dobin/dmsr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fdmsr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fdmsr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fdmsr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dobin%2Fdmsr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dobin","download_url":"https://codeload.github.com/dobin/dmsr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226023534,"owners_count":17561481,"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":["monitoring"],"created_at":"2024-11-23T09:19:32.728Z","updated_at":"2024-11-23T09:19:33.462Z","avatar_url":"https://github.com/dobin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DMSR - Does My Shit Run\n\nA minimalistic monitoring solution to see if my shit still works.\nSee [mon.yookiterm.ch](https://mon.yookiterm.ch) for how I use it.\n\n* Agent based\n* HTTP communication from agent to server\n* Simple python plugins\n* No history\n* No DB, No time series DB\n* No query language\n* No need to run as root\n* No filtering, aggregation, transformation or processing\n\n\n## How it works\n\n* Agent has plugins\n* Agent plugins will generate a JSON and send it to the server with HTTP POST\n* Server stores JSON, overwriting previous\n* Server will pretty print JSON (from all servers, all plugins)\n\nThats it.\n\n\n## Screenshot\n\n![Screenshot](https://raw.githubusercontent.com/dobin/dmsr/main/doc/doesmyshitrun.png)\n\n\n## Install\n\nWe install it as a dedicated user:\n\n```\n$ sudo adduser --disabled-password dmsr\n$ cd /home/dmsr/\n$ su dmsr\n$ git clone https://github.com/dobin/dmsr\n$ cd dmsr/\n$ pip3 install -r requirements.txt\n$ cp agent.yaml.sample agent.yaml    # for agent\n$ cp server.yaml.sample server.yaml  # for server\n$ ./server.py \u0026\n$ ./agent.py\n```\n\nFor persistence, use appropriate systemd file  (for `/etc/systemd/system`): \n* dmsragent.service\n* dmsrserver.service\n\n\n## How to Use\n\nServer: \n* configure `password` in `server.yaml`\n* start server: `./server.py`\n\nAgent: \n* configure `password` and plugins in `agent.yaml`\n* start agent: `./agent.py`\n\n\n## Sample `agent.yaml`\n\nRefreshes are always in seconds.\n\n`agent.yaml.sample`:\n```\nserver: http://localhost:5000\npassword: password\nrefresh: 60\n\nplugins:\n  http:\n    enabled: true\n    urls: \n    - http://localhost:5000\n    refresh: 120\n\n  process:\n    enabled: true\n    processes:\n    - init\n    - asdf\n\n  sysinfo:\n    enabled: true\n    disks:\n    - /\n    show load: true\n    show memory: true\n\n  systemdunit:\n    enabled: false\n    private: true\n    units:\n    - ssh\n```\n\n## Sample `server.yaml`\n\n`server.yaml.sample`:\n```yaml\npassword: password\nadminpw: password\npagerefresh: 60\n```\n\n\n## Admin\n\nConfigure `adminpw` in `server.yaml`. \n\nLogin with `/admin`. \n\nTo make a plugin data private, set `private = true` in `agent.yaml`.\n\n\n## Alarming\n\nPlugins may return non empty `status`, most often with the string `warn`. They decide by themselves when to send it.\n\nThe endpoint `/status` will return HTTP `200` if all status\nare ok, and `500` if at least one is not ok.\n\nUse [Desktop Web Scheduler (DWS)](https://github.com/ozzi-/DWS) to get a notification if some shit doesnt run anymore.\n\n\n## Plugins\n\nCreate the plugin file `helloworld.py`: \n\n```sh\n$ touch plugins/helloworld.py\n```\n\nImplement `helloworld.py`. Class needs to have the same name as the filename.\n\n```python\nfrom typing import Tuple, Dict\nfrom client.plugin import Plugin, PluginStatus\n\nclass helloworld(Plugin):\n    def __init__(self, refresh):\n        super().__init__(refresh)\n\n        # config default for this plugin\n        self.config['output'] = [ \"hello world?\" ]\n\n\n    def run(self) -\u003e Tuple[Dict, PluginStatus]:\n        data = {}\n        status = PluginStatus.OK\n\n        data[\"message\"] = \",\".join(self.config['output'])\n\n        return data, status\n```\n\nupdate `config.yaml`. Use the filename/classname as name, and enable it:\n```yaml\nplugins:\n  helloworld:\n    enabled: true\n    output: \n    - \"Hello World!\"\n```\n\nTest with:\n```\n$ python3 ./agent.py --test helloworld\nTesting plugin helloworld (refresh: 60)\n({'message': 'Hello World!'}, '')\n```\n\nIt will output a tuple where the first element is the data structure\nwhich gets yaml'd as output, and a status code of the plugin (warning, error).\n\n\n## Design Decisions\n\nThere is no history. Stuff is either down currently, or it aint.\n\nThere is no persistence. Dont care about the status 5 minute ago.\n\nThere is no server side configuration.\n* Agent decides what data will be pushed\n* Agent decides how the data will look like\n* Agent decides what the error conditions are\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobin%2Fdmsr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdobin%2Fdmsr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdobin%2Fdmsr/lists"}