{"id":13585035,"url":"https://github.com/nodiscc/netdata-needrestart","last_synced_at":"2025-08-07T20:08:49.545Z","repository":{"id":86258590,"uuid":"191978249","full_name":"nodiscc/netdata-needrestart","owner":"nodiscc","description":"[mirror] Check for processes/services/kernels that need to be restarted - netdata plugin","archived":false,"fork":false,"pushed_at":"2023-07-22T13:57:41.000Z","size":24,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T05:41:30.473Z","etag":null,"topics":["monitoring","needrestart","netdata","unattended-upgrades","updates"],"latest_commit_sha":null,"homepage":"https://gitlab.com/nodiscc/netdata-needrestart/","language":"Python","has_issues":false,"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/nodiscc.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-06-14T16:55:50.000Z","updated_at":"2023-10-19T18:02:58.000Z","dependencies_parsed_at":"2024-02-07T03:12:27.241Z","dependency_job_id":null,"html_url":"https://github.com/nodiscc/netdata-needrestart","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-needrestart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-needrestart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-needrestart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodiscc%2Fnetdata-needrestart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodiscc","download_url":"https://codeload.github.com/nodiscc/netdata-needrestart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254297363,"owners_count":22047479,"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","needrestart","netdata","unattended-upgrades","updates"],"created_at":"2024-08-01T15:04:42.026Z","updated_at":"2025-05-15T07:34:11.653Z","avatar_url":"https://github.com/nodiscc.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# netdata-needrestart\n\nCheck/graph the number of processes/services/kernels that should be restarted after upgrading packages.\n\n![](https://gitlab.com/nodiscc/toolbox/-/raw/master/DOC/SCREENSHOTS/ebD2MTW.png)\n\nThis is a `python.d` plugin for [netdata](https://my-netdata.io/). It parses output from [needrestart](https://fiasko.io/tag/needrestart.html).\n\nWhen no restarts are required all charts will have a value of 0. Values higher than 0 indicate that a restart is required, or that there was an error opening/reading the log file. The chart is always visible when the plugin is installed. Any value higher than 0 will raise a warning in netdata alarms (and trigger a notification).\n\n\n## Installation\n\nThis plugin expects the last [batch](https://github.com/liske/needrestart/blob/master/README.batch.md) output of needrestart at `/var/log/needrestart.log`\n\n\n```bash\n# install needrestart\napt install needrestart\n\n# clone the repository\ngit clone https://gitlab.com/nodiscc/netdata-needrestart\n\n# generate the initial file\nneedrestart -b \u003e /var/log/needrestart.log\n\n# configure dpkg to refresh the file after each run\ncp netdata-needrestart/etc_apt_apt.conf.d_99needrestart /etc/apt/apt.conf.d/99needrestart\n\n# add a cron job to refresh the file every 30 minutes\ncp netdata-needrestart/etc_cron.d_needrestart /etc/cron.d/needrestart\n\n# install configuration files/alarms\nnetdata_install_prefix=\"/opt/netdata\" # if netdata is installed from binary/.run script\nnetdata_install_prefix=\"\" # if netdata is installed from OS packages\ncp netdata-needrestart/needrestart.chart.py $netdata_install_prefix/usr/libexec/netdata/python.d/\ncp netdata-needrestart/needrestart.conf $netdata_install_prefix/etc/netdata/python.d/\ncp netdata-needrestart/health.d_needrestart.conf $netdata_install_prefix/etc/netdata/health.d/needrestart.conf\n\n# restart netdata\nsystemctl restart netdata\n\n```\n\n\n## Configuration\n\nNo configuration is required. Common `python.d` plugin options can be changed in [`needrestart.conf`](needrestart.conf).\n\nThe default `update every` value is 120 seconds so the initial chart will only be created after 2 minutes. Change this value if you need more accuracy.\n\nYou can get details on which services need to be restarted by reading mail sent by needrestart, running `needrestart`, or reading the log file.\n\nYou can schedule an automatic restart at a convenient time, for example using `echo reboot | at 22:00`.\n\n\n## Debug\n\nTo debug this plugin:\n\n```bash\n$ sudo su -s /bin/bash netdata\n$ $netdata_install_prefix/usr/libexec/netdata/plugins.d/python.d.plugin 1  debug trace needrestart\n```\n\n## TODO\n\n- Graph one line for each service/kernel, by name\n\n## License\n\n[GNU GPLv3](LICENSE)\n\n## Mirrors\n\n- https://github.com/nodiscc/netdata-needrestart\n- https://gitlab.com/nodiscc/netdata-needrestart\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodiscc%2Fnetdata-needrestart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodiscc%2Fnetdata-needrestart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodiscc%2Fnetdata-needrestart/lists"}