Page 1 of 2

psensors

Posted: 11 Dec 2024, 01:08
by dreadbird
Image

A GTK application for monitoring hardware sensors, including temperatures and fan speeds. Monitors motherboard and CPU (using lm-sensors), Nvidia GPUs (using XNVCtrl), and harddisks (using hddtemp or libatasmart).


hi I made a module for psensor (from slackware current) to use with lm-sensor and it works with slackware 15.

so if you use lm sensors this will allow you to see graphics and get alerts on the desktop about your temperatures.


The module I made includes everything so you can run psensor with an alarm.


psensor porteus version
psensor 1.2.1 slackware current (built with 15.0 libraries everything included)
my module https://drive.google.com/file/d/1ieFqhl ... sp=sharing Info: psensor with nvidia and built in alarm
https://drive.google.com/file/d/19nLUuF ... sp=sharing <---- dependencies

inside psensor in preferences set on alarm script in program to: /usr/local/bin/alarm.ph

if you want to build it yourself

psensor source code https://launchpad.net/ubuntu/+archive/p ... rig.tar.gz
libappindicator-12.10.0-x86_64-3.xzm
libdbusmenu-16.04.0-x86_64-3.xzm
libgtop-2.40.0-x86_64-5.xzm
libindicator-12.10.1-x86_64-3.xzm
lxnvctrl.xzm https://drive.google.com/file/d/14Q4Ztq ... drive_link <--- i made this
NVCtrl.xzm https://drive.google.com/file/d/1COhSoD ... drive_link <--- i made this
alarm https://drive.google.com/file/d/1Fg7r7j ... drive_link
alarm script https://drive.google.com/file/d/16wguEf ... sp=sharing
use official packages 15 or 3rd party if official unavailable 15 preferrable if not than current 3rd party

https://github.com/chinf/psensor
instructions for source dependencies


alarm sound name it: a.wav
put it in: usr/local/share
alarm script name it: alarm.ph
put it in: usr/local/bin

combine all that and make a module or just install them and put your alarm files in the respective directories.

All psensor addons I made
viewtopic.php?p=101291#p101291

Optional compile your nvidia driver

This is only necessary if you want to see your gpu usuage in psensor.

To compile your own nvidia drivers you need to download key files specific to your kernal. visit the Porteus Kernel Builder thread: Porteus Kernel Builder search for your specific kernel

download 05 devel and cripple sources for that kernel.

Or if you use v5.01

you just need 05devel and crippled sources from the v5.01 mirror download at porteus.org. or the above link for your specific kernel. I use v5.01 so i dont need to use the kernal builder thread.
i go here Porteus-v5.01 is released!
download the devel and crippled sources then follow steps below

then download from nvidia the geforce linux 64 driver
and follow the instructions viewtopic.php?t=8148

make sure to say no to 32bit install I did that with the 64 driver and it didnt work.
so I assume you need the 32 bit driver when doing that.





Alarm sample: https://drive.google.com/file/d/1Fg7r7j ... sp=sharing :good:
I have included an alarm so if you go to :

preferences - sensors - Script executed on alarm - /usr/local/bin/alarm.ph <---- put this value here script already in module


as there is no slackware 15 module or package for this it should work for all porteus versions (works on v5.01 for me)

Image

Image



to setup lm sensor you can do it two ways use the following commands

**you need 05devel module for python for the sensors-detect --auto option

1. Manually use the following commands
sudo su
sensors-detect -- auto
press y at the end (pay attention to HWMON_MODULES="nct6775") it saves a config files here (see below)

Note: step 1 may or may not find your dimms but dont panic we will get to finding them. continue to next step.

2. Automatically


after editing the file use commands:
sudo su
modprobe jc42

you can add the above commands to a script on startup once you have the settings right mine is nct6775 but yours may be different.


sensors-detect --auto requires
05-devel.xzm

if modprob jc42 doesnt load the values run this script:

sudo su
modprobe jc42
sensors-detect -- auto

Porteus doesnt use grub so you can ignore this part:
IF you use a grub bootloader you have to go to the grub.cfg and put in
/etc/default/grub

GRUB_CMDLINE_LINUX='acpi_enforce_resources=lax'

update-grub
then reboot



If for any reason you cant find your dimm temps follow these links below and trouble shoot and try to narrow it down:
https://www.reddit.com/r/linux/comments ... ?rdt=46943
https://wiki.archlinux.org/title/Lm_sensors


now for commands:

sudo su
modprobe nct6775

Now combine this so its setup at boot
This file is run at boot

/etc/rc.d/rc.local

put this in: modprobe jc42 <----------- so on boot it shows your dimms
modprobe nct6775 <------- load fan speed voltages ect
sensors -s <------- update lm sensors on startup


Edit lm sensor display

sensors -u to list all sensors and the values you can set (Note the bottom 3 alarms are usually boolean values so you cant edit those). identify your dimm modules we will then edit the labels and set high and crit alarms in sensors command.

Go to config file: Note: subtitute your values for your jc42 values from sensors -u
/ect/sensors.d/anyfilename.txt

chip "jc42-i2c-0-1a"

bus "i2c-0" "SMBus PIIX4 adapter port 0 at 0b00"

label temp1 "Dimm1"

set temp1_max 36
#set temp1_min 20
set temp1_crit 37


chip "jc42-i2c-0-18"

bus "i2c-0" "SMBus PIIX4 adapter port 0 at 0b00"

label temp1 "Dimm2"

set temp1_max 36
#set temp1_min 20
set temp1_crit 37


chip "jc42-i2c-0-1b"

bus "i2c-0" "SMBus PIIX4 adapter port 0 at 0b00"

label temp1 "Dimm3"

set temp1_max 36
#set temp1_min 20
set temp1_crit 37


chip "jc42-i2c-0-19"

bus "i2c-0" "SMBus PIIX4 adapter port 0 at 0b00"

label temp1 "Dimm4"

set temp1_max 36
#set temp1_min 20
set temp1_crit 37


finished editing file
IMPORTANT save this file incase it gets overwritten you dont want to have to do this again. put it somewhere safe.

sudo su
sensors -s <---- to set the changes after you edited it. (must be in su)



/home/guest/.psensor/psensor.cfg

edit this to change your colors ect youll have to add the labels in manually. You dont need to do this but you can if you want.



you can watch the temps in real time with command: watch sensors (will show alarms of crit and high that you set)
now launch psensor

the graph is hidden you have to drag the window to the right and you will see the graph. go to preferences - sensors - execute scrip on alarms
put value: /usr/local/bin/alarm.ph here.


now you have a visual alarm in not only sensors but also psensor with both a visual menu popup and alarm sound. linux just released drivers for temperatures on ddr5 in the kernel so this will be useful for overclocking ddr5 as well. this is by far a better environment to test your ram and system than windows for obvious reasons. if you corrupt porteus no big deal just reboot and it will be fixed. if not just replace the core files.

I will further put some more information about changing the color of lm_sensors text display in here (have to make a script) as well the further i tweak this. I will update the module with this script when complete. I hope this is useful to someone that is looking for an environment to test your pc.
I use gsat stressapptest and ycruncher with vt3 and fft to do a test on my memory overclocks before testing for 24 hours to ensure stability and finalize the overclock. ycruncher and gsat are good for testing ccio and sa voltages for intel for a quick and easy test.

I should also mention there is far more things you can do with psensor. There are pages where theres information how to run a script on alarm to shutdown your pc, send an email to you or even send a sms text message. so check back here and ill see what scripts I can pull off and post them.

github source
https://github.com/chinf/psensor

psensors

Posted: 12 Dec 2024, 13:43
by dreadbird
Debugging note this is left here for debugging purposes

I figured out how to put your nvidia temps graphics usage% memory % fans in psensor.

Dependencies to compile: (get these modules)

libgtop-2.40.0-x86_64-5 official slackware 15
NVCtrl https://drive.google.com/file/d/1COhSoD ... rive_link (I made these modules)
lxnvctrl https://drive.google.com/file/d/14Q4Ztq ... drive_link
Other dependencies fullfilled with psensor module


so I tried to compile my own psensor and there is deprecated code in the source. so while I couldnt build a functional psensor. I did manage to cross just the right files around and I got it to work.

Step1.

Download 1.2.1 source https://launchpad.net/ubuntu/+archive/p ... rig.tar.gz

./configure

Now we have the dependencies for what were are doing. we have to build part of psensor that has the nvidia settings.
But the code wont work as it is we have to edit out the one error.

/src/lib/pudisks2.c
Line81 if (!ret)
log_fct("%s: SMART update failed for %s",
PROVIDER_NAME,
data->path); return; <------ add this

now it will compile but there is also a bunch of deprecated code and it is buggy and app indicator doesnt work. but we can get around this.

make clean all
make install

You have just installed psesnor with nvidia capability.
Now we have to reload our psensor module that you made earlier to restore most of the functionality.

The final step download psensor-1.2.1-4-x86_64.pkg.tar.zst from arch and pull the psensor binary out
replace /usr/bin and /usr/local/bin with the arch binary.

This will restore everything and finalize the install. Remember the psensor binary you compiled is buggy you dont want that but you want all nvidia part that installed. I think this because whoever compiled the arch package knew how to resolve code deprecation in the gtk libraries. thus this will restore your notification popup and proper implementation of the gui (gtk3+).

now deactivate your psensor module so it doesnt overwrite any of your changes. and save your changes as the install is complete. I will try my best to put all this in a finalize module and post it here when im done so the install will be more painless.

Tested and that is the case you have to compile psensor with the nvidia settings like above is the only way to get it to work (NVCtrl, lxnvctrl ) .

if you follow the steps for making your own psensor and then how to add nvidia support you will have your own finalized psensor.


The reason I didnt include glibc in Pensor is to go by the principle to keep track of what you have installed and thus opitimize your filesystem to be as small as possible. Lets say 7 programs need glibc and each of those 7 have it included. you can see where there is a lot of wasted space. kind of like windows being a wasted space. For instance glibc is 14mb. now times that by 10 or 50 programs with it already installed. you can see the idea here. but ultimately a final package or application should include all libraries ect. So I hope I can save someone some time just load one of my modules and glibc 2.40 and you have psensor with a built in alarm. no need to do anything else.

The modules I made (Psensor and Psensor nvidia) do include all but glibc in them. This is ultimately was the best way to do this as lets face it we dont want to install a crap ton of modules just to run one module. so you download psensor and you can run it instantly from my modules.

Finally make sure you install your nvidia driver with their x-settings (from nvidia driver) and then psensor nvidia should pick it up (some files probably cross reference between the nvidia setting module I compiled and the official nvidia driver).

To compile your own nvidia drivers visit the Porteus Kernel Builder thread: Porteus Kernel Builder search for your specific kernel
download 05 devel and cripple sources for that kernel.

you just need 05devel and crippled sources from the v5.01 mirror download at porteus.org. or the above link for your specific kernel. I use v5.01 so i dont need to use the kernal builder thread.
i go here Porteus-v5.01 is released!
download the devel and crippled sources then follow steps below

then download from nvidia the geforce linux 64 driver
and follow the instructions viewtopic.php?t=8148


Image

psensors

Posted: 12 Dec 2024, 15:51
by Vic
Hi dreadbird

Looks cool. Will wait for your xzm to try it out.

Vic

psensors

Posted: 13 Dec 2024, 07:11
by dreadbird
Debugging note this is left here for debugging purposes

if you get something like libcurl blah blah in readout its because I didnt include that feature. its some sort of remote transfer commandline service so you can remotely monitor your psensor from another computer.

I want to go in and recompile a new psensor with server capability but its a huge amount of code that I have no idea what im doing.
But I want to include at least one way to monitor the data remotely so I will probably use curl instead of http server feature with the library libmicrohttpd.

So I will post here when I have two things. Custom scripts to change lm sensor colors for alarms (red) and dimms (make them green) in the commandline. and lastly curl implementation.
Also ill make different scripts for scenarios and finally a script to remotely get alerts to your email address. As thats the easiest way you then set notify on your phone when you get an email.

psensors

Posted: 15 Dec 2024, 21:57
by dreadbird
Psensor porteus version (links above updated)
I compiled the binary and used these modules below

libappindicator-12.10.0-x86_64-3.xzm
libdbusmenu-16.04.0-x86_64-3.xzm
libgtop-2.40.0-x86_64-5.xzm
libindicator-12.10.1-x86_64-3.xzm
lxnvctrl.xzm <---- I made this
NVCtrl.xzm <---- I made this

https://drive.google.com/file/d/1ieFqhl ... sp=sharing <----- psensor with nvidia support (built in alarm)

https://drive.google.com/file/d/19nLUuF ... drive_link <----- all the dependant modules in a zip

go to preferences - alarm on script - usr/local/bin/alarm.ph (built in)



put these in /modules/psensor


So I decided on nothing less than perfection and recompiled the psensor to have the toolbar monitoring as well. I tested all this is always fresh mode and nvidia pulls at runtime. it was hard to diagnose but I finally figured it out. So if you want a system monitoring app with nvidia support grab both the modules and the psensornvidia.xym and put in the same folder in modules.

I believe I managed to compile it with libcurl. I’ll check the manpages and get on setting up remote access so you can monitor temps of a server say. There is also a psensor server binary in there so maybe that works?

But I dont think it will work because I didnt compile it with the server portion. You could try psesnsor from arch package and pull the binaries. There is deprecated code in the source so I dont think ill be able to compile the http server portion. Nor would want to invest the time changing the code to the new standards. The guys at arch most likely did but they didnt do the nvidia part so who knows. But libcurl working is promising as I did compile it with that.

Then I’ll try to get the http server going as well. I did get my computer science in information systems so I can code. did c, c++, java and a little bit of jsp and php. primarily in databases. Got out of coding as it took way too much of my time. But I do think the http server will be my next project.

psensors

Posted: 16 Dec 2024, 21:10
by dreadbird
Server module
I put the binary from alt linux into a server module for adding onto the psensornvidia

https://drive.google.com/file/d/1kDg7AM ... sp=sharing <----- psensor server module
or just pull the psensor-server server binary from alt linux pkgs.org

libmicrohttpd-0.9.71-x86_64-1alien.xzm <---- server dependency
https://slackware.pkgs.org/15.0/alienbo ... n.txz.html

run webserver:
sudo psensor-server --port=8080 --wdir=/usr/local/share/psensor/www/

or
sudo psensor-server -p 8080 w /usr/local/share/psensor/www/

Image

192.168.1.68:443/index.html

isp doesnt let me host a webserver lol
works on local network though

My isp either has double nat (dynamic ip blocking) or my router is hardcoded to block ports so I cant host it unless I turn it into bridge mode (lose all wireless connectivity) and send traffic to a second second router. But the webserver works. :thumbsup:




now ill make a script you can even make a script to detect if someone is using your machine say the ram temp goes to 32.

exec shutdown now

Psensor server script module

I made a couple scripts on to turn your webserver on from command line. command: psensorserveron psensorserveroff
and also a shortcut script to open lm sensors and show sensors in realtime. I made a script to turn the colors Magenta for medium threshold (warning) and Red for high threshold set in colorize.awk. default are 30 and 35 for medium high threshold. if lm sensors alarms it will say ALARM in red.

https://drive.google.com/file/d/1xoEC0v ... sp=sharing <---- psensor scripts module
included:
/usr/local/bin/psensorserveron
/usr/local/bin/psensorserveroff

/usr/local/share/sensorswatch.ph

/usr/local/bin/colorize.awk

once you activate the module

sudo su (you have to be su to access your web server filesystem. wont run in regular user)

type psensorserveron (you can edit this to change ports) makes it easier to start your server. default port 443)
your server is now online

exit

your server will be online even if you close the konsole

to turn it off:

psensorserveroff
turns your server off



lm sensors watch

For watching your sensors in realtime with lm sensors make a terminal shortcut on your desktop

edit properties and go to command: konsole -e /usr/local/share/sensorswatch.ph

this will open a watch sensors terminal so you can watch your sensors in realtime

sensorwatch.ph contents
watch -c 'sensors | grep -v "AUX\|in0\|in1\|in2\|in3\|in4\|in5\|in6\|in7\|in8\|in9\|in11\|in13\|fan2\|fan3\|fan4\|fan5\|fan6\|Agent0"|colorize.awk'

This script will show primarily your dimm modules and fan speeds. and blink on any changes. It will also alarm and show an alarm indication if it exceeds the crit and high values of your settings in lm sensors.


or you can do it manually to see the sensors you want.

sensors | grep -v "textofwhatyoudontwant" | grep -v "textofwhatyoudontwant" | ....

Image

how to colorize your sensors
https://unix.stackexchange.com/question ... om-sensors

Also
watch -d sensors

to parse things out you want want to see
watch -d 'sensors | grep -v "aux\|PCH\|Agent0\|in10\|in0" ' #substitute strings or words



to show changes useful for seeing what sensors are working

psensors

Posted: 17 Dec 2024, 14:13
by dreadbird
Running the webserver

Image

You can see my cpu die temp and both cpu fans on the tower cooler
the fans are linked to die temperature so they are in the same range

Image

Fan2 and fan3 are my cpu fans on the cooler

psensors

Posted: 17 Dec 2024, 14:16
by dreadbird
all download links

Psensor porteus
https://drive.google.com/file/d/1ieFqhl ... sp=sharing <---- Psensor nvidia
https://drive.google.com/file/d/19nLUuF ... sp=sharing <---- dependencies

Has a built in alarm (usr/local/bin/alarm.ph)

If building yourself
psensor source code https://launchpad.net/ubuntu/+archive/p ... rig.tar.gz
libappindicator-12.10.0-x86_64-3.xzm
libdbusmenu-16.04.0-x86_64-3.xzm
libgtop-2.40.0-x86_64-5.xzm
libindicator-12.10.1-x86_64-3.xzm
lxnvctrl.xzm https://drive.google.com/file/d/14Q4Ztq ... drive_link <--- i made this
NVCtrl.xzm https://drive.google.com/file/d/1COhSoD ... drive_link <--- i made this
alarm https://drive.google.com/file/d/1Fg7r7j ... drive_link
alarm script https://drive.google.com/file/d/16wguEf ... sp=sharing
use official packages 15 or 3rd party if official unavailable 15 preferrable if not than current 3rd party

https://github.com/chinf/psensor
instructions for source building for dependencies

to go preferences - alarm on script and set : usr/local/bin/alarm.ph to have an alarm (built in)

Psensor server module
https://drive.google.com/file/d/1kDg7AM ... drive_link <---- server module
dependencies
libmicrohttpd-0.9.71-x86_64-1alien.xzm
https://slackware.pkgs.org/15.0/alienbo ... n.txz.html Slackware 15

Psensor server scripts module
https://drive.google.com/file/d/1xoEC0v ... sp=sharing

contents of script module

/usr/bin/colorize.awk
/usr/local/bin/psensorserveron
/usr/local/bin/psensorserveroff
/usr/local/share/sensorswatch.ph

This modules gives key commands for the psensor server. as well as it has a script to show lm sensor in watch mode. you can tweak colorize.awk and sensorswatch.ph to your liking. It is setup to work as is but you may have different thresholds. default are 30 for medium and 35 for high. If at any point you get an alarm set by your lm sensors settings it will come in as Red.

psensorserveron command turn on your server ( default port 443 )
psensorserveroff command turn off your server

must be in su to use commands (HTTP server requires su)



Watch lm sensors with color changing and Red ALARM (if it turns on)

use this in a terminal shortcut to watch sensors with colors

shortcut command: konsole -e /usr/local/share/sensorswatch.ph

you can comment out the bottom line and uncomment the top two lines in sensorswatch.ph if you dont want to use colorize.awk and prefer the default look.

Note: edit sensorswatch.ph and colorize.awk to your liking (default high 35 and med 30)
edit: /ect/sensors.d/anyfilename.txt (your lm sensor settings)
if you make changes in anyfilename.txt su sensors -s to save changes

Email alert
mutt 2.1.5
no dependencies

mutt -s 'H&K temperature alert' [email protected] < TemperatureMessage

Image
Download mutt https://slackware.pkgs.org/15.0/slackwa ... 1.txz.html <--- slackware 15.0 mutt 2.1.5
https://drive.google.com/file/d/1-ZyLq_ ... sp=sharing <--- muttsetup module I made
this module will create the below directories with a default config file in ./muttrc/muttrc just add your username pass for smtp

See below posts for setup.

Shutdown module
https://drive.google.com/file/d/1r1LCir ... sp=sharing <--- shutdown script

contents of module
/usr/bin/systemtempshutdown
/usr/local/share/TemperatureMessage

See below posts for setup
shutdown requires a change in sudoers to use as normal user see below posts.

Optional
Download mutt https://slackware.pkgs.org/15.0/slackwa ... 1.txz.html <--- slackware 15.0 mutt 2.1.5
dependencies
none
https://drive.google.com/file/d/1-ZyLq_ ... sp=sharing <--- muttsetup module I made
this module will create the below directories with a default config file in ./muttrc/muttrc just add your username pass for smtp
smtp provider
https://try.mailgun.com/api-1/? ... QAvD_BwE
100 perday
https://www.brevo.com/free-smtp-server/ 300 per day

works as is without mutt but you can use mutt to send an email. I commented out mutt in systemtempshutdown for now.

to cancel the shutdown
killall bash

See below posts for setup



Recommended install configuration
put the modules in /porteus/modules/psensor/

then if another module has a module in common with psensor you can move some modules down to /porteus/modules/



As a closing remark I hope this helps you setup your temperature display and you can configure everything to your liking.



Alternatives to psensor

Regular

xsensors
Netdata
CoolerControl


For specific Desktop environments:

Freon GNOME Shell extension
GNOME Sensors Applet — Applet for the GNOME Panel
lm-sensors (LXPanel plugin) — Monitor temperature/voltages/fan speeds in LXDE through lm-sensors.
MATE Sensors Applet
Sensors Xfce4 panel plugin Xfce panel.
Thermal Monitor (Plasma applet)

source (https://wiki.archlinux.org/title/Lm_sensors)

psensors

Posted: 17 Dec 2024, 15:19
by dreadbird
Debugging purposes

There is a small glitch where it wont update the alarm popup but the most important thing is it will alarm and show a popup if there is a temperature alarm. it will also clear if the conditions are normal.

something GTK3 but it doesnt matter


ill investigate it when I have some free time. If I can fix that then it can be considered 100%. but it works as it is. and is functional.

psensors

Posted: 18 Dec 2024, 09:42
by Vic
Hey dreadbird

Thanks for your efforts. Cool gadget.

I like a totally black color theme. Is it possible to invert the graph colors? The setting for background color is not editable for me or I missed something, as usual.

Vic

psensors

Posted: 18 Dec 2024, 17:50
by dreadbird
hmm yeah ill have a look i think its the psensor config file. ill see if I can set it up

psensors

Posted: 18 Dec 2024, 19:26
by dreadbird
Vic wrote:
18 Dec 2024, 09:42
Hey dreadbird

Thanks for your efforts. Cool gadget.

I like a totally black color theme. Is it possible to invert the graph colors? The setting for background color is not editable for me or I missed something, as usual.

Vic
edit the colors in psensor it will generate a file in
~/
which goes to
/home/guest/.psensor/

.psensor is a hidden directory ctrl-h to show hidden directories

/home/guest/.psensor/psensor.cfg

psensors

Posted: 18 Dec 2024, 19:57
by Vic
I saw the conf file but nothing about graph background.

Also other settings are not changeable. Did multiple downloads to see if first one was bad.

Still cool.

Vic

psensors

Posted: 18 Dec 2024, 19:57
by dreadbird
Wow so ya whoever made psensor built in hysteresis so if an alarm comes in and out youre not going to get 300 alarm popups.

So the popup works. lets say an alarm comes in you get an audible alarm and a popup. if that alarm clears and then comes back on again you will get an audible alarm. No popup. If that alarm clears for some time say a minute. and that alarm comes back on you will get both an audible alarm and popup again.

So the program works as intended with everything fully functional including the webserver.

There is one small code deprecation in gliptop but that doesnt effect anything

psensors

Posted: 18 Dec 2024, 20:17
by dreadbird
Vic wrote:
18 Dec 2024, 19:57
I saw the conf file but nothing about graph background.

Also other settings are not changeable. Did multiple downloads to see if first one was bad.

Still cool.

Vic
psensor saves the graph settings internally or at least not anywhere i know where it saves. it does let you change the graph background ect from preferences. I also removed glibc 2.40 as a dependcy as I think that was causing or could cause something like that.

I updated all the files and links with my final version. boot into always fresh mode and activate all the modules in /modules/psensor then try to adjust your background color. should work.