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

Plantage quand une interface réseau disparait #27

Closed
Madko opened this issue Jan 18, 2012 · 2 comments
Closed

Plantage quand une interface réseau disparait #27

Madko opened this issue Jan 18, 2012 · 2 comments
Labels

Comments

@Madko
Copy link

Madko commented Jan 18, 2012

Cas typique avec la virtualisation, une VM tourne, utilisant une interface (par ex ici vnet0). On lance glances, là VM s'arrête, supprimant son interface réseau, hop plantage:

glances:628:displayNetwork:KeyError: 'vnet0'

Traceback (most recent call last):
File "/usr/bin/glances", line 839, in
main()
File "/usr/bin/glances", line 823, in main
screen.update(stats)
File "/usr/bin/glances", line 495, in update
self.display(stats)
File "/usr/bin/glances", line 479, in display
network_count = screen.displayNetwork(stats.getNetwork(), stats.getNetworkInterface())
File "/usr/bin/glances", line 628, in displayNetwork
self.term_window.addnstr(self.network_y+1+i, self.network_x+10, self.__autoUnit(network[i]['rx']/elapsed_time_8) + "b", 8, self.__getColor(network[i]['rx']/elapsed_time_8, speed[network[i]['interface_name']]))
KeyError: 'vnet0'

Local variables in innermost frame:
screen_y: 72
screen_x: 237
network: [{'tx': 140040L, 'rx': 140040L, 'systime': 1, 'ipackets': 136L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 136L, 'ierrors': 0L, 'interface_name': 'lo'}, {'tx': 0L, 'rx': 0L, 'systime': 1, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 0L, 'ierrors': 0L, 'interface_name': 'wlan0'}, {'tx': 5240L, 'rx': 153904L, 'systime': 1, 'ipackets': 209L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 71L, 'ierrors': 0L, 'interface_name': 'eth0'}, {'tx': 0L, 'rx': 0L, 'systime': 1, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 0L, 'ierrors': 0L, 'interface_name': 'virbr1'}, {'tx': 0L, 'rx': 0L, 'systime': 1, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 0L, 'ierrors': 0L, 'interface_name': 'virbr1-nic'}, {'tx': 0L, 'rx': 0L, 'systime': 1, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 0L, 'ierrors': 0L, 'interface_name': 'virbr2'}, {'tx': 0L, 'rx': 0L, 'systime': 1, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 0L, 'ierrors': 0L, 'interface_name': 'virbr2-nic'}, {'tx': 0L, 'rx': 0L, 'systime': 1, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 0L, 'ierrors': 0L, 'interface_name': 'virbr0'}, {'tx': 0L, 'rx': 0L, 'systime': 1, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 0L, 'ierrors': 0L, 'interface_name': 'virbr0-nic'}, {'tx': 13660L, 'rx': 0L, 'systime': 1326897535, 'ipackets': 0L, 'oerrors': 0L, 'collisions': 0L, 'opackets': 257L, 'ierrors': 0L, 'interface_name': 'vnet0'}]
i: 9
self: <main.glancesScreen instance at 0x262b998>
networkinterface: [{'duplex': 2, 'interface_name': 'lo', 'speed': 0, 'up': 1}, {'duplex': 2, 'interface_name': 'wlan0', 'speed': 0, 'up': 0}, {'duplex': 0, 'interface_name': 'eth0', 'speed': 1000, 'up': 1}, {'duplex': 2, 'interface_name': 'virbr1', 'speed': 0, 'up': 1}, {'duplex': 0, 'interface_name': 'virbr1-nic', 'speed': 10, 'up': 0}, {'duplex': 2, 'interface_name': 'virbr2', 'speed': 0, 'up': 1}, {'duplex': 0, 'interface_name': 'virbr2-nic', 'speed': 10, 'up': 0}, {'duplex': 2, 'interface_name': 'virbr0', 'speed': 0, 'up': 1}, {'duplex': 0, 'interface_name': 'virbr0-nic', 'speed': 10, 'up': 0}]
elapsed_time: 1326897535
speed: {'lo': 0, 'virbr0-nic': 10000000, 'wlan0': 0, 'virbr1-nic': 10000000, 'virbr0': 0, 'virbr2-nic': 10000000, 'virbr2': 0, 'virbr1': 0, 'eth0': 1000000000}

Peut être sécuriser l'accès aux données du tableau network. Pas urgent comme bug non plus. Le problème arrive avec la version 1.3.4 en tout cas, j'ai pas testé avec la version 1.3.5.

[edouard@oberon ~]$ python -V
Python 2.7.2
[edouard@oberon ~]$ rpm -q libstatgrab
libstatgrab-0.17-1.fc16.x86_64
[edouard@oberon ~]$ rpm -q pystatgrab
pystatgrab-0.5-8.fc15.x86_64
[edouard@oberon ~]$ rpm -q glances

glances-1.3.4-1.fc16.noarch

Cordialement.

@nicolargo
Copy link
Owner

J'avais vu le bug et il est corrigé dans la nouvelle version 1.3.6 qui vient de sortir.

Merci pour la remontée :)

@Madko
Copy link
Author

Madko commented Jan 19, 2012

Cool merci, je vais tester ça

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

No branches or pull requests

2 participants