glances icon indicating copy to clipboard operation
glances copied to clipboard

Hide function in sensors section

Open dtalens opened this issue 5 years ago • 22 comments

New feature: Add hide function of some sensors. In the same way that can be done with the hard drive partitions. For example, in glances.conf in Sensors section: hide=name_sensor01,name_sensor02...

  • Glances v3.1.3 with psutil v5.6.7
  • LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch Distributor ID: Ubuntu Description: Ubuntu 18.04.3 LTS Release: 18.04 Codename: bionic

dtalens avatar Jan 29 '20 21:01 dtalens

3.1.4.1 still can't hide unneeded sensors.

kanyck avatar May 22 '20 17:05 kanyck

I support this request! I already renamed a couple of sensors with the *_alias function:

[sensors]
Tctl_alias=CPU Temp2 
Tdie_alias=CPU Temp1
nct6797 2_alias=Fan CPU
nct6797 3_alias=Fan hinten
nct6797 4_alias=Fan unten
nct6797 5_alias=Fan oben
nct6797 7_alias=Fan sys

But I am seeing to many sensors which are not useful to me and are just confusing:

Composite             39C   
Sensor 1              39C   
Sensor 2              40C  
Composite             42C  
Sensor 1              42C   
Sensor 2              41C   
CPU Temp2             54C   
CPU Temp1             54C
Tccd1                 41C   
SYSTIN                39C   
PCH_MCH_TEM            0C   
CPUTIN                36C
AUXTIN0               42C   
AUXTIN1             -128C   
AUXTIN2               61C   
AUXTIN3               -2C
PCH_CHIP_CP            0C   
PCH_CHIP_TE            0C
PCH_CPU_TEM            0C   
nct6797 1              0R   
Fan CPU              608R 
Fan hinten           598R   
Fan unten            213R   
Fan oben             193R   
nct6797 6              0R   
Fan sys              802R

mabod avatar Jun 27 '20 07:06 mabod

@mabod have you tried using an aliases? Just wondering if you have been able to alias AUXTIN0 - 3. I cant seem to get an alias to apply to them.

Also, if you use the web gui, the ones that are 0 are hidden. glances -w -p

distributorofpain avatar Sep 07 '20 02:09 distributorofpain

@distributorofpain: What do you mean? I do not want to alias AUXTIN0 - 3. I want to hide them and the others.

mabod avatar Sep 07 '20 06:09 mabod

hiding is fine too, just wanted to know if you had tried to alias it since i cant seem to alias it.

distributorofpain avatar Sep 07 '20 15:09 distributorofpain

Aliases work fine for me:

AUXTIN0_alias=aaaa
AUXTIN1_alias=bbbb

But no hiding.

mabod avatar Sep 08 '20 05:09 mabod

Aliases work fine for me:

AUXTIN0_alias=aaaa
AUXTIN1_alias=bbbb

But no hiding.

Thanks! I see where i made my mistake.

distributorofpain avatar Sep 08 '20 14:09 distributorofpain

I was discussing this in the 1596 pull request mentioned above. just add "hide=AUXTIN0,AUXTIN1" in the sensors section of the glances config.

Update: i guess its not working... could of sworn i saw them go away...

distributorofpain avatar Sep 08 '20 14:09 distributorofpain

I tested with Glances v3.1.6_b1 with PsUtil v5.7.2 and it is working. I used your hide example but AUXTIN0 and 1 still show up.

mabod avatar Sep 08 '20 19:09 mabod

Pull request #1596 will fix this issue, it just got closed for some reason without being applied.

modelrockettier avatar Sep 10 '20 05:09 modelrockettier

I also want the hide function implemented, and I confirm pull request #1596 fix this. Just apply the suggested patch to glances_sensors.py if you want it now.

wolfallein avatar Oct 25 '20 13:10 wolfallein

I also confirm pull request #1596 fix this but this patch is not applied at version 3.1.6.1

dtalens avatar Jan 24 '21 16:01 dtalens

Manual #1596 fix has been applied in version 3.1.6.2 but do not work. image

dtalens avatar Mar 10 '21 22:03 dtalens

Re-apply in the develop branch => See commit https://github.com/nicolargo/glances/commit/871b4c32b22581242c326b67459c2a86f97c6c4a

Sorry for that !

nicolargo avatar Mar 13 '21 07:03 nicolargo

[EDIT]Hiding DOES work when the sensor name is in lower case [/EDIT] Hiding sensors still not working for me. (pop_os 22.04) (Alias IS working)

gauvins2 avatar May 29 '22 02:05 gauvins2

It works (tested on the latest Glances 3.2.6.4 version).

Without hide:

sensors1

Whit hide=ambiant

sensors2

cc: @gauvins2

nicolargo avatar May 29 '22 07:05 nicolargo

Hi @nicolargo, Your example doesn't hide the sensor in the upper case, as pointed out by @gauvins2 above. And I can observe that it doesn't really work.

drivetemp 1_alias=WD 8TB
drivetemp 2_alias=WD 12TB
hide=AUXTIN

Result: image

Glances v3.2.7 with PsUtil v5.9.1

hrandib avatar Aug 18 '22 08:08 hrandib

Hi, It works for me if I add lowercase aliases. No configuration changes: image

Adding this:

SYSTIN_alias=systin
AUXTIN1_alias=auxtin1
AUXTIN2_alias=auxtin2
AUXTIN3_alias=auxtin3
hide=systin,auxtin1,auxtin2,auxtin3

image

Glances version 3.2.7

dtalens avatar Aug 25 '22 21:08 dtalens

Hi, Thank you very much for the solution. Is it assumed that it will be resolved in the future and the direct way also will be available?

hrandib avatar Aug 25 '22 23:08 hrandib

@kanyck Yes, it will be corrected in the next release.

nicolargo avatar Aug 27 '22 08:08 nicolargo

Done on the develop branch (see commit 1bed69bc).

To be tested !

nicolargo avatar Aug 27 '22 09:08 nicolargo

Perhaps late to the party (just back home).

The latest Glances 3.2.7 fixes display for *the first jc42 entry. *(see attached screen capture)

On Sat, Aug 27, 2022 at 5:23 AM Nicolas Hennion @.***> wrote:

Done on the develop branch (see commit 1bed69b https://github.com/nicolargo/glances/commit/1bed69bc8a26463ee837382b7deeee328e6d3718 ).

To be tested !

— Reply to this email directly, view it on GitHub https://github.com/nicolargo/glances/issues/1590#issuecomment-1229157960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMC44MU4SLGFTSAV4BYNBB3V3HNCXANCNFSM4KNL5DSA . You are receiving this because you were mentioned.Message ID: @.***>

gauvins2 avatar Aug 27 '22 13:08 gauvins2