{"id":16947624,"url":"https://github.com/x70b1/telegraf-apt","last_synced_at":"2026-02-27T09:12:09.184Z","repository":{"id":43257948,"uuid":"450299365","full_name":"x70b1/telegraf-apt","owner":"x70b1","description":"A Telegraf plugin to check Debian for package updates.","archived":false,"fork":false,"pushed_at":"2025-09-11T22:28:36.000Z","size":17,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-12T01:03:56.606Z","etag":null,"topics":["apt","debian","influxdb","monitoring","packages","telegraf"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x70b1.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-21T00:15:03.000Z","updated_at":"2025-09-11T22:28:40.000Z","dependencies_parsed_at":"2025-04-11T20:05:19.458Z","dependency_job_id":"d9c8aa2a-6622-44d0-8c72-c88702b922f2","html_url":"https://github.com/x70b1/telegraf-apt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/x70b1/telegraf-apt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x70b1%2Ftelegraf-apt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x70b1%2Ftelegraf-apt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x70b1%2Ftelegraf-apt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x70b1%2Ftelegraf-apt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x70b1","download_url":"https://codeload.github.com/x70b1/telegraf-apt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x70b1%2Ftelegraf-apt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29889070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T08:34:21.514Z","status":"ssl_error","status_checked_at":"2026-02-27T08:32:38.035Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["apt","debian","influxdb","monitoring","packages","telegraf"],"created_at":"2024-10-13T21:47:45.010Z","updated_at":"2026-02-27T09:12:09.170Z","avatar_url":"https://github.com/x70b1.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# telegraf-apt\n\n[![Actions](https://github.com/x70b1/telegraf-apt/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/x70b1/telegraf-apt/actions)\n[![Contributors](https://img.shields.io/github/contributors/x70b1/telegraf-apt.svg)](https://github.com/x70b1/telegraf-apt/graphs/contributors)\n[![License](https://img.shields.io/github/license/x70b1/telegraf-apt.svg)](https://github.com/x70b1/telegraf-apt/blob/master/LICENSE)\n\nA [Telegraf](https://github.com/influxdata/telegraf) plugin to check Debian, Ubuntu and other apt-based systems for package updates.\n\nThis plugin runs continuously and prints an output in the interval requested by Telegraf.\nIn addition, the output can be triggered externally, e.g. during `apt update` to get the latest status in almost real time.\nFor Debian, the Debian wiki is queried to check the [LTS status](https://wiki.debian.org/LTS).\nFor Ubuntu, the meta-release changelog is queried to check the [support status](https://changelogs.ubuntu.com/meta-release).\nYou can make use of [needrestart](https://github.com/liske/needrestart) to check the system for outdated libraries.\n\n\n## Configuration\n\nInstall `curl`. Also `needrestart` if you like to use it.\n\nTo make this plugin useful you need a way to keep your package sources up to date.\nYou can use `unattended-upgrades` to run `apt update` on a regular basis.\n\nTo trigger the plugin to collect new stats after an `apt update`, create a `Post-Invoke` configuration.\nYou can copy [99telegraf](99telegraf) to `/etc/apt/apt.conf.d/99telegraf` or use it as example.\n\nTelegraf can be configured like this:\n\n```ini\n[[inputs.execd]]\n  command = [\"/bin/sh\", \"/opt/telegraf/telegraf-apt.sh\"]\n  data_format = \"influx\"\n\n  interval = \"24h\"\n  signal = \"SIGUSR1\"\n```\n\nIf Telegraf is able to run `needrestart` with sudo privileges, the corresponding metrics will be collected:\n\n```\ntelegraf    ALL = NOPASSWD: /usr/sbin/needrestart -b\n```\n\n\n## Output\n\n```sh\n# sh /opt/telegraf/telegraf-apt.sh\napt os_id=\"Debian\"\napt os_release=\"11.2\"\napt os_codename=\"Bullseye\"\napt os_support=0\napt updates_regular=0\napt updates_security=1\napt updates_packages=\"\" ?\napt updates_severity=2\napt needrestart_services=6\napt needrestart_severity=1\n```\n\n\n## How to read\n\n**os_id**\n\nReturns the value of `ID` from `/etc/os-release`.\n\n\n**os_release**\n\nReturns the value of `VERSION_ID` from `/etc/os-release`.\n\n\n**os_codename**\n\nReturns the value of `VERSION_CODENAME` from `/etc/os-release`.\n\n\n**os_support**\n\nReturns the current support status of your system.\nSupported on Debian and Ubuntu.\n\nFor Debian:\n\n```\n0   =  full support with official security fixes\n1   =  LTS with limitied security support\n2   =  outdated\n```\n\nFor Ubuntu (This will not consider Ubuntu Pro support):\n\n```\n0   =  supported\n2   =  unsupported\n```\n\n\n**updates_regular**\n\nReturns the number of outstanding regular updates.\n\n\n**updates_security**\n\nReturns the number of outstanding security updates.\n\n\n**updates_packages**\n\nReturns a list of packages with outstanding updates.\n\n\n**updates_severity**\n\nReturns an integer indicator as summary for Debian and Ubuntu.\n\nFor Debian:\n\n```\n0   =  full Debian support, no updates\n\n1   =  full Debian support, one or more regular updates\n2   =  full Debian support, one or more security updates\n3   =  full Debian support, one or more regular updates and one or more security updates\n\n10  =  LTS, no updates\n11  =  LTS, one or more regular updates\n12  =  LTS, one or more security updates\n13  =  LTS, one or more regular updates and one or more security updates\n\n20  =  outdated, no updates\n21  =  outdated, one or more regular updates\n22  =  outdated, one or more security updates\n23  =  outdated, one or more regular updates and one or more security updates\n```\n\nFor Ubuntu:\n\n```\n0   =  full Ubuntu support, no updates\n\n1   =  full Ubuntu support, one or more regular updates\n2   =  full Ubuntu support, one or more security updates\n3   =  full Ubuntu support, one or more regular updates and one or more security updates\n\n20  =  unsupported, no updates\n21  =  unsupported, one or more regular updates\n22  =  unsupported, one or more security updates\n23  =  unsupported, one or more regular updates and one or more security updates\n```\n\n**needrestart_services**\n\nReturns the number of services which need to be restarted after library upgrades.\n\n\n**needrestart_severity**\n\nReturns an integer indicator as summary.\n\n```\n0   =  latest available kernel is running and no services with outdated libraries\n1   =  latest available kernel is running and one or more services with outdated libraries\n2   =  latest available kernel is not running and no services with outdated libraries\n3   =  latest available kernel is not running and one or more services with outdated libraries\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx70b1%2Ftelegraf-apt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx70b1%2Ftelegraf-apt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx70b1%2Ftelegraf-apt/lists"}