Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /opt/noc/fm/handlers/event/oam.py 959/959 100%
- # -*- coding: utf-8 -*-
- ##----------------------------------------------------------------------
- ## Ethernet OAM handlers
- ##----------------------------------------------------------------------
- ## Copyright (C) 2007-2014 The NOC Project
- ## See LICENSE for details
- ##----------------------------------------------------------------------
- ## NOC modules
- from noc.inv.models import *
- from noc.fm.models import *
- def dying_gasp(event):
- """
- Raise Chassis | PSU | Power Failed alarm from Ethernet OAM dying-gasp recieved event
- """
- alarm_class = AlarmClass.objects.get(name = "Chassis | PSU | Power Failed")
- i = Interface.objects.get(name = event.vars["interface"])
- if i.link:
- managed_object = i.link.other(i)[0].managed_object
- condition = "power loss"
- ActiveAlarm(managed_object = managed_object,
- alarm_class = alarm_class,
- vars = { "condition": condition }
- ).save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement