Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-01-2024, 06:32 PM
|
#1
|
LQ Newbie
Registered: Aug 2024
Posts: 2
Rep:
|
Accessing hardware data (CPU usage/temp, GPU usage, temp, memory free/used, etc)
I have been searching for software that provides a sensor panel much like what is provided by Aida64 on Windows. Since I got no luck, just text based dumps of statuses, I decided to write my own.
So first question: is there a DLL in the OS that exposes the sensors at the hardware level? NOTE I'm talking code NOT some script to scrape.
(I'm a retired C# developer and this is the first program I will be writing on Linux)
|
|
|
08-01-2024, 08:34 PM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,545
|
My personal favorite for this GKrellM. It should be in your repos.
There's also conky.
There may be others that I'm not aware of.
|
|
1 members found this post helpful.
|
08-01-2024, 08:49 PM
|
#3
|
LQ Veteran
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.4
Posts: 5,801
|
I’d check perl or python code bases…is there such for c ? I don’t know.
I get most of what you seek using webmin https://webmin.com/
|
|
1 members found this post helpful.
|
08-01-2024, 09:37 PM
|
#4
|
Moderator
Registered: Aug 2002
Posts: 26,127
|
For voltage and temperature there is lm-sensors api.
https://wiki.archlinux.org/title/Lm_sensors
Memory usage is from /proc/meminfo
Last edited by michaelk; 08-01-2024 at 10:07 PM.
|
|
1 members found this post helpful.
|
08-01-2024, 10:14 PM
|
#5
|
LQ Veteran
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,255
|
|
|
1 members found this post helpful.
|
08-01-2024, 11:08 PM
|
#6
|
Senior Member
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,184
|
Process the files in proc and sys from C directly rather than a script. This is how I do return the current installed version of a mod for Battle.net games to my terminal.
|
|
|
08-07-2024, 05:25 PM
|
#7
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,827
|
Background: Just to be sure that everyone knows what @jmgibson1981 is referring to:
"Directories" such as /dev, /proc, /sys are actually kernel APIs. These directories and their contents don't physically exist. The kernel instantly generates what you see when you list the "files and directories" that are in them, and when you read those "files." Some of the "files" are also writable. (When you, as a properly privileged(?) user, "write to those that support writing," something happens.)
It's the most elegant kernel-API strategy that I have ever seen used anywhere – and I've worked with a lot of operating systems over these many years.
Last edited by sundialsvcs; 08-07-2024 at 05:29 PM.
|
|
1 members found this post helpful.
|
08-08-2024, 11:26 AM
|
#8
|
Member
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 769
|
Quote:
Originally Posted by frankbell
There may be others that I'm not aware of.
|
Another option one can do is what is described here My LQ blog. All this does is allow you to see System Stats via xconsole(1)
Setup is a bit more complex, but works on Linux and *BSD. Also what is described can show just about anything you may want. The attached print shows what it looks like for me.
Last edited by jmccue; 08-08-2024 at 11:37 AM.
|
|
|
08-09-2024, 04:24 PM
|
#9
|
LQ Newbie
Registered: Aug 2024
Posts: 2
Original Poster
Rep:
|
Just so people know...THIS is what I am looking for running under Linux.
|
|
|
08-10-2024, 06:56 AM
|
#10
|
Senior Member
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,924
|
|
|
|
08-10-2024, 07:14 AM
|
#11
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,237
|
Hmmmph. The OP needs to stop talking about their coding prowess, and get on with it. The data are there, go write the display you prefer.
|
|
1 members found this post helpful.
|
08-10-2024, 10:19 AM
|
#12
|
Member
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 769
|
Quote:
Originally Posted by DarcSceptor
Just so people know...THIS is what I am looking for running under Linux.
|
This should be possible with conky. if you do a search on conky configs you may find one that is close.
|
|
|
08-12-2024, 02:26 PM
|
#13
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,827
|
In the Linux world, the necessary "hardware interfaces" should be exposed as "files and directories," probably in /sys. The necessary support will be provided as a "kernel module" which must be loaded.
The remaining user-level software can then process this raw information into a more usable and friendly form. This might be in the form of an ".so" library (the Linux equivalent of a "DLL").
But: you are e-n-t-i-r-e-l-y dependent on the hardware vendor for this sort of thing ...
Last edited by sundialsvcs; 08-12-2024 at 02:28 PM.
|
|
|
All times are GMT -5. The time now is 04:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|