{"id":22870951,"url":"https://github.com/percona-lab/procfs","last_synced_at":"2025-03-31T11:27:17.847Z","repository":{"id":68884150,"uuid":"158177510","full_name":"Percona-Lab/procfs","owner":"Percona-Lab","description":null,"archived":false,"fork":false,"pushed_at":"2020-05-26T14:46:50.000Z","size":10,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-02-06T16:59:09.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/Percona-Lab.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":"2018-11-19T07:11:48.000Z","updated_at":"2020-07-31T19:27:29.000Z","dependencies_parsed_at":"2023-03-15T07:46:35.561Z","dependency_job_id":null,"html_url":"https://github.com/Percona-Lab/procfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fprocfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fprocfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fprocfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fprocfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Percona-Lab","download_url":"https://codeload.github.com/Percona-Lab/procfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246460606,"owners_count":20781158,"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":[],"created_at":"2024-12-13T13:16:40.520Z","updated_at":"2025-03-31T11:27:17.838Z","avatar_url":"https://github.com/Percona-Lab.png","language":"C++","readme":"# procfs\nprocfs mysql `information_schema` plugin allows to get access to the row, unformatted contents of /proc and /sys files with SQL queries.\nIt could be useful for agent-less monitoring systems, for providing access to disk, networking and cpu statistics in cloud systems just with standard mysql protocol.\n```\nmysql\u003e SELECT contents FROM information_schema.procfs WHERE file LIKE '/proc/irq/9/spurious'\\G\n*************************** 1. row ***************************\ncontents: count 22009\nunhandled 1\nlast_unhandled 4294667480 ms\n\n1 row in set (0.01 sec)\n```\n\n## Installation\n1. put procfs directory inside plugin directory of mysql 5.7 or 8.0 source directory\n2. configure mysql with cmake and build\n3. If you have existing installation copy `procfs.so` to mysql `plugin_dir`\n4. create or copy example `procfs.cnf` file to mysql data directory\n5. In mysql-cli run install plugin sql command: `INSTALL PLUGIN procfs SONAME 'procfs.so';`\n\n## Configuration\nThe plugin reads datadir/procfs.cnf file and caches files satisfying to all patterns for next 60 seconds.\nprocfs.cnf should contain paths to /sys or /proc files, one file per line. In addition you can use shell glob(7) syntax to specify multiple files:\n```\n/proc/cpuinfo\n/sys/block/?d[a-z]/stat\n/proc/irq/*/*\n```\nIt's safe to specify path non-existent on this system or directories. The plugin silently skips invalid entries or matched directories.\n```\n/proc/net/sockstat*\n```\nglob expansion happens only during mysqld startup or plugin installation, you will not see the file appeared after mysqld was started without mysqld service restart.\n\n## Usage\nYou can read one or multiple /sys or /proc files with single sql statement:\n```\nSELECT * FROM information_schema.procfs;\nSELECT * FROM information_schema.procfs WHERE file = '/proc/irq/9/spurious';\nSELECT * FROM information_schema.procfs WHERE file IN('/proc/irq/9/spurious', '/proc/irq/8/spurious');\nSELECT contents FROM information_schema.procfs WHERE file LIKE '/proc/irq/_/spurious';\nSELECT contents FROM information_schema.procfs WHERE file LIKE '/proc/irq/%/spurious';\n```\n\nAll statements above will cause file reads only for matched files.\nFor more complex conditions the plugin will read all files and as a second step rows will be filtered by mysql runtime.\nE.g.\n```\nSELECT * FROM information_schema.procfs WHERE file='/proc/irq/9/spurious' OR file='/proc/irq/8/spurious';\n```\nReturns same rows as a corresponding IN statement, but reads all configured /proc and /sys files.\n\n## Limitations\n1. Only first 60k of /proc/ /sys/ files returned\n2. file name size is limited to 1k\n3. the plugin can't read files if path is not starting from /proc or /sys\n4. Complex WHERE conditions force plugin to read all configured files.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fprocfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercona-lab%2Fprocfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fprocfs/lists"}