I'm gettings these errors in the Zenhub log. I've listed the transforms also.

Code:
2008-12-03 10:01:28 ERROR zen.Events: Error transforming EventClassInst 
Interface ('NoneType' object has no attribute 'prepId')



Transform:

Code:
import re

fs_id = device.prepId(evt.component)
for f in device.os.interfaces():
    if f.id != fs_id: continue

    # Extract the percent and free from the summary
    m = re.search("threshold of [^:]+: current value ([\d\.]+)", evt.message)
    if not m: continue
    currentusage = (float(m.groups()[0])) * 8

    if currentusage > 1000000000:
        p = (currentusage / f.speed) * 100
        Usage = currentusage / 1000000000

    # Make a nicer summary
        evt.summary = "High Utilization: Currently (%3.1f Gbps) or %3.2f%% is 
being used." %  (Usage, p)

    elif currentusage > 1000000:
        p = (currentusage / f.speed) * 100
        Usage = currentusage / 1000000

    # Make a nicer summary
        evt.summary = "High Utilization: Currently (%3.1f Kbps) or %3.2f%%  is 
being used." %  (Usage, p)

    # Check the speed to determine the appropriate conversion
    elif currentusage > 1000:
        p = (currentusage / f.speed) * 100
        Usage = currentusage / 1000

    # Make a nicer summary
        evt.summary = "High Utilization: Currently (%3.1f Kbps) or %3.2f%%  is 
being used." %  (Usage, p)

    elif currentusage < 1000:
        p = (currentusage / f.speed) * 100
        Usage = currentusage

    # Make a nicer summary
        evt.summary = "High Utilization: Currently (%3.1f bps) or %3.2f%%  is 
being used." %  (Usage, p)



More Errors.

Code:
2008-12-03 08:07:00 ERROR zen.Events: Error transforming EventClassInst Ping 
('NoneType' object has no attribute 'group')
2008-12-03 08:07:02 ERROR zen.Events: Error transforming EventClassInst Ping 
('NoneType' object has no attribute 'group')




Transform:

Code:
import re

m = re.search("ip 10.([\d]+).([\d]+).3 is down", evt.message)
ip = "10." + str(m.group(1)) + "." + str(m.group(2)) + ".17"
my_device = device.findDevice(ip)
if my_device.pingStatus() > 0:
   evt.eventState = 2 # suppressed



What I don't understand is that it complains about the attributes yet it still 
performs the transforms. This is causing Zenhub to act up and not allow 
anything else to connect to it.




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

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

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



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

Reply via email to