{"id":13585384,"url":"https://github.com/DisorganizedWizardry/TrueNAS-smartctl","last_synced_at":"2025-04-07T09:34:41.482Z","repository":{"id":181109660,"uuid":"477419148","full_name":"DisorganizedWizardry/TrueNAS-smartctl","owner":"DisorganizedWizardry","description":"Send drive stats from TrueNAS to logstash","archived":false,"fork":false,"pushed_at":"2022-04-03T18:37:55.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-02T16:00:08.592Z","etag":null,"topics":["smartctl","truenas"],"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/DisorganizedWizardry.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":"2022-04-03T17:45:04.000Z","updated_at":"2022-11-19T04:30:41.000Z","dependencies_parsed_at":"2023-07-14T04:34:48.387Z","dependency_job_id":null,"html_url":"https://github.com/DisorganizedWizardry/TrueNAS-smartctl","commit_stats":null,"previous_names":["disorganizedwizardry/truenas-smartctl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DisorganizedWizardry%2FTrueNAS-smartctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DisorganizedWizardry%2FTrueNAS-smartctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DisorganizedWizardry%2FTrueNAS-smartctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DisorganizedWizardry%2FTrueNAS-smartctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DisorganizedWizardry","download_url":"https://codeload.github.com/DisorganizedWizardry/TrueNAS-smartctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223277846,"owners_count":17118655,"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":["smartctl","truenas"],"created_at":"2024-08-01T15:04:54.701Z","updated_at":"2024-11-06T03:31:02.801Z","avatar_url":"https://github.com/DisorganizedWizardry.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# TrueNAS-smartctl\n\n## Install the script on TrueNAS\n\nCopy `smart-truenas.py` to your TrueNAS server\n\n## Logstash config\n\nHere is the config for logstash. \n\n```\ninput {\n  tcp {\n    port =\u003e 4000\n    codec =\u003e \"json\"\n    ecs_compatibility =\u003e \"disabled\"\n  }\n}\n```\n\n## Run the script \n\nOnce you have logstash setup, run the script \n\n```\nUsage: python3 smart-truenas.py [ip_address] [port]\n```\n\n## Setup the crontab on TrueNAS\n\nCreate a cron job to export drive stats.\n\n![Cron job](cron_job.png)\n\n## Troubleshooting\n\nThe script relies on smartctl to output json, make sure the below commands work. \n\nThe command to scan for drives.\n```\nsmartctl -j --scan\n```\n\nThe command that is run for each drive.\n```\nsmartctl -j -a [drive]\n```\n\nIf you get the `Failed to send` errors, check the logstash config.\n\n```\nFailed to send : /dev/da0\nFailed to send : /dev/da1\nFailed to send : /dev/da2\nFailed to send : /dev/da3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDisorganizedWizardry%2FTrueNAS-smartctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDisorganizedWizardry%2FTrueNAS-smartctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDisorganizedWizardry%2FTrueNAS-smartctl/lists"}