- Shows both the percentage used in the event summary as well as the amount of free space remaining in GB
- Changes the event severity to critical (red) when the percentage free is 5% or less
Access http://
fs_id = device.prepId(evt.component)
for f in device.os.filesystems():
if f.id != fs_id: continue
p = (float(f.usedBytes()) / f.totalBytes()) * 100
freeAmtGB = (float(f.totalBytes() - f.usedBytes())) / 1024 / 1024 / 1024
evt.summary = "Disk space low: %3.1f%% used (%3.2f GB free)" % (p, freeAmtGB)
if p >= 95.0: evt.severity = 5
break
No comments:
Post a Comment