Skip to end of metadata
Go to start of metadata

Как подсказал zi_rus:

 

09:36 misak, noc shell в помощь
09:36 from noc.fm.models import *
09:36 ac = AlarmClass.objects.get(name='Network | EIGRP | Neighbor Down')
09:36 alarms = ActiveAlarm.objects.filter(alarm_class=ac)
09:36 
09:36 for a in alarms:
09:36 a.clear_alarm("close")
09:36 from noc.fm.models import *
09:36 alarms = ActiveAlarm.objects.filter(vars__peer__in=['195.98.32.86'])
09:36 for a in alarms:
09:36 a.clear_alarm("close")
09:36  или так
09:36 from noc.fm.models import *
09:36 from noc.sa.models import *
09:36 alarms = ActiveAlarm.objects.filter(managed_object=ManagedObject.objects.get(name="bb-zmile").id)
09:36 for a in alarms:
09:36 a.clear_alarm("close")
09:36 5 строк

Закроем такие:

# закрыть 'Network | IMPB | Unauthenticated IP-MAC' с IP = '0.0.0.0'
from noc.fm.models import *
ac = AlarmClass.objects.get(name='Network | IMPB | Unauthenticated IP-MAC')
alarms = ActiveAlarm.objects.filter(alarm_class=ac)
for a in alarms:
    if a['vars']['ip']=='0.0.0.0':
        a.clear_alarm("close")

1 Comment

  1. Unknown User (tsergey) AUTHOR

    # закроем все

    from noc.fm.models import *
    alarms = ActiveAlarm.objects.filter()
    for a in alarms:
        a.clear_alarm("close")