Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#1367 closed enhancement (duplicate)

Split code into common interface library binary, and smartd + smartctl binaries

Reported by: Aadam Zocolo Owned by:
Priority: minor Milestone:
Component: all Version:
Keywords: library Cc:

Description

After a while of using smartmontools, I have a big desire to incorporate native bindings into some higher-level languages like JavaScript? (NodeJS) and Python.

This is very hard to do with smartmontools in its current state, because all of the code is compiled into two binaries, if I'm not mistaken. "smartctl" and "smartd".

I would love to see (and help) this project organize code and make files in such a way that developers are able to access the "device_interface" class in code. Particularly "smi()" so we can deal with native "smart_device" objects directly in code, instead of only being able to parse output of "smartctl". A library binary with a header file in the include path.

I've done some digging in the code, and believe this can be easily done, since "smi()" is a shared piece of code between both smartd and smartctl. I do not have lots of experience with C++ and make files for large projects, but I imagine this could be as simple as compiling a static library for the "device_interface" on that machine, and then including that static library in "smartd" and "smartctl" binaries. I would add that this code should also be wrapped in a namespace, should you proceed to create a library out of it.

I would assume that you do not have lots of time to implement this, so I would love to offer help in any way, but I will reiterate that I am not super experienced with large project makefiles, automake, or c++ compilers. I am totally willing to learn. I do however understand the language itself relatively well, and do not have a big problem understanding an overview of the code structure.

What are your thoughts?

I've set a milestone I think is feasible, but please change it to how you see fit. Thank you for your time.

Change History (2)

comment:1 Changed 3 weeks ago by Christian Franke

Cc: Christian Franke removed
Milestone: Release 8.0
Resolution: duplicate
Status: newclosed

See ticket #820.

comment:2 Changed 3 weeks ago by Christian Franke

Note that for many use cases, smartctl --json (#766) is sufficient.

Note: See TracTickets for help on using tickets.