def used_inodes_percent(self, check_config):
check_config = self._strip_percent_sign_from_check_config(check_config)
for part in self.psutil.disk_partitions(all=False):
s = os.statvfs(part.mountpoint)
try:
inodes_usage = int((s.f_files - s.f_favail) * 100 / s.f_files)
except ZeroDivisionError:
continue
status = self._value_to_status_less(
inodes_usage, check_config, self._strip_percent_sign
)
if status != self.STATUS_OK:
return (
status,
'Partition {} uses {}% of inodes'.format(part.mountpoint,
inodes_usage)
)
return self.STATUS_OK, 'Inodes usage correct'
评论列表
文章目录