Open SnejPro opened 1 year ago
So these kind of disks are listed by psutil but you would like a way to filter them?
So these kind of disks are listed by psutil but you would like a way to filter them?
Yes, correct.
What's the output of psutil.disk_partitions()
?
What's the output of
psutil.disk_partitions()
?
Only disks with drive letters are displayed.
Actually, please post the output of psutil.disk_partitions(all=True)
Same issue here.
In [10]: psutil.disk_partitions(all=True)
Out[10]:
[sdiskpart(device='C:\\', mountpoint='C:\\', fstype='NTFS', opts='rw,fixed', maxfile=255, maxpath=260),
sdiskpart(device='D:\\', mountpoint='D:\\', fstype='Btrfs', opts='rw,fixed', maxfile=255, maxpath=260),
sdiskpart(device='E:\\', mountpoint='E:\\', fstype='NTFS', opts='rw,fixed', maxfile=255, maxpath=260)]
In [11]: psutil.disk_io_counters(True)
Out[11]:
{'PhysicalDrive0': sdiskio(read_count=673391, write_count=558429, read_bytes=29181166592, write_bytes=38308701696, read_time=302, write_time=172),
'PhysicalDrive1': sdiskio(read_count=2471, write_count=238, read_bytes=736361472, write_bytes=1359872, read_time=21, write_time=0)}
Same issue here.
In [10]: psutil.disk_partitions(all=True) Out[10]: [sdiskpart(device='C:\\', mountpoint='C:\\', fstype='NTFS', opts='rw,fixed', maxfile=255, maxpath=260), sdiskpart(device='D:\\', mountpoint='D:\\', fstype='Btrfs', opts='rw,fixed', maxfile=255, maxpath=260), sdiskpart(device='E:\\', mountpoint='E:\\', fstype='NTFS', opts='rw,fixed', maxfile=255, maxpath=260)] In [11]: psutil.disk_io_counters(True) Out[11]: {'PhysicalDrive0': sdiskio(read_count=673391, write_count=558429, read_bytes=29181166592, write_bytes=38308701696, read_time=302, write_time=172), 'PhysicalDrive1': sdiskio(read_count=2471, write_count=238, read_bytes=736361472, write_bytes=1359872, read_time=21, write_time=0)}
C:\, D:\ and E:\ are on one physcial drive?
C: and D: are on the internal SSD. E: is on my USB mobile hard disk.
C: and D: are on the internal SSD. E: is on my USB mobile hard disk.
but then PhysicalDrive1 is the USB hard disk, not a virtual hard disk?
I don't know. Why can't it be D:?
Actually, please post the output of
psutil.disk_partitions(all=True)
At this time 3 users with virtual user disks were logged onto the server:
>>> psutil.disk_io_counters(True)
{
'PhysicalDrive0': sdiskio(read_count=245371, write_count=601508, read_bytes=11506310656, write_bytes=11949560320, read_time=53, write_time=268),
'PhysicalDrive1': sdiskio(read_count=44750, write_count=213319, read_bytes=476360192, write_bytes=3449132032, read_time=24, write_time=143),
'PhysicalDrive2': sdiskio(read_count=16781, write_count=19941, read_bytes=92403200, write_bytes=151933440, read_time=6, write_time=7),
'PhysicalDrive4': sdiskio(read_count=33197, write_count=101242, read_bytes=354310656, write_bytes=2948272640, read_time=16, write_time=73)
}
>>> psutil.disk_partitions(all=True)
[
sdiskpart(device='C:\\', mountpoint='C:\\', fstype='NTFS', opts='rw,fixed', maxfile=255, maxpath=260),
sdiskpart(device='D:\\', mountpoint='D:\\', fstype='', opts='cdrom', maxfile=255, maxpath=260),
sdiskpart(device='G:\\', mountpoint='G:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='H:\\', mountpoint='H:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='I:\\', mountpoint='I:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='J:\\', mountpoint='J:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='K:\\', mountpoint='K:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='L:\\', mountpoint='L:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='Q:\\', mountpoint='Q:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='R:\\', mountpoint='R:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260),
sdiskpart(device='Z:\\', mountpoint='Z:\\', fstype='NTFS', opts='rw,remote', maxfile=255, maxpath=260)
]
disk_partitions shows only C:\, not the virtual disks, the cdrom drive is empty and all other sdiskparts are remote shares.
Summary
Description
I use psutil to monitor several Windows servers. Two of these servers are Windows Terminal Servers with user profile disks. Users therefore "take their data" with them when they log on to one of the terminal servers.
Unfortunately, psutil gets the performance data from these virtual disks and you can't distinguish them from "real" physical disk, because they are labled as "PhysicalDriveX"
It would therefore be good if psutil did not monitor these disks or if they could be excluded.