Skip to content

Commit

Permalink
Fix: Collector diskspare for running on windows WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
naparuba committed Oct 14, 2020
1 parent cd7e461 commit 79df46f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ class DiskUsage(Collector):


def _get_volume_paths(self):

if not os.path.exists('/etc/mtab'):
return None

fs_paths = []
with open('/etc/mtab', 'r') as f:
lines = f.readlines()
Expand Down Expand Up @@ -134,6 +138,11 @@ def launch(self):
return False

fs_paths = self._get_volume_paths()

if fs_paths is None: # running on a special system?
self.set_not_eligible('This collector is not availabe on your system, missing the /etc/mtab file for listing disks.')
return False

final_fs_details = self._get_and_unduplicate_volume_stats(fs_paths)

usage_data = {}
Expand Down

0 comments on commit 79df46f

Please sign in to comment.