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

affichage des partitions (mount) #16

Closed
mydoomfr opened this issue Dec 23, 2011 · 17 comments
Closed

affichage des partitions (mount) #16

mydoomfr opened this issue Dec 23, 2011 · 17 comments

Comments

@mydoomfr
Copy link

Glances v1.3.3 n'affiche pas correctement les partitions montées sur Ubuntu 11.10. J'ai uniquement la racine ( / ) comme le montre la capture d'écran suivante : http://i49.servimg.com/u/f49/11/19/52/01/glance10.png

Ci-joint le fichier /etc/mtab

rootfs / rootfs rw 0 0
/dev/root / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
none /proc proc rw,nosuid,nodev,noexec,relatime 0 0
none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev /dev devtmpfs rw,relatime,size=1020784k,nr_inodes=255196,mode=755 0 0
none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0
none /run tmpfs rw,nosuid,noexec,relatime,size=204220k,mode=755 0 0
none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/sda2 /home ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/sda2 /home/user/dir1/ftp ext4 rw,relatime,barrier=1,data=ordered 0 0 // Cette ligne est normal, il s'agit d'un --bind pour vsftpd

A noter que je n'ai aucun problème sur Ubuntu 11.04 et Debian 6.

@nicolargo
Copy link
Owner

Effectivement, j'ai le même problème avec ton fichier mtab. Je vais corriger cela dans la prochain release....

Merci pour la remonté du bug !

@mydoomfr
Copy link
Author

De rien !

Si tu as besoin d'informations supplémentaires, n'hésite pas.

@nicolargo
Copy link
Owner

Tu peux me renvoyer le résultat des commandes suivantes:

python

import os
os.path.abspath(os.path.join("/home", os.pardir))
os.path.abspath(os.path.join("/home/user/dir1", os.pardir))

Thx !

@mydoomfr
Copy link
Author

python

Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import os
os.path.abspath(os.path.join("/home", os.pardir))
'/'
os.path.abspath(os.path.join("/home/user/dir1/ftp", os.pardir))
'/home/user/dir1'

:-)

@nicolargo
Copy link
Owner

Et en bonus le résultat de:

os.path.dirname(os.path.abspath("/home"))
os.path.dirname(os.path.abspath("/home/user/dir1/ftp"))

@mydoomfr
Copy link
Author

python

Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import os
os.path.dirname(os.path.abspath("/home"))
'/'
os.path.dirname(os.path.abspath("/home/user/dir1/ftp"))
'/home/user/dir1'

@nicolargo
Copy link
Owner

Une dernière série pour la route...

os.path.ismount("/")
os.path.ismount("/tmp")
os.path.ismount("/home")
os.path.ismount("/home/user/dir1")

@mydoomfr
Copy link
Author

python

Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import os
os.path.ismount("/")
True
os.path.ismount("/tmp")
False
os.path.ismount("/home")
True
os.path.ismount("/home/user/dir1")
False

@nicolargo
Copy link
Owner

Strange... Il voit bien /home comme un point de montage. Je ne comprend pas qu'il ne te l'affiche pas...

@nicolargo
Copy link
Owner

Peux tu récupérer le script Python de test suivant: http://sam.nicolargo.com/owncloud/apps/files_sharing/get.php?token=f9ea4ef61b59f775848f6d23476cc1696bb1eb7b

Le lancer puis faire un copier/coller du résultat ?

@mydoomfr
Copy link
Author

./glances_test.py

[{'used_blocks': 931414L, 'mnt_point': '/', 'total_blocks': 3047472L, 'used': 3815071744L, 'avail_blocks': 1962471L, 'device_name': 'rootfs', 'avail': 8038281216L, 'total_inodes': 770048L, 'free_inodes': 653900L, 'fs_type': 'rootfs', 'avail_inodes': 653900L, 'used_inodes': 116148L, 'block_size': 4096L, 'free_blocks': 2116058L, 'io_size': 4096L, 'size': 12482445312L}]

@nicolargo
Copy link
Owner

Cela semble venir de la librairie libstatgrab...
Je viens de forcer l'utilisation de ma routine maison dans le script suivant: http://sam.nicolargo.com/owncloud/apps/files_sharing/get.php?token=e6af3ff874a5bb332e109f6102b4e6c3c4ead7be

Tu peux tester et me faire un retour ?

Merci !

@mydoomfr
Copy link
Author

Ah, en effet !

./glances_test.py

[{'mnt_point': '/', 'used': 3815186432.0, 'device_name': 'rootfs', 'avail': 8667258880.0, 'fs_type': 'rootfs', 'size': 12482445312.0}, {'mnt_point': '/', 'used': 3815186432.0, 'device_name': '/dev/root', 'avail': 8667258880.0, 'fs_type': 'ext4', 'size': 12482445312.0}, {'mnt_point': '/dev', 'used': 4096.0, 'device_name': '/dev', 'avail': 1045278720.0, 'fs_type': 'devtmpfs', 'size': 1045282816.0}, {'mnt_point': '/home', 'used': 412799315968.0, 'device_name': '/dev/sda2', 'avail': 564956393472.0, 'fs_type': 'ext4', 'size': 977755709440.0}, {'mnt_point': '/home', 'used': 412799315968.0, 'device_name': '/dev/sda2', 'avail': 564956393472.0, 'fs_type': 'ext4', 'size': 977755709440.0}]

@nicolargo
Copy link
Owner

Bon je vais faire la modification dans la version 1.3.4. Pour ne pas attendre de ton coté, il suffit de remplacer le bloc de code suivant (ligne 172):

    try:
        self.fs = statgrab.sg_get_fs_stats()
    except:
        # Replace the bugged self.fs = statgrab.sg_get_fs_stats()
        self.fs = self.glancesgrabfs.get()

par

    try:
        # Replace the bugged self.fs = statgrab.sg_get_fs_stats()
        self.fs = self.glancesgrabfs.get()
    except:
        self.fs = {}

A plus !

@nicolargo
Copy link
Owner

La version 1.3.4 corrige le bug (entre autre...): https://github.com/downloads/nicolargo/glances/glances-1.3.4.tar.gz

A+

@mydoomfr
Copy link
Author

Impeccable ! ;-)

@nicolargo
Copy link
Owner

De nada :)

Bonnes fêtes de fin d'année !

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

No branches or pull requests

2 participants