cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
424
Views
2
Helpful
1
Replies

Generate alarm with python for nso 6.1.2

Arne Vellinga
Level 1
Level 1

Is it possible to generate an alarm with python for nso 6.1.2.

I cannot find a good example here: ncs.alarm - Network Services Orchestrator (NSO) API v6.1 - Document - Cisco DevNet

1 Accepted Solution

Accepted Solutions

Arne Vellinga
Level 1
Level 1

Managed to make it work:

def create_alarm(alarm_content, device):
        _alarm = ncs.alarm.Alarm(managed_device=device,
        managed_object=ncs.alarm.managed_object_instance("/ncs:devices/ncs:device[ncs:name='" + device + "']"),
        alarm_type='revision-error',
        specific_problem='error',
        severity='warning',
        alarm_text='error')
        ncs.alarm.raise_alarm(_alarm)

View solution in original post

1 Reply 1

Arne Vellinga
Level 1
Level 1

Managed to make it work:

def create_alarm(alarm_content, device):
        _alarm = ncs.alarm.Alarm(managed_device=device,
        managed_object=ncs.alarm.managed_object_instance("/ncs:devices/ncs:device[ncs:name='" + device + "']"),
        alarm_type='revision-error',
        specific_problem='error',
        severity='warning',
        alarm_text='error')
        ncs.alarm.raise_alarm(_alarm)