Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public IP address doesn't display anymore #1910

Closed
alkaphreak opened this issue Jul 30, 2021 · 11 comments
Closed

Public IP address doesn't display anymore #1910

alkaphreak opened this issue Jul 30, 2021 · 11 comments

Comments

@alkaphreak
Copy link

Newer version of Glances doesn't display public IP address anymore is that normal ?

Glances v3.2.2 with PsUtil v5.8.0

@nicolargo
Copy link
Owner

Nope... It's a regression....

Will have a look on it.

@nicolargo
Copy link
Owner

Corrected in the develop branch.

Will be release in Glances version 3.2.3.

Thanks for the issue report @alkaphreak .

@alkaphreak
Copy link
Author

Top, thanks to you.

@creeloper27
Copy link

creeloper27 commented Mar 9, 2023

Did this happen again or did it get removed on purpose some versions ago?
I just noticed that I can't see the IPs,
I am running Glances v3.2.4.2 with PsUtil v5.9.0 on KDE neon 5.27 x86_64 with Linux 5.19.0-35-generic.

In another machine I have running Glances v3.3.0.4 with PsUtil v5.8.0 on Debian GNU/Linux 11 (bullseye) x86_64 with Linux 5.10.0-21-amd64 it does still show up.

@RazCrimson
Copy link
Collaborator

@creeloper27
Can you just check if you the netifaces python module installed?
The IP plugin requires that dependency to execute, otherwise the plugin is silently disabled.

Another option would be to try out the docker method to run glances mentioned in the readme

@creeloper27
Copy link

creeloper27 commented Mar 10, 2023

I just checked and netifaces is already installed.

>pip install netifaces      
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: netifaces in /usr/lib/python3/dist-packages (0.11.0)

Actually, I think it's managed by apt, it still seems to be up to date tho.

>sudo apt install python3-netifaces
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-netifaces is already the newest version (0.11.0-1build2).
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

Here is my log as well (showing only latest run as I just cleared it before this glances run).

>cat ~/.local/share/glances/glances.log
2023-03-10 18:08:42,433 -- INFO -- Start Glances 3.2.4.2
2023-03-10 18:08:42,433 -- INFO -- CPython 3.10.6 (/usr/bin/python3) and psutil 5.9.0 detected
2023-03-10 18:08:42,437 -- INFO -- Read configuration file '/etc/glances/glances.conf'
2023-03-10 18:08:42,444 -- INFO -- Start GlancesStandalone mode
2023-03-10 18:08:43,074 -- WARNING -- Missing Python Lib (No module named 'pySMART'), HDD Smart plugin is disabled
2023-03-10 18:08:43,185 -- ERROR -- docker plugin - Can not connect to Docker (Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory')))
2023-03-10 18:08:43,186 -- WARNING -- Missing Python Lib (No module named 'pymdstat'), Raid plugin is disabled
2023-03-10 18:08:43,209 -- WARNING -- Sparklines module not found (No module named 'sparklines')
2023-03-10 18:08:43,247 -- WARNING -- Missing Python Lib (No module named 'py3nvml'), Nvidia GPU plugin is disabled
2023-03-10 18:08:43,252 -- WARNING -- Missing Python Lib (No module named 'wifi'), Wifi plugin is disabled
2023-03-10 18:08:43,252 -- WARNING -- Wifi lib is not compliant with Python 3, Wifi plugin is disabled

@RazCrimson
Copy link
Collaborator

@creeloper27
Can you please attach the output of glances --issue too?

@creeloper27
Copy link

Here it is:

>glances --issue
====================================================================================================================
Glances 3.2.4.2 (/usr/lib/python3/dist-packages/glances/__init__.py)
Python 3.10.6 (/usr/bin/python3)
PsUtil 5.9.0 (/usr/lib/python3/dist-packages/psutil/__init__.py)
====================================================================================================================
alert         [OK]    0.00001s []
amps          [OK]    0.00018s key=name [{'key': 'name', 'name': 'Dropbox', 'result': None, 'refresh': 3.0
cloud         [OK]    0.00005s {}
connections   [N/A]
core          [OK]    0.00054s {'phys': 4, 'log': 8}
cpu           [OK]    0.00037s {'total': 13.9, 'user': 13.2, 'nice': 0.0, 'system': 0.2, 'idle': 86.2, 'io
diskio        [OK]    0.00084s key=disk_name [{'time_since_update': 3.0061540603637695, 'disk_name': 'nvme
docker        [OK]    0.00003s []
folders       [OK]    0.00004s []
fs            [OK]    0.00088s key=mnt_point [{'device_name': '/dev/sda4', 'fs_type': 'ext4', 'mnt_point':
gpu           [OK]    0.00004s []
help          [OK]    0.00000s None
ip            [N/A]
irq           [N/A]
load          [OK]    0.00004s {'min1': 1.5810546875, 'min5': 1.45263671875, 'min15': 1.12744140625, 'cpuc
mem           [OK]    0.00017s {'total': 16657678336, 'available': 12892565504, 'percent': 22.6, 'used': 3
memswap       [OK]    0.00027s {'total': 8589930496, 'used': 0, 'free': 8589930496, 'percent': 0.0, 'sin':
network       [OK]    0.00186s key=interface_name [{'interface_name': 'lo', 'alias': None, 'time_since_upd
now           [OK]    0.00001s 2023-03-12 18:06:26 CET
percpu        [OK]    0.00042s key=cpu_number [{'key': 'cpu_number', 'cpu_number': 0, 'total': 6.4, 'user'
ports         [OK]    0.00001s [{'host': '192.168.1.1', 'port': 0, 'description': 'DefaultGateway', 'refre
processcount  [OK]    0.07993s {'total': 269, 'running': 1, 'sleeping': 193, 'thread': 960, 'pid_max': 0}
processlist   [OK]    0.00021s key=pid [{'pid': 1989, 'num_threads': 38, 'cpu_times': pcputimes(user=38.38
psutilversion [OK]    0.00005s (5, 9, 0)
quicklook     [OK]    0.00032s {'cpu': 13.9, 'percpu': [{'key': 'cpu_number', 'cpu_number': 0, 'total': 6.
raid          [N/A]
sensors       [OK]    0.00001s key=label [{'label': 'acpitz 1', 'value': 55, 'warning': None, 'critical': 
smart         [N/A]
system        [OK]    0.00001s {'os_name': 'Linux', 'hostname': 'laptop-hp-cattai-lorenzo', 'platform': '6
uptime        [OK]    0.00011s {'seconds': 171521}
wifi          [N/A]

@RazCrimson
Copy link
Collaborator

@creeloper27

It seems the IP plugin is disabled, can you please try running glances with --enable-plugin ip and check?

If it does indeed work, then please check the file at /etc/glances/glances.conf for the IP plugin being disabled.
Configuration Reference: Link

@creeloper27
Copy link

creeloper27 commented Mar 14, 2023

Running glances --enable-plugin ip does indeed work and correctly display the IPs.

I just checked and /etc/glances/glances.conf had these lines:

173
174 [ip]
175 disable=True
176

I simply switched them to:

173
174 [ip]
175 disable=False
176

And that did the job.

Thanks for the support @RazCrimson

@creeloper27
Copy link

creeloper27 commented Mar 14, 2023

To add to this, if anyone else has the same problem but does not have root access on the system you can use the user config over at: ~/.config/glances/glances.conf (as explained in the docs here)

Ensure that the destination folder exists and copy the whole config file from the system one if the config file does not already exist:

test ! -e ~/.config/glances/glances.conf && mkdir -p ~/.config/glances/ && cp /etc/glances/glances.conf ~/.config/glances/glances.conf

Edit the config:

nano ~/.config/glances/glances.conf

Find the lines:

[ip]
disable=True

and replace them with:

[ip]
disable=False

Or you can instead run this oneliner that will do everything for you all at once:

test ! -e ~/.config/glances/glances.conf && (mkdir -p ~/.config/glances/ && cp /etc/glances/glances.conf ~/.config/glances/glances.conf); sed -i '/\[ip\]/{$!{N;s/\[ip\]\ndisable=True/\[ip\]\ndisable=False/;ty;P;D;:y}}' ~/.config/glances/glances.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants