Advertisement
Guest User

Untitled

a guest
Dec 5th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. /opt/noc/fm/handlers/event/oam.py 959/959 100%
  2. # -*- coding: utf-8 -*-
  3. ##----------------------------------------------------------------------
  4. ## Ethernet OAM handlers
  5. ##----------------------------------------------------------------------
  6. ## Copyright (C) 2007-2014 The NOC Project
  7. ## See LICENSE for details
  8. ##----------------------------------------------------------------------
  9.  
  10. ## NOC modules
  11. from noc.inv.models import *
  12. from noc.fm.models import *
  13.  
  14. def dying_gasp(event):
  15. """
  16. Raise Chassis | PSU | Power Failed alarm from Ethernet OAM dying-gasp recieved event
  17. """
  18. alarm_class = AlarmClass.objects.get(name = "Chassis | PSU | Power Failed")
  19. i = Interface.objects.get(name = event.vars["interface"])
  20. if i.link:
  21. managed_object = i.link.other(i)[0].managed_object
  22. condition = "power loss"
  23. ActiveAlarm(managed_object = managed_object,
  24. alarm_class = alarm_class,
  25. vars = { "condition": condition }
  26. ).save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement