Thanks for the reply. I just finished doing something very similar by modifying 
code from a post by netdata here: 
http://forums.zenoss.com/viewtopic.php?p=15694#15694

netdata's code:

Code:

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
    evt.summary = "Filesystem threshold exceeded: current value %3.1f%%" % (p)
    break




netdata's code shows the % used in the event summary which provided me with a 
sort of template to accomplish what I needed. 

netdata's code modified by me:

Code:

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
    fb = ((f.totalBytes()) - f.usedBytes()) / 1048576
    evt.summary = "Filesystem threshold exceeded: %d MB Free %3.1f%% Used" % 
(fb, p)
    break




so I pretty much stole netdata's code and added one line to calculate the free 
space in MB.

The code you wrote and the code I am using looks like they do almost the same 
thing except i think yours may be a bit more accurate in calculating the free 
bytes so i may end up using your code.

Thanks a lot for the reply. This is definitely the solution I was looking for. 
I think maybe i was originally looking in the wrong places to achieve my end 
goal.

Thanks again everyone for all your help!
brad[/url]




-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=34143#34143

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to