{"id":25883172,"url":"https://github.com/maxlath/os-health-report","last_synced_at":"2025-08-28T02:45:06.790Z","repository":{"id":67787932,"uuid":"81974605","full_name":"maxlath/os-health-report","owner":"maxlath","description":"A micro server reporting simple information on its (Linux) host machine","archived":false,"fork":false,"pushed_at":"2025-03-16T16:48:50.000Z","size":24,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T17:33:04.764Z","etag":null,"topics":["cpu","disk","linux","memory","monitoring","services","systemd"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxlath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-14T18:10:17.000Z","updated_at":"2025-03-16T16:48:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d24bedd-f1a0-4c4c-b1a4-e4e85db194f3","html_url":"https://github.com/maxlath/os-health-report","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxlath/os-health-report","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fos-health-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fos-health-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fos-health-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fos-health-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxlath","download_url":"https://codeload.github.com/maxlath/os-health-report/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxlath%2Fos-health-report/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272424372,"owners_count":24932893,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpu","disk","linux","memory","monitoring","services","systemd"],"created_at":"2025-03-02T16:31:48.726Z","updated_at":"2025-08-28T02:45:06.782Z","avatar_url":"https://github.com/maxlath.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# os-health-report\n\nA micro server reporting simple information on its (Linux) host machine:\n```json\n{ \"memory_used\": 0.81, \"disk_used\": 0.49, \"cpu_used\": 0.13 }\n```\nThose are fractions of the total resources available.\n\n## Summary\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Installation](#installation)\n- [Start](#start)\n- [API](#api)\n  - [Get memory, CPU and disk used fraction](#get-memory-cpu-and-disk-used-fraction)\n  - [Get systemd services statuses](#get-systemd-services-statuses)\n  - [Get docker containers statuses](#get-docker-containers-statuses)\n- [Use HTTP instead of HTTPS](#use-http-instead-of-https)\n- [Documentation](#documentation)\n  - [CPU](#cpu)\n- [See also](#see-also)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n```sh\ngit clone https://github.com/maxlath/os-health-report.git\ncd os-health-report\nnpm install\n```\n\n## Start\n* As a normal process\n```sh\nnpm start\n# Check that everything is fine\ncurl -k https://localhost:1112\n```\n\n* As a daemon handled by [systemd](https://en.wikipedia.org/wiki/Systemd)\n```sh\n# Uses sudo so you will be prompt for your password\nnpm run add-to-systemd\nsudo systemctl start os-health-report\n# Check that everything is fine\nsudo systemctl status os-health-report\ncurl -k https://localhost:1112\n```\n\n## API\n### Get memory, CPU and disk used fraction\n```sh\ncurl -k https://localhost:1112\n```\noutput:\n```json\n{ \"memory_used\": 0.81, \"disk_used\": 0.49, \"cpu_used\": 0.13 }\n```\n\n`cpu_used` is the 15 minutes [CPU average load](http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages).\n\n### Get systemd services statuses\n```sh\ncurl -k 'https://localhost:1112?services=couchdb|inventaire|nginx'\n```\noutput:\n```json\n{\n  \"memory_used\": 0.35,\n  \"disk_used\": 0.48,\n  \"cpu_used\": 0.04,\n  \"services\": {\n    \"couchdb\": \"active\",\n    \"inventaire\": \"inactive\",\n    \"nginx\": \"active\"\n  }\n}\n```\n\n### Get docker containers statuses\n```sh\ncurl -k 'https://localhost:1112?docker=elasticsearch|lyrasis/blazegraph|585c7be23ac3|7ea426b95a78'\n```\noutput:\n```json\n{\n  \"memory_used\": 0.35,\n  \"disk_used\": 0.48,\n  \"cpu_used\": 0.04,\n  \"docker\": {\n    \"elasticsearch\": \"active\",\n    \"lyrasis/blazegraph\": \"inactive\",\n    \"585c7be23ac3\": \"active\",\n    \"7ea426b95a78\": \"inactive\"\n  }\n}\n```\n\n## Use HTTP instead of HTTPS\nThe server uses self-signed certificates to run with HTTPS, thus the `-k` option passed to curl so that it ignores the TLS error it will get.\nYou can [do the same within Node](http://stackoverflow.com/a/21961005/3324977) using `process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'`, or by disabling it per request: for instance with the [request](https://www.npmjs.com/package/request) lib, it can be done by passing a flag:\n```js\nrequest({ method, url, rejectUnauthorized: false })\n```\n\nIf for some reason, you prefer using HTTP, override the config by setting a different protocol in `./config/local.js`\n```sh\necho \"module.exports = { protocol: 'http' }\" \u003e ./config/local.js\n```\n\n## Documentation\n### CPU\n* [Understand load average](http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages)\n* [Restricting process CPU usage using nice, cpulimit, and cgroups](http://blog.scoutapp.com/articles/2014/11/04/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups)\n\n## See also\n* [os-info-server](https://github.com/bahmutov/os-info-server)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlath%2Fos-health-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxlath%2Fos-health-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlath%2Fos-health-report/lists"}