LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 08-01-2024, 06:32 PM   #1
DarcSceptor
LQ Newbie
 
Registered: Aug 2024
Posts: 2

Rep: Reputation: 0
Talking 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)
 
Old 08-01-2024, 08:34 PM   #2
frankbell
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
Blog Entries: 28

Rep: Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205
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.
Old 08-01-2024, 08:49 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: Rocky 9.4
Posts: 5,801

Rep: Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239Reputation: 2239
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/
Attached Thumbnails
Click image for larger version

Name:	IMG_0364.jpg
Views:	16
Size:	231.5 KB
ID:	43426  
 
1 members found this post helpful.
Old 08-01-2024, 09:37 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,127

Rep: Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076Reputation: 6076
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.
Old 08-01-2024, 10:14 PM   #5
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,255
Blog Entries: 21

Rep: Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499Reputation: 3499
Hardinfo?

https://itsfoss.com/hardinfo/
 
1 members found this post helpful.
Old 08-01-2024, 11:08 PM   #6
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,184

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
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.
 
Old 08-07-2024, 05:25 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,827
Blog Entries: 4

Rep: Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984
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.
Old 08-08-2024, 11:26 AM   #8
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 769
Blog Entries: 1

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
Quote:
Originally Posted by frankbell View Post
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.
Attached Thumbnails
Click image for larger version

Name:	jmccue.screen20240808-122716.png
Views:	8
Size:	2.3 KB
ID:	43469  

Last edited by jmccue; 08-08-2024 at 11:37 AM.
 
Old 08-09-2024, 04:24 PM   #9
DarcSceptor
LQ Newbie
 
Registered: Aug 2024
Posts: 2

Original Poster
Rep: Reputation: 0
Lightbulb

Just so people know...THIS is what I am looking for running under Linux.
Attached Thumbnails
Click image for larger version

Name:	moderno-collection-aida64-sensor-panel-v0-osvalrssykha1.gif
Views:	12
Size:	207.9 KB
ID:	43480  
 
Old 08-10-2024, 06:56 AM   #10
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,924
Blog Entries: 1

Rep: Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886Reputation: 1886
I'd try google, it gives links like this: https://alternativeto.net/software/a...platform=linux
 
Old 08-10-2024, 07:14 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,237

Rep: Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150
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.
Old 08-10-2024, 10:19 AM   #12
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 769
Blog Entries: 1

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
Quote:
Originally Posted by DarcSceptor View Post
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.
 
Old 08-12-2024, 02:26 PM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,827
Blog Entries: 4

Rep: Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984Reputation: 3984
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: free – A Standard Command to Check Memory Usage Statistics (Free & Used) in Linux LXer Syndicated Linux News 0 02-09-2017 12:31 AM
Get total cpu usage, total memory usage and available memory Chiba Linux - Software 1 11-15-2014 04:36 PM
How to detect whether Radeon HD 3870 GPU usage, temp, or any stats? chromei386 Linux - Hardware 2 11-14-2010 08:18 PM
lm_sensors cpu temp v.slightly different to MOBO temp on Intel D865GLC sc_3007 Linux - Hardware 5 11-13-2009 12:17 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration