The officially official Devuan Forum!

You are not logged in.

#1 2024-03-11 23:52:41

Altoid
Member
Registered: 2017-05-07
Posts: 1,427  

[SOLVED] Conky.conf problem

Hello:

After much procrastinating, I finally set about cleaning up my conky.conf file.
This year's has been a very hot summer and the fans in the box many times ran at high speeds.
I need to know what is going on inside temperature wise. 

The on-board w83627ehf chip is not activated and loading the module gives bogus/unreliable readings.
The only way I can get a reasonably approximate in-box temperature reading are from the pair of SCSI cards I have inside, their readings should be good enough to get an idea of internal temperatures.

So, to that effect, I need to run these lines in conky:

Case 0: +${exec sensors drivetemp-scsi-5-0 | grep 'temp1' | cut -c 30-39} C
Case 1: +${exec sensors drivetemp-scsi-3-0 | grep 'temp1' | cut -c 30-39} C}

The problem I have is that sensors can only be run as root so it is not working from conky.

~$ sensors drivetemp-scsi-5-0 | grep 'temp1' | cut -c 30-39
Error: File /etc/sensors.d/sun_u24.conf: Permission denied
sensors_init: General parse error
~$
~$ sudo sensors drivetemp-scsi-5-0 | grep 'temp1' | cut -c 30-39
[sudo] password for groucho: 
  +34.0 C 
~$ 

Everything else works properly.

Any pointers will be appreciated.

Best,

A.

Last edited by Altoid (2024-03-11 23:53:42)

Offline

#2 2024-03-12 10:29:10

alexkemp
Member
Registered: 2018-05-14
Posts: 292  

Re: [SOLVED] Conky.conf problem

It is possible to set sudo to execute certain commands (which would normally require a password) without a password. That will meet your use-case. See the following as extra help:

https://linuxhandbook.com/sudo-without-password/

Offline

#3 2024-03-12 10:51:50

Altoid
Member
Registered: 2017-05-07
Posts: 1,427  

Re: [SOLVED] Conky.conf problem

senHello:

alexkemp wrote:

... set sudo to execute certain commands ...

Indeed.

But I was wanting to avoid adding to my overpopulated sudoers.d directory and thought that maybe there was a way to get that done within conky for cases like this.

Guess that will have to do. 8^)
I'll test it and see how it goes.

Edit: that did it - works as advertised.

Thank you very much for your input.

Best,

A.

Last edited by Altoid (2024-03-12 13:10:42)

Offline

Board footer