Giter VIP home page Giter VIP logo

sysql's Introduction

Linux Kernel module for a SQL compatible interface to query system information

Still just an idea.

Why

  • It's often hard to write long process pipes with grep, sed, awk, sort and regex for filtering, sorting and formatting data.
  • It's often even more harder to read someone elses shell scripts containing some regexes from hell.
  • SQL is probably more common and even beginners should be able to read and understand simple queries.
  • It would just improve A LOT around scripting under Linux in the future.

What data?

Most system resources just fit perfectly in a RDBMS result set:

  • Processes
  • Block devices with size, aliases and filesystem
  • Supported filesystems
  • System users (/etc/passwd)
  • Network interfaces, type, mac address, link speed, ip addresses
  • Routes
  • Firewall rules
  • Kernel config
  • Kernel modules
  • diskstats
  • Memory stats
  • systemd-journald
  • systemd units and status
  • swaps
  • vmstat
  • mounts

Why SQL?

Simple, almost human readable. Backward compatible when new columns are introduced in the future. New resources can be added as new tables.
Joins are perfect to combine the process list to memory usage, owner, the runtime, etc.
ORDER BY, LIMIT... You get it.

Why a module?

Linux is basically good enough by supporting "Everything is a file". But these "files" often also need to be filtered, sorted, combined and formatted some how. Linux today is quite modern and simple. But it doesn't feel like that on any corner. Especially the need of grep, sed, awk and their friends for simple tasks. It's still basically simple to use these basic building blocks with pipes of course. But they're also an external dependecy to gather system information. And you need to know the path to them...

Not only scripts, but also C and other languages could just access the interface in the procfs or do a system call directly.
Feels odd if a C program would have to create a userspace program process to get some information.

Userspace helper

The communication protocol could match the standard TCP connection or socket stream MariaDB uses. That would allow SQL clients to connect too.
If there's not a program already to just dump a result set in native format in human readable format, this project could also offer one.

Why NOT a module

Security. Of course. A kernel module should not introduce critical issues. Don't want to read the project name in the news in a bad context!
Does it really need the kernel space or does it just waste system resources?
It would be ok for scripts to spawn a userspace process. Inheriting the UID and just running into permission errors is probably simpler.

Other related projects

This project is similar but Python based. I had the same idea for the project name. Isn't it obvious to use that name?

Kernel module but only restricted to processes. Does literally use sqlite3 to hold a copy of the processes in memory.

Multi platform, a lot of resources, but not a kernel module.

sysql's People

Contributors

sausix avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.