Advertisement
Izya12

alarm_close

Jan 30th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. from noc.fm.models import *
  2. from noc.sa.models import *
  3. from noc.fm.models.activealarm  import ActiveAlarm
  4. from noc.core.debug import error_report
  5. from noc.core.mongo.connection import connect
  6. connect()
  7.  
  8. alarms = ActiveAlarm.objects.filter()
  9. for a in alarms:
  10.     try:
  11.         a.clear_alarm("close")
  12.     except:
  13.         print error_report()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement